Chromium Code Reviews| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
| 9 #include "ash/display/display_layout_store.h" | 9 #include "ash/display/display_layout_store.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 574 window_state->OnWMEvent(&toggle_fullscreen_event); | 574 window_state->OnWMEvent(&toggle_fullscreen_event); |
| 575 EXPECT_TRUE(window_state->IsFullscreen()); | 575 EXPECT_TRUE(window_state->IsFullscreen()); |
| 576 EXPECT_EQ("0,0 250x250", w1->bounds().ToString()); | 576 EXPECT_EQ("0,0 250x250", w1->bounds().ToString()); |
| 577 // Dock mode. | 577 // Dock mode. |
| 578 TestObserver observer; | 578 TestObserver observer; |
| 579 display_info_list.clear(); | 579 display_info_list.clear(); |
| 580 display_info_list.push_back(external_display_info); | 580 display_info_list.push_back(external_display_info); |
| 581 display_manager->OnNativeDisplaysChanged(display_info_list); | 581 display_manager->OnNativeDisplaysChanged(display_info_list); |
| 582 EXPECT_EQ(1U, display_manager->GetNumDisplays()); | 582 EXPECT_EQ(1U, display_manager->GetNumDisplays()); |
| 583 EXPECT_EQ(1U, display_manager->num_connected_displays()); | 583 EXPECT_EQ(1U, display_manager->num_connected_displays()); |
| 584 EXPECT_EQ(0, observer.GetChangedDisplayIdAndReset()); | 584 // Observers are called due to primary change. |
| 585 EXPECT_EQ(0, observer.GetBoundsChangedCountAndReset()); | 585 EXPECT_EQ(2, observer.GetChangedDisplayIdAndReset()); |
| 586 EXPECT_EQ(0, observer.GetWorkareaChangedCountAndReset()); | 586 EXPECT_EQ(1, observer.GetBoundsChangedCountAndReset()); |
| 587 EXPECT_EQ(1, observer.GetWorkareaChangedCountAndReset()); | |
|
Jun Mukai
2014/11/20 00:58:38
better to modify observer to recognize the primary
oshima
2014/11/20 01:12:20
Done.
| |
| 587 EXPECT_EQ(1, observer.CountAndReset()); | 588 EXPECT_EQ(1, observer.CountAndReset()); |
| 588 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 589 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
| 589 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 590 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
| 590 | 591 |
| 591 EXPECT_TRUE(window_state->IsFullscreen()); | 592 EXPECT_TRUE(window_state->IsFullscreen()); |
| 592 EXPECT_EQ("0,0 500x500", w1->bounds().ToString()); | 593 EXPECT_EQ("0,0 500x500", w1->bounds().ToString()); |
| 593 } | 594 } |
| 594 | 595 |
| 595 TEST_F(DisplayControllerTest, BoundsUpdated) { | 596 TEST_F(DisplayControllerTest, BoundsUpdated) { |
| 596 if (!SupportsMultipleDisplays()) | 597 if (!SupportsMultipleDisplays()) |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); | 1328 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); |
| 1328 | 1329 |
| 1329 // Switching back to single display. | 1330 // Switching back to single display. |
| 1330 UpdateDisplay("300x400"); | 1331 UpdateDisplay("300x400"); |
| 1331 EXPECT_EQ("aura_root_0", GetXWindowName( | 1332 EXPECT_EQ("aura_root_0", GetXWindowName( |
| 1332 Shell::GetPrimaryRootWindow()->GetHost())); | 1333 Shell::GetPrimaryRootWindow()->GetHost())); |
| 1333 } | 1334 } |
| 1334 #endif | 1335 #endif |
| 1335 | 1336 |
| 1336 } // namespace ash | 1337 } // namespace ash |
| OLD | NEW |