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

Unified Diff: chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc

Issue 2955023002: VR: Factor transient timing out of UiSceneManager. (Closed)
Patch Set: Rebase again onto ExclusivePresentationToast class/file rename. Created 3 years, 6 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/android/vr_shell/ui_scene_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
diff --git a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
index c8a408179f9b83f9fe2c18e5961caac951facaaf..197bfea259b50ebdb6dd5780d1baa2040c0d0f1a 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -163,7 +163,7 @@ TEST_F(UiSceneManagerTest, WebVrTransientWarningTimesOut) {
EXPECT_FALSE(IsVisible(kWebVrTransientHttpSecurityWarning));
}
-TEST_F(UiSceneManagerTest, ToastVisibility) {
+TEST_F(UiSceneManagerTest, ToastStateTransitions) {
// Tests toast not showing when directly entering VR though WebVR
// presentation.
MakeManager(kNotInCct, kInWebVr);
@@ -188,7 +188,27 @@ TEST_F(UiSceneManagerTest, ToastVisibility) {
EXPECT_FALSE(IsVisible(kExclusiveScreenToast));
manager_->SetWebVrMode(false, true);
+ EXPECT_FALSE(IsVisible(kExclusiveScreenToast));
+}
+
+TEST_F(UiSceneManagerTest, ToastTransience) {
+ base::ScopedMockTimeMessageLoopTaskRunner task_runner_;
+
+ MakeManager(kNotInCct, kNotInWebVr);
+ EXPECT_FALSE(IsVisible(kExclusiveScreenToast));
+
+ manager_->SetFullscreen(true);
+ EXPECT_TRUE(IsVisible(kExclusiveScreenToast));
+ task_runner_->FastForwardUntilNoTasksRemain();
+ EXPECT_FALSE(IsVisible(kExclusiveScreenToast));
+
+ manager_->SetWebVrMode(true, true);
EXPECT_TRUE(IsVisible(kExclusiveScreenToast));
+ task_runner_->FastForwardUntilNoTasksRemain();
+ EXPECT_FALSE(IsVisible(kExclusiveScreenToast));
+
+ manager_->SetWebVrMode(false, false);
+ EXPECT_FALSE(IsVisible(kExclusiveScreenToast));
}
TEST_F(UiSceneManagerTest, CloseButtonVisibleInCctFullscreen) {
@@ -277,8 +297,9 @@ TEST_F(UiSceneManagerTest, UiUpdatesForIncognito) {
}
TEST_F(UiSceneManagerTest, WebVrAutopresented) {
- MakeAutoPresentedManager();
+ base::ScopedMockTimeMessageLoopTaskRunner task_runner_;
+ MakeAutoPresentedManager();
manager_->SetWebVrSecureOrigin(true);
// Initially, we should only show the splash screen.
@@ -287,9 +308,12 @@ TEST_F(UiSceneManagerTest, WebVrAutopresented) {
// Enter WebVR with autopresentation.
manager_->SetWebVrMode(true, false);
-
VerifyElementsVisible("Autopresented",
std::set<UiElementDebugId>{kTransientUrlBar});
+
+ // Make sure the transient URL bar times out.
+ task_runner_->FastForwardUntilNoTasksRemain();
+ EXPECT_FALSE(IsVisible(kTransientUrlBar));
}
TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698