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

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

Issue 2955483003: Show splash screen when entering VR from a deep-link (Closed)
Patch Set: . 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
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 e13863383909160cf955a96af4d5a2ef5814ab89..8d6c1bf79c04f166d37f3ab50f5da9745db0f641 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -37,6 +37,8 @@ std::set<UiElementDebugId> kElementsVisibleInBrowsing = {
kContentQuad, kBackplane, kCeiling, kFloor, kUrlBar};
std::set<UiElementDebugId> kElementsVisibleWithExitPrompt = {
kExitPrompt, kExitPromptBackplane, kCeiling, kFloor};
+std::set<UiElementDebugId> kElementsVisibleForSplashScreen = {
cjgrant 2017/06/23 19:26:33 If used in only one test, should be in the test, I
ymalik 2017/06/25 20:27:14 Done.
+ kSplashScreenIcon};
} // namespace
@@ -69,7 +71,7 @@ class UiSceneManagerTest : public testing::Test {
void MakeAutoPresentedManager() {
scene_ = base::MakeUnique<UiScene>();
manager_ = base::MakeUnique<UiSceneManager>(
- browser_.get(), scene_.get(), kNotInCct, kInWebVr, kAutopresented);
+ browser_.get(), scene_.get(), kNotInCct, kNotInWebVr, kAutopresented);
}
bool IsVisible(UiElementDebugId debug_id) {
@@ -118,7 +120,7 @@ TEST_F(UiSceneManagerTest, WebVrWarningsShowWhenInitiallyInWebVr) {
EXPECT_TRUE(IsVisible(kWebVrPermanentHttpSecurityWarning));
EXPECT_TRUE(IsVisible(kWebVrTransientHttpSecurityWarning));
- manager_->SetWebVrMode(false, false);
+ manager_->SetWebVrMode(false);
EXPECT_FALSE(IsVisible(kWebVrPermanentHttpSecurityWarning));
EXPECT_FALSE(IsVisible(kWebVrTransientHttpSecurityWarning));
}
@@ -129,7 +131,7 @@ TEST_F(UiSceneManagerTest, WebVrWarningsDoNotShowWhenInitiallyOutsideWebVr) {
EXPECT_FALSE(IsVisible(kWebVrPermanentHttpSecurityWarning));
EXPECT_FALSE(IsVisible(kWebVrTransientHttpSecurityWarning));
- manager_->SetWebVrMode(true, false);
+ manager_->SetWebVrMode(true);
EXPECT_TRUE(IsVisible(kWebVrPermanentHttpSecurityWarning));
EXPECT_TRUE(IsVisible(kWebVrTransientHttpSecurityWarning));
}
@@ -152,7 +154,7 @@ TEST_F(UiSceneManagerTest, CloseButtonVisibleInCctFullscreen) {
// Button should not be visible when in WebVR.
MakeManager(kInCct, kInWebVr);
EXPECT_FALSE(IsVisible(kCloseButton));
- manager_->SetWebVrMode(false, false);
+ manager_->SetWebVrMode(false);
EXPECT_TRUE(IsVisible(kCloseButton));
// Button should be visible in Cct across transistions in fullscreen.
@@ -219,23 +221,16 @@ TEST_F(UiSceneManagerTest, UiUpdatesForIncognito) {
}
}
-TEST_F(UiSceneManagerTest, WebVrAutopresentedInitially) {
- MakeAutoPresentedManager();
- manager_->SetWebVrSecureOrigin(true);
- VerifyElementsVisible("Autopresented",
- std::set<UiElementDebugId>{kTransientUrlBar});
-}
-
TEST_F(UiSceneManagerTest, WebVrAutopresented) {
- MakeManager(kNotInCct, kNotInWebVr);
+ MakeAutoPresentedManager();
manager_->SetWebVrSecureOrigin(true);
- // Initial state.
- VerifyElementsVisible("Initial", kElementsVisibleInBrowsing);
+ // Initially, we should only show the splash screen.
+ VerifyElementsVisible("Initial", kElementsVisibleForSplashScreen);
// Enter WebVR with autopresentation.
- manager_->SetWebVrMode(true, true);
+ manager_->SetWebVrMode(true);
VerifyElementsVisible("Autopresented",
std::set<UiElementDebugId>{kTransientUrlBar});
}
@@ -323,7 +318,7 @@ TEST_F(UiSceneManagerTest, UiUpdateTransitionToWebVR) {
manager_->SetScreenCapturingIndicator(true);
// Transition to WebVR mode
- manager_->SetWebVrMode(true, false);
+ manager_->SetWebVrMode(true);
manager_->SetWebVrSecureOrigin(true);
// All elements should be hidden.
@@ -344,12 +339,12 @@ TEST_F(UiSceneManagerTest, CaptureIndicatorsVisibility) {
EXPECT_TRUE(IsVisible(kVideoCaptureIndicator));
EXPECT_TRUE(IsVisible(kScreenCaptureIndicator));
- manager_->SetWebVrMode(true, false);
+ manager_->SetWebVrMode(true);
EXPECT_FALSE(IsVisible(kAudioCaptureIndicator));
EXPECT_FALSE(IsVisible(kVideoCaptureIndicator));
EXPECT_FALSE(IsVisible(kScreenCaptureIndicator));
- manager_->SetWebVrMode(false, false);
+ manager_->SetWebVrMode(false);
EXPECT_TRUE(IsVisible(kAudioCaptureIndicator));
EXPECT_TRUE(IsVisible(kVideoCaptureIndicator));
EXPECT_TRUE(IsVisible(kScreenCaptureIndicator));

Powered by Google App Engine
This is Rietveld 408576698