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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 259253002: Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: with Linux Aura tests Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 3c811d7cf9d116830449d30388135e39a7d47c71..729d1377f92e3207784ab9eaab848d927ebf7e2a 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -98,7 +98,8 @@ class DisplayManagerTest : public test::AshTestBase,
}
// aura::DisplayObserver overrides:
- virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE {
+ virtual void OnDisplayMetricsChanged(const gfx::Display& display,
+ DisplayObserver::MetricsType) OVERRIDE {
changed_.push_back(display);
}
virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE {
@@ -846,19 +847,25 @@ TEST_F(DisplayManagerTest, Rotate) {
EXPECT_EQ("2 0 0", GetCountSummary());
reset();
- // Updating tothe same configuration should report no changes.
+ // Updating to the same configuration should report no changes.
UpdateDisplay("100x200/l,300x400");
EXPECT_EQ("0 0 0", GetCountSummary());
reset();
- UpdateDisplay("100x200/l,300x400");
- EXPECT_EQ("0 0 0", GetCountSummary());
+ // Rotating 180 degrees should report one change.
+ UpdateDisplay("100x200/r,300x400");
+ EXPECT_EQ("1 0 0", GetCountSummary());
reset();
UpdateDisplay("200x200");
EXPECT_EQ("1 0 1", GetCountSummary());
reset();
+ // Rotating 180 degrees should report one change.
+ UpdateDisplay("200x200/u");
+ EXPECT_EQ("1 0 0", GetCountSummary());
+ reset();
+
UpdateDisplay("200x200/l");
EXPECT_EQ("1 0 0", GetCountSummary());
}
@@ -1047,7 +1054,8 @@ class TestDisplayObserver : public gfx::DisplayObserver {
virtual ~TestDisplayObserver() {}
// gfx::DisplayObserver overrides:
- virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE {
+ virtual void OnDisplayMetricsChanged(
+ const gfx::Display&, DisplayObserver::MetricsType) OVERRIDE {
}
virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE {
// Mirror window should already be delete before restoring

Powered by Google App Engine
This is Rietveld 408576698