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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" 5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/test/scoped_task_environment.h" 8 #include "base/test/scoped_task_environment.h"
9 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" 9 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h"
10 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" 10 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 bool should_be_visible = visible_in_browsing.find(element->debug_id()) != 193 bool should_be_visible = visible_in_browsing.find(element->debug_id()) !=
194 visible_in_browsing.end(); 194 visible_in_browsing.end();
195 EXPECT_EQ(should_be_visible, element->visible()); 195 EXPECT_EQ(should_be_visible, element->visible());
196 } 196 }
197 { 197 {
198 SCOPED_TRACE("Exited Fullsceen"); 198 SCOPED_TRACE("Exited Fullsceen");
199 EXPECT_TRUE(ColorEquals(initial_background, scene_->GetBackgroundColor())); 199 EXPECT_TRUE(ColorEquals(initial_background, scene_->GetBackgroundColor()));
200 } 200 }
201 } 201 }
202 202
203 TEST_F(UiSceneManagerTest, UiUpdatesForWebVRChanges) {
cjgrant 2017/05/26 14:08:15 I put a proposed test structure here. Let me know
asimjour1 2017/05/26 17:01:00 Done.
204 MakeManager(kNotInCct, kInWebVr);
205
206 // Transistion to web vr mode.
207 manager_->SetWebVrMode(true);
208 manager_->SetWebVrSecureOrigin(true);
209
210 // All elements should be hidden.
211 for (const auto& element : scene_->GetUiElements()) {
212 SCOPED_TRACE(element->debug_id());
213 EXPECT_FALSE(element->visible());
214 }
215
216 // Exit webvr mode.
217 std::set<UiElementDebugId> visible_in_browsing = {
218 UiElementDebugId::kContentQuad,
219 UiElementDebugId::kBackplane,
220 UiElementDebugId::kCeiling,
221 UiElementDebugId::kFloor,
222 UiElementDebugId::kFloorGrid,
223 UiElementDebugId::kUrlBar,
224 UiElementDebugId::kLoadingIndicator,
225 UiElementDebugId::kAudioCaptureIndicator,
226 UiElementDebugId::kVideoCaptureIndicator,
227 UiElementDebugId::kScreenCaptureIndicator};
228
229 manager_->SetWebVrMode(false);
230 manager_->SetAudioCapturingIndicator(true);
231 manager_->SetVideoCapturingIndicator(true);
232 manager_->SetScreenCapturingIndicator(true);
233
234 // Everything should return to original state after leaving webvr.
235 for (const auto& element : scene_->GetUiElements()) {
236 SCOPED_TRACE(element->debug_id());
237 bool should_be_visible = visible_in_browsing.find(element->debug_id()) !=
238 visible_in_browsing.end();
239 EXPECT_EQ(should_be_visible, element->visible());
240 }
241 }
203 } // namespace vr_shell 242 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698