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

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

Issue 2921383002: [vr] Close exit prompt when clicking on background (Closed)
Patch Set: fix diff 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 81c6c736ecf674c70074ad54919d761fb42af3ee..818ef491c7e43f22bf0f41317f52de2b3d916a9d 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -291,6 +291,42 @@ TEST_F(UiSceneManagerTest, UiUpdatesExitPrompt) {
}
}
+TEST_F(UiSceneManagerTest, BackplaneClickClosesExitPrompt) {
+ std::set<UiElementDebugId> visible_when_prompting = {kExitPrompt, kBackplane,
+ kCeiling, kFloor};
+ MakeManager(kNotInCct, kNotInWebVr);
+
+ manager_->SetWebVrSecureOrigin(true);
+
+ // Initial state.
+ for (const auto& element : scene_->GetUiElements()) {
+ SCOPED_TRACE(element->debug_id());
+ bool should_be_visible =
+ kElementsVisibleInBrowsing.find(element->debug_id()) !=
+ kElementsVisibleInBrowsing.end();
+ EXPECT_EQ(should_be_visible, element->visible());
+ }
+
+ // Exit prompt visible state.
+ manager_->OnSecurityIconClicked();
+ for (const auto& element : scene_->GetUiElements()) {
cjgrant 2017/06/06 19:42:13 Based on how many of these loops we have throughou
ymalik 2017/06/06 21:11:58 Done. Much cleaner.
+ 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_->OnBackplaneClicked();
+ for (const auto& element : scene_->GetUiElements()) {
cjgrant 2017/06/06 19:42:13 Originally I thought it's weird so many tests chec
ymalik 2017/06/06 21:11:58 Agreed, we want to check the visibility of these e
+ SCOPED_TRACE(element->debug_id());
+ bool should_be_visible =
+ kElementsVisibleInBrowsing.find(element->debug_id()) !=
+ kElementsVisibleInBrowsing.end();
+ EXPECT_EQ(should_be_visible, element->visible());
+ }
+}
+
TEST_F(UiSceneManagerTest, UiUpdatesForWebVR) {
MakeManager(kNotInCct, kInWebVr);

Powered by Google App Engine
This is Rietveld 408576698