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

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

Issue 2913633002: [vr] Clicking on the security icon should prompt the user to bail out of VR (Closed)
Patch Set: address amp's comments 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 0e1345feed931f2bd1e06f09a7a0feed91bf8d96..551b1c0487f9230e6baddceb00c5c772dff11612 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -249,6 +249,45 @@ TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
}
}
+TEST_F(UiSceneManagerTest, UiUpdatesExitPrompt) {
+ std::set<UiElementDebugId> visible_in_browsing = {
cjgrant 2017/06/05 17:33:53 visible_in_browsing should be in the empty namespa
ymalik 2017/06/05 20:02:42 Done.
+ UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane,
cjgrant 2017/06/05 17:33:53 Even though it's not done above, can we use a 'usi
ymalik 2017/06/05 20:02:42 Done.
+ UiElementDebugId::kCeiling, UiElementDebugId::kFloor,
+ UiElementDebugId::kUrlBar, UiElementDebugId::kLoadingIndicator};
+ std::set<UiElementDebugId> visible_when_prompting = {
+ UiElementDebugId::kExitPrompt, UiElementDebugId::kBackplane,
+ UiElementDebugId::kCeiling, UiElementDebugId::kFloor};
+ MakeManager(kNotInCct, kNotInWebVr);
+
+ manager_->SetWebVrSecureOrigin(true);
+
+ // Initial state.
+ for (const auto& element : scene_->GetUiElements()) {
+ SCOPED_TRACE(element->debug_id());
+ bool should_be_visible = visible_in_browsing.find(element->debug_id()) !=
+ visible_in_browsing.end();
+ EXPECT_EQ(should_be_visible, element->visible());
+ }
+
+ // Exit prompt visible state.
+ manager_->OnSecurityIconClicked();
+ for (const auto& element : scene_->GetUiElements()) {
+ SCOPED_TRACE(element->debug_id());
+ bool should_be_visible = visible_when_prompting.find(element->debug_id()) !=
+ visible_when_prompting.end();
+ EXPECT_EQ(should_be_visible, element->visible());
+ }
+
+ // Back to initial state.
+ manager_->OnExitPromptPrimaryButtonClicked();
+ for (const auto& element : scene_->GetUiElements()) {
+ SCOPED_TRACE(element->debug_id());
+ bool should_be_visible = visible_in_browsing.find(element->debug_id()) !=
+ visible_in_browsing.end();
+ EXPECT_EQ(should_be_visible, element->visible());
+ }
+}
+
TEST_F(UiSceneManagerTest, UiUpdatesForWebVR) {
MakeManager(kNotInCct, kInWebVr);

Powered by Google App Engine
This is Rietveld 408576698