summaryrefslogtreecommitdiffstats
path: root/ash/extended_desktop_unittest.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 05:52:59 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 05:52:59 +0000
commit3433d4d6dfdae531334f216b78dc718eec268e20 (patch)
tree0399b304b7ae15b6bfac540d63b0a3e714c8c5e6 /ash/extended_desktop_unittest.cc
parent612a89c61cc97e3dfdbe08beeff57dca1825806d (diff)
downloadchromium_src-3433d4d6dfdae531334f216b78dc718eec268e20.zip
chromium_src-3433d4d6dfdae531334f216b78dc718eec268e20.tar.gz
chromium_src-3433d4d6dfdae531334f216b78dc718eec268e20.tar.bz2
Eliminate Shell::RootWindowList in favor of aura::Window::Windows.
This is necessary as part of my plan to rework RootWindow, specifically making it not be a subclass of Window. (It will eventually be renamed WindowEventDispatcher). Code that expected to get the RootWindow interface from this type can still call GetDispatcher() on members of the returned vector of Windows. R=oshima@chromium.org http://crbug.com/308843 Review URL: https://codereview.chromium.org/64933002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/extended_desktop_unittest.cc')
-rw-r--r--ash/extended_desktop_unittest.cc54
1 files changed, 28 insertions, 26 deletions
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index 689c546..d6b5db2 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -75,7 +75,7 @@ class MoveWindowByClickEventHandler : public ui::EventHandler {
// ui::EventHandler overrides:
virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
if (event->type() == ui::ET_MOUSE_RELEASED) {
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
DCHECK_LT(1u, root_windows.size());
root_windows[1]->AddChild(target_);
}
@@ -161,11 +161,11 @@ TEST_F(ExtendedDesktopTest, Basic) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
// All root windows must have the root window controller.
ASSERT_EQ(2U, root_windows.size());
- for (Shell::RootWindowList::const_iterator iter = root_windows.begin();
+ for (aura::Window::Windows::const_iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
EXPECT_TRUE(internal::GetRootWindowController(*iter) != NULL);
}
@@ -183,7 +183,7 @@ TEST_F(ExtendedDesktopTest, Activation) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
views::Widget* widget_on_1st = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
views::Widget* widget_on_2nd =
@@ -217,7 +217,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
views::Widget* widget_on_1st = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView()));
@@ -255,12 +255,14 @@ TEST_F(ExtendedDesktopTest, TestCursor) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
- EXPECT_EQ(ui::kCursorPointer, root_windows[0]->last_cursor().native_type());
- EXPECT_EQ(ui::kCursorPointer, root_windows[1]->last_cursor().native_type());
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
+ aura::WindowEventDispatcher* dispatcher0 = root_windows[0]->GetDispatcher();
+ aura::WindowEventDispatcher* dispatcher1 = root_windows[1]->GetDispatcher();
+ EXPECT_EQ(ui::kCursorPointer, dispatcher0->last_cursor().native_type());
+ EXPECT_EQ(ui::kCursorPointer, dispatcher1->last_cursor().native_type());
Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorCopy);
- EXPECT_EQ(ui::kCursorCopy, root_windows[0]->last_cursor().native_type());
- EXPECT_EQ(ui::kCursorCopy, root_windows[1]->last_cursor().native_type());
+ EXPECT_EQ(ui::kCursorCopy, dispatcher0->last_cursor().native_type());
+ EXPECT_EQ(ui::kCursorCopy, dispatcher1->last_cursor().native_type());
}
TEST_F(ExtendedDesktopTest, TestCursorLocation) {
@@ -268,7 +270,7 @@ TEST_F(ExtendedDesktopTest, TestCursorLocation) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
aura::test::WindowTestApi root_window0_test_api(root_windows[0]);
aura::test::WindowTestApi root_window1_test_api(root_windows[1]);
@@ -291,7 +293,7 @@ TEST_F(ExtendedDesktopTest, CycleWindows) {
return;
UpdateDisplay("700x500,500x500");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
WindowCycleController* controller =
Shell::GetInstance()->window_cycle_controller();
@@ -343,7 +345,7 @@ TEST_F(ExtendedDesktopTest, GetRootWindowAt) {
UpdateDisplay("700x500,500x500");
SetSecondaryDisplayLayout(DisplayLayout::LEFT);
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(root_windows[1], wm::GetRootWindowAt(gfx::Point(-400, 100)));
EXPECT_EQ(root_windows[1], wm::GetRootWindowAt(gfx::Point(-1, 100)));
@@ -365,7 +367,7 @@ TEST_F(ExtendedDesktopTest, GetRootWindowMatching) {
UpdateDisplay("700x500,500x500");
SetSecondaryDisplayLayout(DisplayLayout::LEFT);
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
// Containing rect.
EXPECT_EQ(root_windows[1],
@@ -403,7 +405,7 @@ TEST_F(ExtendedDesktopTest, Capture) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
aura::test::EventCountDelegate r1_d1;
aura::test::EventCountDelegate r1_d2;
@@ -462,7 +464,7 @@ TEST_F(ExtendedDesktopTest, MoveWindow) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
views::Widget* d1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
EXPECT_EQ(root_windows[0], d1->GetNativeView()->GetRootWindow());
@@ -500,7 +502,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowByMouseClick) {
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
aura::test::EventCountDelegate delegate;
scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
&delegate, 0, gfx::Rect(10, 10, 100, 100), root_windows[0]));
@@ -522,7 +524,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowToDisplay) {
return;
UpdateDisplay("1000x1000,1000x1000");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
gfx::Display display0 = Shell::GetScreen()->GetDisplayMatching(
root_windows[0]->GetBoundsInScreen());
@@ -554,7 +556,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) {
return;
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
views::Widget* w1_t1 = CreateTestWidgetWithParent(
w1, gfx::Rect(50, 50, 50, 50), false /* transient */);
@@ -614,7 +616,7 @@ TEST_F(ExtendedDesktopTest, ConvertPoint) {
return;
gfx::Screen* screen = Shell::GetInstance()->screen();
UpdateDisplay("1000x600,600x400");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
gfx::Display display_1 = screen->GetDisplayNearestWindow(root_windows[0]);
EXPECT_EQ("0,0", display_1.bounds().origin().ToString());
gfx::Display display_2 = screen->GetDisplayNearestWindow(root_windows[1]);
@@ -705,7 +707,7 @@ TEST_F(ExtendedDesktopTest, StayInSameRootWindow) {
return;
UpdateDisplay("100x100,200x200");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 50, 50));
EXPECT_EQ(root_windows[0], w1->GetNativeView()->GetRootWindow());
w1->SetBounds(gfx::Rect(150, 10, 50, 50));
@@ -747,7 +749,7 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) {
return;
UpdateDisplay("100x100,200x200");
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
// Create normal windows on both displays.
views::Widget* widget1 = CreateTestWidget(
@@ -779,13 +781,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) {
// The lock window should get events on both root windows.
aura::test::EventGenerator& event_generator(GetEventGenerator());
- event_generator.set_current_root_window(root_windows[0]);
+ event_generator.set_current_root_window(root_windows[0]->GetDispatcher());
event_generator.PressKey(ui::VKEY_A, 0);
event_generator.ReleaseKey(ui::VKEY_A, 0);
EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow());
EXPECT_EQ("a", UTF16ToASCII(textfield->text()));
- event_generator.set_current_root_window(root_windows[1]);
+ event_generator.set_current_root_window(root_windows[1]->GetDispatcher());
event_generator.PressKey(ui::VKEY_B, 0);
event_generator.ReleaseKey(ui::VKEY_B, 0);
EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow());
@@ -802,13 +804,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) {
// on both root windows.
UpdateDisplay("100x100,200x200");
root_windows = Shell::GetAllRootWindows();
- event_generator.set_current_root_window(root_windows[0]);
+ event_generator.set_current_root_window(root_windows[0]->GetDispatcher());
event_generator.PressKey(ui::VKEY_D, 0);
event_generator.ReleaseKey(ui::VKEY_D, 0);
EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow());
EXPECT_EQ("abcd", UTF16ToASCII(textfield->text()));
- event_generator.set_current_root_window(root_windows[1]);
+ event_generator.set_current_root_window(root_windows[1]->GetDispatcher());
event_generator.PressKey(ui::VKEY_E, 0);
event_generator.ReleaseKey(ui::VKEY_E, 0);
EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow());