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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/display/display_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index e9dd69f67e61ea3ddb1454bbacb6dc184f8101a9..adfb6e23429c09b03a08994409a365365d95504f 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -69,6 +69,7 @@ class TestObserver : public DisplayController::Observer,
bounds_changed_count_(0),
rotation_changed_count_(0),
workarea_changed_count_(0),
+ primary_changed_count_(0),
changed_display_id_(0),
focus_changed_count_(0),
activation_changed_count_(0) {
@@ -139,6 +140,10 @@ class TestObserver : public DisplayController::Observer,
return Resetter<int>(&workarea_changed_count_).value();
}
+ int64 GetPrimaryChangedCountAndReset() {
+ return Resetter<int>(&primary_changed_count_).value();
+ }
+
int64 GetChangedDisplayIdAndReset() {
return Resetter<int64>(&changed_display_id_).value();
}
@@ -158,6 +163,7 @@ class TestObserver : public DisplayController::Observer,
int bounds_changed_count_;
int rotation_changed_count_;
int workarea_changed_count_;
+ int private_changed_count_;
int64 changed_display_id_;
int focus_changed_count_;
@@ -581,9 +587,11 @@ TEST_F(DisplayControllerTest, MirrorToDockedWithFullscreen) {
display_manager->OnNativeDisplaysChanged(display_info_list);
EXPECT_EQ(1U, display_manager->GetNumDisplays());
EXPECT_EQ(1U, display_manager->num_connected_displays());
- EXPECT_EQ(0, observer.GetChangedDisplayIdAndReset());
- EXPECT_EQ(0, observer.GetBoundsChangedCountAndReset());
- EXPECT_EQ(0, observer.GetWorkareaChangedCountAndReset());
+ // Observers are called due to primary change.
+ EXPECT_EQ(2, observer.GetChangedDisplayIdAndReset());
+ EXPECT_EQ(1, observer.GetBoundsChangedCountAndReset());
+ EXPECT_EQ(1, observer.GetWorkareaChangedCountAndReset());
+ EXPECT_EQ(1, observer.GetPrimaryChangedCountAndReset());
EXPECT_EQ(1, observer.CountAndReset());
EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
EXPECT_EQ(0, observer.GetActivationChangedCountAndReset());
« 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