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

Unified Diff: ash/display/display_controller_unittest.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First cut for review/trybots Created 7 years, 2 months 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/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 3d4acf2708afcb245219669b4c3b037649a6b715..f6bb47ed138a62e3bae2b516c589c54e76059904 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -258,7 +258,7 @@ class TestEventHandler : public ui::EventHandler {
private:
gfx::Point mouse_location_;
- aura::RootWindow* target_root_;
+ aura::Window* target_root_;
float touch_radius_x_;
float touch_radius_y_;
@@ -547,9 +547,9 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
display_manager->SetLayoutForCurrentDisplays(display_layout);
EXPECT_NE(primary_display.id(), secondary_display.id());
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
EXPECT_NE(primary_root, secondary_root);
aura::Window* launcher_window =
@@ -641,9 +641,9 @@ TEST_F(DisplayControllerTest, SwapPrimaryForLegacyShelfLayout) {
display_manager->SetLayoutForCurrentDisplays(display_layout);
EXPECT_NE(primary_display.id(), secondary_display.id());
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
EXPECT_NE(primary_root, secondary_root);
aura::Window* launcher_window =
@@ -732,9 +732,9 @@ TEST_F(DisplayControllerTest, SwapPrimaryById) {
display_manager->SetLayoutForCurrentDisplays(display_layout);
EXPECT_NE(primary_display.id(), secondary_display.id());
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
aura::Window* launcher_window =
Launcher::ForPrimaryDisplay()->shelf_widget()->GetNativeView();
@@ -850,20 +850,20 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
gfx::Display primary_display = Shell::GetScreen()->GetPrimaryDisplay();
gfx::Display secondary_display = ScreenAsh::GetSecondaryDisplay();
- aura::RootWindow* primary_root =
+ aura::Window* primary_root =
display_controller->GetRootWindowForDisplayId(primary_display.id());
- aura::RootWindow* secondary_root =
+ aura::Window* secondary_root =
display_controller->GetRootWindowForDisplayId(secondary_display.id());
EXPECT_NE(primary_root, secondary_root);
test::CursorManagerTestApi test_api(Shell::GetInstance()->cursor_manager());
- EXPECT_EQ(1.0f,
- primary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(1.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(2.0f,
- secondary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(2.0f, secondary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
@@ -872,13 +872,13 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
// Cursor's device scale factor should be updated accroding to the swap of
// primary and secondary.
- EXPECT_EQ(1.0f,
- secondary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(1.0f, secondary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(2.0f,
- primary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(2.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
// Deleting 2nd display.
@@ -889,8 +889,8 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(1.0f,
- primary_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
+ EXPECT_EQ(1.0f, primary_root->GetDispatcher()->AsRootWindowHostDelegate()->
+ GetDeviceScaleFactor());
EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
}

Powered by Google App Engine
This is Rietveld 408576698