| Index: ash/test/ash_test_base.cc
|
| diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
|
| index eaa2288e70056b6b811e52d1ef69ab082e4f41b4..3dfe231efad045355c1f35e660694f23eba51621 100644
|
| --- a/ash/test/ash_test_base.cc
|
| +++ b/ash/test/ash_test_base.cc
|
| @@ -14,8 +14,11 @@
|
| #include "ash/test/test_shell_delegate.h"
|
| #include "base/run_loop.h"
|
| #include "content/public/test/web_contents_tester.h"
|
| +#include "ui/aura/client/aura_constants.h"
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/root_window.h"
|
| +#include "ui/aura/test/test_window_delegate.h"
|
| +#include "ui/aura/window_delegate.h"
|
| #include "ui/base/ime/text_input_test_support.h"
|
| #include "ui/compositor/layer_animator.h"
|
| #include "ui/gfx/display.h"
|
| @@ -78,6 +81,53 @@ void AshTestBase::UpdateDisplay(const std::string& display_specs) {
|
| display_manager_test_api.UpdateDisplay(display_specs);
|
| }
|
|
|
| +aura::Window* AshTestBase::CreateTestWindowInShellWithId(int id) {
|
| + return CreateTestWindowInShellWithDelegate(NULL, id, gfx::Rect());
|
| +}
|
| +
|
| +aura::Window* AshTestBase::CreateTestWindowInShellWithBounds(
|
| + const gfx::Rect& bounds) {
|
| + return CreateTestWindowInShellWithDelegate(NULL, 0, bounds);
|
| +}
|
| +
|
| +aura::Window* AshTestBase::CreateTestWindowInShell(SkColor color,
|
| + int id,
|
| + const gfx::Rect& bounds) {
|
| + return CreateTestWindowInShellWithDelegate(
|
| + new aura::test::ColorTestWindowDelegate(color), id, bounds);
|
| +}
|
| +
|
| +aura::Window* AshTestBase::CreateTestWindowInShellWithDelegate(
|
| + aura::WindowDelegate* delegate,
|
| + int id,
|
| + const gfx::Rect& bounds) {
|
| + return CreateTestWindowInShellWithDelegateAndType(
|
| + delegate,
|
| + aura::client::WINDOW_TYPE_NORMAL,
|
| + id,
|
| + bounds);
|
| +}
|
| +
|
| +aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType(
|
| + aura::WindowDelegate* delegate,
|
| + aura::client::WindowType type,
|
| + int id,
|
| + const gfx::Rect& bounds) {
|
| + aura::Window* window = new aura::Window(delegate);
|
| + window->set_id(id);
|
| + window->SetType(type);
|
| + window->Init(ui::LAYER_TEXTURED);
|
| + window->SetBounds(bounds);
|
| + window->Show();
|
| + AddToRootWindow(window);
|
| + window->SetProperty(aura::client::kCanMaximizeKey, true);
|
| + return window;
|
| +}
|
| +
|
| +void AshTestBase::AddToRootWindow(aura::Window* window) {
|
| + window->SetDefaultParentByTargetRoot(Shell::GetPrimaryRootWindow());
|
| +}
|
| +
|
| void AshTestBase::RunAllPendingInMessageLoop() {
|
| #if !defined(OS_MACOSX)
|
| DCHECK(MessageLoopForUI::current() == &message_loop_);
|
|
|