Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2607)

Unified Diff: ash/extended_desktop_unittest.cc

Issue 64933002: Eliminate Shell::RootWindowList in favor of aura::Window::Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/extended_desktop_unittest.cc
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index 689c546142808a9ae66581997624354108835843..d6b5db21fc8c16bea258cd11e54f382880bb3eb9 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());

Powered by Google App Engine
This is Rietveld 408576698