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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Issue 2384773002: Remember the orientation request without a window. (Closed)
Patch Set: addressed comments Created 4 years, 2 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 | « chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
index 9810416578a8b5f084cf211ac398bdfa1252ff19..72951ed95ee388b3bbb62692ef1d2a52229723ff 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
@@ -3719,6 +3719,57 @@ class ChromeLauncherControllerArcDefaultAppsTest
} // namespace
+TEST_F(ChromeLauncherControllerOrientationTest,
+ ArcOrientationLockBeforeWindowReady) {
+ ASSERT_TRUE(display::Display::HasInternalDisplay());
+
+ extension_service_->AddExtension(arc_support_host_.get());
+ EnableArc(true);
+
+ InitLauncherController();
+ arc::ArcAuthService::SetShelfDelegateForTesting(launcher_controller_.get());
+
+ ash::ScreenOrientationController* controller =
+ ash::Shell::GetInstance()->screen_orientation_controller();
+
+ std::string app_id1("org.chromium.arc.1");
+ int task_id1 = 1;
+ arc::mojom::AppInfo appinfo1 =
+ CreateAppInfo("Test1", "test", "com.example.app", OrientationLock::NONE);
+
+ AddArcAppAndShortcut(appinfo1);
+ NotifyOnTaskCreated(appinfo1, task_id1);
+ NotifyOnTaskOrientationLockRequested(task_id1, OrientationLock::PORTRAIT);
+
+ // Widgets will be deleted by the system.
+ CreateArcWindow(app_id1);
+
+ EXPECT_FALSE(controller->rotation_locked());
+
+ EnableTabletMode(true);
+ EXPECT_TRUE(controller->rotation_locked());
+ EXPECT_EQ(display::Display::ROTATE_90,
+ display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
+
+ std::string app_id2("org.chromium.arc.2");
+ int task_id2 = 2;
+ arc::mojom::AppInfo appinfo2 =
+ CreateAppInfo("Test2", "test", "com.example.app", OrientationLock::NONE);
+ // Create in tablet mode.
+ AddArcAppAndShortcut(appinfo2);
+ NotifyOnTaskCreated(appinfo2, task_id2);
+ NotifyOnTaskOrientationLockRequested(task_id2, OrientationLock::LANDSCAPE);
+ EXPECT_TRUE(controller->rotation_locked());
+ EXPECT_EQ(display::Display::ROTATE_90,
+ display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
+
+ // The screen will be locked when the window is created.
+ CreateArcWindow(app_id2);
+ EXPECT_TRUE(controller->rotation_locked());
+ EXPECT_EQ(display::Display::ROTATE_0,
+ display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
+}
+
TEST_F(ChromeLauncherControllerOrientationTest, ArcOrientationLock) {
ASSERT_TRUE(display::Display::HasInternalDisplay());
« no previous file with comments | « chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698