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

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

Issue 2903673002: VR: Update UiSceneManager with screen capturing flag (Closed)
Patch Set: VR: Update UiSceneManager with screen capturing flag Created 3 years, 7 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 e88d601f3b3f548d84ec74ea7644e271e390edbb..bac07010c9fc97c79f731ade8b061c2473de4827 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -200,4 +200,43 @@ TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
}
}
+TEST_F(UiSceneManagerTest, UiUpdatesForWebVRChanges) {
+ MakeManager(kNotInCct, kInWebVr);
cjgrant 2017/05/26 01:09:26 This line is initializing a scene manager in WebVR
+
+ // Transistion to web vr mode.
+ manager_->SetWebVrMode(true);
+ manager_->SetWebVrSecureOrigin(true);
+
+ // All elements should be hidden.
+ for (const auto& element : scene_->GetUiElements()) {
+ SCOPED_TRACE(element->debug_id());
+ EXPECT_FALSE(element->visible());
+ }
+
+ // Exit webvr mode.
+ std::set<UiElementDebugId> visible_in_browsing = {
cjgrant 2017/05/26 00:58:02 If the text is going to check this set of elements
+ UiElementDebugId::kContentQuad,
+ UiElementDebugId::kBackplane,
+ UiElementDebugId::kCeiling,
+ UiElementDebugId::kFloor,
+ UiElementDebugId::kFloorGrid,
+ UiElementDebugId::kUrlBar,
+ UiElementDebugId::kLoadingIndicator,
+ UiElementDebugId::kAudioCaptureIndicator,
+ UiElementDebugId::kVideoCaptureIndicator,
+ UiElementDebugId::kScreenCaptureIndicator};
+
+ manager_->SetWebVrMode(false);
+ manager_->SetAudioCapturingIndicator(true);
cjgrant 2017/05/26 01:09:26 Miscommunication. The point of adding this test i
+ manager_->SetVideoCapturingIndicator(true);
+ manager_->SetScreenCapturingIndicator(true);
+
+ // Everything should return to original state after leaving webvr.
+ 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());
+ }
+}
} // namespace vr_shell

Powered by Google App Engine
This is Rietveld 408576698