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

Side by Side Diff: ash/display/display_controller_unittest.cc

Issue 559213002: Force calling PostDisplayConfigurationChange() even if earyling out in UpdateDisplays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittests Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/display/display_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 UpdateDisplay("400x500*2,300x300"); 648 UpdateDisplay("400x500*2,300x300");
649 EXPECT_EQ(1, observer.CountAndReset()); 649 EXPECT_EQ(1, observer.CountAndReset());
650 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); 650 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
651 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); 651 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset());
652 ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); 652 ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays());
653 EXPECT_EQ("0,0 200x250", GetPrimaryDisplay().bounds().ToString()); 653 EXPECT_EQ("0,0 200x250", GetPrimaryDisplay().bounds().ToString());
654 EXPECT_EQ("0,250 300x300", GetSecondaryDisplay().bounds().ToString()); 654 EXPECT_EQ("0,250 300x300", GetSecondaryDisplay().bounds().ToString());
655 655
656 // No change 656 // No change
657 UpdateDisplay("400x500*2,300x300"); 657 UpdateDisplay("400x500*2,300x300");
658 EXPECT_EQ(0, observer.CountAndReset()); 658 // We still call into Pre/PostDisplayConfigurationChange().
659 EXPECT_EQ(1, observer.CountAndReset());
659 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); 660 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
660 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); 661 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset());
661 662
662 // Rotation 663 // Rotation
663 observer.GetRotationChangedCountAndReset(); // we only want to reset. 664 observer.GetRotationChangedCountAndReset(); // we only want to reset.
664 int64 primary_id = GetPrimaryDisplay().id(); 665 int64 primary_id = GetPrimaryDisplay().id();
665 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90); 666 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90);
666 EXPECT_EQ(1, observer.GetRotationChangedCountAndReset()); 667 EXPECT_EQ(1, observer.GetRotationChangedCountAndReset());
667 EXPECT_EQ(1, observer.CountAndReset()); 668 EXPECT_EQ(1, observer.CountAndReset());
668 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); 669 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); 1335 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost()));
1335 1336
1336 // Switching back to single display. 1337 // Switching back to single display.
1337 UpdateDisplay("300x400"); 1338 UpdateDisplay("300x400");
1338 EXPECT_EQ("aura_root_0", GetXWindowName( 1339 EXPECT_EQ("aura_root_0", GetXWindowName(
1339 Shell::GetPrimaryRootWindow()->GetHost())); 1340 Shell::GetPrimaryRootWindow()->GetHost()));
1340 } 1341 }
1341 #endif 1342 #endif
1342 1343
1343 } // namespace ash 1344 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698