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

Unified Diff: ash/system/screen_layout_observer_unittest.cc

Issue 2853113005: Avoid Showing rotation change notification when source is accelerometer (Closed)
Patch Set: Don't run on mushrome Created 3 years, 8 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
« no previous file with comments | « ash/system/screen_layout_observer.cc ('k') | testing/buildbot/filters/ash_mus_unittests.filter » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/screen_layout_observer_unittest.cc
diff --git a/ash/system/screen_layout_observer_unittest.cc b/ash/system/screen_layout_observer_unittest.cc
index 11dc8b08782669c44f62052fc45b2f5d955fab48..07ffba774b58dedeeeca0369962d165b5858fdc3 100644
--- a/ash/system/screen_layout_observer_unittest.cc
+++ b/ash/system/screen_layout_observer_unittest.cc
@@ -430,4 +430,32 @@ TEST_F(ScreenLayoutObserverTest, DockedModeWithExternalPrimaryDisplayMessage) {
EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty());
}
+// Tests that rotation notifications are only shown when the rotation source is
+// a user action. The accelerometer source nevber produces any notifications.
+TEST_F(ScreenLayoutObserverTest, RotationNotification) {
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
+ UpdateDisplay("400x400");
+ const int64_t primary_id =
+ display_manager()->GetPrimaryDisplayCandidate().id();
+
+ // The accelerometer source.
+ display_manager()->SetDisplayRotation(
+ primary_id, display::Display::ROTATE_90,
+ display::Display::ROTATION_SOURCE_ACCELEROMETER);
+ EXPECT_TRUE(GetDisplayNotificationText().empty());
+ EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty());
+
+ // The user source.
+ display_manager()->SetDisplayRotation(primary_id,
+ display::Display::ROTATE_180,
+ display::Display::ROTATION_SOURCE_USER);
+ EXPECT_EQ(l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(),
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)),
+ GetDisplayNotificationAdditionalText());
+ EXPECT_TRUE(GetDisplayNotificationText().empty());
+}
+
} // namespace ash
« no previous file with comments | « ash/system/screen_layout_observer.cc ('k') | testing/buildbot/filters/ash_mus_unittests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698