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

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

Issue 738243002: Notify primary display reassignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/display/display_manager.cc » ('j') | ash/display/display_manager_unittest.cc » ('J')
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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_manager.cc » ('j') | ash/display/display_manager_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698