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

Unified Diff: ash/system/screen_layout_observer_unittest.cc

Issue 2866423002: Don't show rotation change notification in tablet mode unless it's changed by user. (Closed)
Patch Set: Don't show rotation change notification in tablet mode unless it's changed by user. Created 3 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
« no previous file with comments | « ash/system/screen_layout_observer.cc ('k') | no next file » | 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 07ffba774b58dedeeeca0369962d165b5858fdc3..08e71ff5506e5682538ffc950e77b2c8ee79f11b 100644
--- a/ash/system/screen_layout_observer_unittest.cc
+++ b/ash/system/screen_layout_observer_unittest.cc
@@ -10,6 +10,7 @@
#include "ash/system/tray/system_tray.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/test_system_tray_delegate.h"
+#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -455,6 +456,41 @@ TEST_F(ScreenLayoutObserverTest, RotationNotification) {
l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)),
GetDisplayNotificationAdditionalText());
+
+ // The active source.
+ display_manager()->SetDisplayRotation(
+ primary_id, display::Display::ROTATE_270,
+ display::Display::ROTATION_SOURCE_ACTIVE);
+ EXPECT_EQ(l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(),
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270)),
+ GetDisplayNotificationAdditionalText());
+
+ // Switch to Tablet
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
+
+ // The accelerometer source.
+ display_manager()->SetDisplayRotation(
+ primary_id, display::Display::ROTATE_90,
+ display::Display::ROTATION_SOURCE_ACCELEROMETER);
+ EXPECT_TRUE(GetDisplayNotificationText().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());
+
+ // The active source.
+ display_manager()->SetDisplayRotation(
+ primary_id, display::Display::ROTATE_270,
+ display::Display::ROTATION_SOURCE_ACTIVE);
EXPECT_TRUE(GetDisplayNotificationText().empty());
}
« no previous file with comments | « ash/system/screen_layout_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698