| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 EXPECT_EQ("0,0 444x333", primary.bounds().ToString()); | 92 EXPECT_EQ("0,0 444x333", primary.bounds().ToString()); |
| 93 EXPECT_EQ(2, gfx::Screen::GetNativeScreen()->GetNumDisplays()); | 93 EXPECT_EQ(2, gfx::Screen::GetNativeScreen()->GetNumDisplays()); |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace | 97 } // namespace |
| 98 | 98 |
| 99 typedef test::AshTestBase DisplayControllerTest; | 99 typedef test::AshTestBase DisplayControllerTest; |
| 100 | 100 |
| 101 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 102 // TOD(oshima): Windows creates a window with smaller client area. | 102 // TODO(oshima): Windows creates a window with smaller client area. |
| 103 // Fix this and enable tests. | 103 // Fix this and enable tests. |
| 104 #define MAYBE_SecondaryDisplayLayout DISABLED_SecondaryDisplayLayout | 104 #define MAYBE_SecondaryDisplayLayout DISABLED_SecondaryDisplayLayout |
| 105 #define MAYBE_BoundsUpdated DISABLED_BoundsUpdated | 105 #define MAYBE_BoundsUpdated DISABLED_BoundsUpdated |
| 106 #define MAYBE_UpdateDisplayWithHostOrigin DISABLED_UpdateDisplayWithHostOrigin | 106 #define MAYBE_UpdateDisplayWithHostOrigin DISABLED_UpdateDisplayWithHostOrigin |
| 107 #define MAYBE_CursorDeviceScaleFactorSwapPrimary \ |
| 108 DISABLED_CursorDeviceScaleFactorSwapPrimary |
| 107 #define MAYBE_Shutdown DISABLED_Shutdown | 109 #define MAYBE_Shutdown DISABLED_Shutdown |
| 108 #else | 110 #else |
| 109 #define MAYBE_SecondaryDisplayLayout SecondaryDisplayLayout | 111 #define MAYBE_SecondaryDisplayLayout SecondaryDisplayLayout |
| 110 #define MAYBE_BoundsUpdated BoundsUpdated | 112 #define MAYBE_BoundsUpdated BoundsUpdated |
| 113 #define MAYBE_CursorDeviceScaleFactorSwapPrimary \ |
| 114 CursorDeviceScaleFactorSwapPrimary |
| 111 #define MAYBE_UpdateDisplayWithHostOrigin UpdateDisplayWithHostOrigin | 115 #define MAYBE_UpdateDisplayWithHostOrigin UpdateDisplayWithHostOrigin |
| 112 #define MAYBE_Shutdown Shutdown | 116 #define MAYBE_Shutdown Shutdown |
| 113 #endif | 117 #endif |
| 114 | 118 |
| 115 TEST_F(DisplayControllerShutdownTest, MAYBE_Shutdown) { | 119 TEST_F(DisplayControllerShutdownTest, MAYBE_Shutdown) { |
| 116 UpdateDisplay("444x333, 200x200"); | 120 UpdateDisplay("444x333, 200x200"); |
| 117 } | 121 } |
| 118 | 122 |
| 119 // Flaky - crbug.com/161857 | 123 // Flaky - crbug.com/161857 |
| 120 TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) { | 124 TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 EXPECT_EQ(third_display.id(), ScreenAsh::GetSecondaryDisplay().id()); | 495 EXPECT_EQ(third_display.id(), ScreenAsh::GetSecondaryDisplay().id()); |
| 492 EXPECT_EQ( | 496 EXPECT_EQ( |
| 493 primary_root, | 497 primary_root, |
| 494 display_controller->GetRootWindowForDisplayId(primary_display.id())); | 498 display_controller->GetRootWindowForDisplayId(primary_display.id())); |
| 495 EXPECT_NE( | 499 EXPECT_NE( |
| 496 primary_root, | 500 primary_root, |
| 497 display_controller->GetRootWindowForDisplayId(third_display.id())); | 501 display_controller->GetRootWindowForDisplayId(third_display.id())); |
| 498 EXPECT_TRUE(primary_root->Contains(launcher_window)); | 502 EXPECT_TRUE(primary_root->Contains(launcher_window)); |
| 499 } | 503 } |
| 500 | 504 |
| 501 TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) { | 505 TEST_F(DisplayControllerTest, MAYBE_CursorDeviceScaleFactorSwapPrimary) { |
| 502 DisplayController* display_controller = | 506 DisplayController* display_controller = |
| 503 Shell::GetInstance()->display_controller(); | 507 Shell::GetInstance()->display_controller(); |
| 504 | 508 |
| 505 UpdateDisplay("200x200,200x200*2"); | 509 UpdateDisplay("200x200,200x200*2"); |
| 506 gfx::Display primary_display = Shell::GetScreen()->GetPrimaryDisplay(); | 510 gfx::Display primary_display = Shell::GetScreen()->GetPrimaryDisplay(); |
| 507 gfx::Display secondary_display = ScreenAsh::GetSecondaryDisplay(); | 511 gfx::Display secondary_display = ScreenAsh::GetSecondaryDisplay(); |
| 508 | 512 |
| 509 aura::RootWindow* primary_root = | 513 aura::RootWindow* primary_root = |
| 510 display_controller->GetRootWindowForDisplayId(primary_display.id()); | 514 display_controller->GetRootWindowForDisplayId(primary_display.id()); |
| 511 aura::RootWindow* secondary_root = | 515 aura::RootWindow* secondary_root = |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 UpdateDisplay("100+200-100x200,300+500-200x300"); | 583 UpdateDisplay("100+200-100x200,300+500-200x300"); |
| 580 ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); | 584 ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); |
| 581 EXPECT_EQ("100,200", root_windows[0]->GetHostOrigin().ToString()); | 585 EXPECT_EQ("100,200", root_windows[0]->GetHostOrigin().ToString()); |
| 582 EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString()); | 586 EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString()); |
| 583 EXPECT_EQ("300,500", root_windows[1]->GetHostOrigin().ToString()); | 587 EXPECT_EQ("300,500", root_windows[1]->GetHostOrigin().ToString()); |
| 584 EXPECT_EQ("200x300", root_windows[1]->GetHostSize().ToString()); | 588 EXPECT_EQ("200x300", root_windows[1]->GetHostSize().ToString()); |
| 585 } | 589 } |
| 586 | 590 |
| 587 } // namespace test | 591 } // namespace test |
| 588 } // namespace ash | 592 } // namespace ash |
| OLD | NEW |