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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc

Issue 2902043005: [vr] Add incognito coloring (Closed)
Patch Set: . 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 MakeManager(kNotInCct, kNotInWebVr); 133 MakeManager(kNotInCct, kNotInWebVr);
134 EXPECT_FALSE(IsVisible(kCloseButton)); 134 EXPECT_FALSE(IsVisible(kCloseButton));
135 135
136 MakeManager(kInCct, kInWebVr); 136 MakeManager(kInCct, kInWebVr);
137 EXPECT_FALSE(IsVisible(kCloseButton)); 137 EXPECT_FALSE(IsVisible(kCloseButton));
138 manager_->SetWebVrMode(false); 138 manager_->SetWebVrMode(false);
139 EXPECT_TRUE(IsVisible(kCloseButton)); 139 EXPECT_TRUE(IsVisible(kCloseButton));
140 } 140 }
141 141
142 TEST_F(UiSceneManagerTest, UiUpdatesForIncognito) {
143 MakeManager(kNotInCct, kNotInWebVr);
144
145 // Hold onto the background color to make sure it changes.
146 SkColor initial_background = scene_->GetBackgroundColor();
147 manager_->SetFullscreen(true);
amp 2017/05/27 00:47:47 Why do we need to check fullscreen? Shouldn't we
Ian Vollick 2017/05/27 01:29:12 I was hoping to show that incognito "wins". That i
148
149 {
150 SCOPED_TRACE("Entered Fullsceen");
151 // Make sure background has changed for fullscreen.
152 EXPECT_NE(initial_background, scene_->GetBackgroundColor());
153 }
154
155 SkColor fullscreen_background = scene_->GetBackgroundColor();
156
157 manager_->SetIncognito(true);
158
159 {
160 SCOPED_TRACE("Entered Incognito");
161 // Make sure background has changed for incognito.
162 EXPECT_NE(fullscreen_background, scene_->GetBackgroundColor());
163 EXPECT_NE(initial_background, scene_->GetBackgroundColor());
164 }
165
166 SkColor incognito_background = scene_->GetBackgroundColor();
167
168 manager_->SetIncognito(false);
169
170 {
171 SCOPED_TRACE("Exited Incognito");
172 EXPECT_EQ(fullscreen_background, scene_->GetBackgroundColor());
173 }
174
175 manager_->SetFullscreen(false);
176
177 {
178 SCOPED_TRACE("Exited Fullsceen");
179 EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
180 }
181
182 manager_->SetIncognito(true);
183
184 {
185 SCOPED_TRACE("Entered Incognito");
186 EXPECT_EQ(incognito_background, scene_->GetBackgroundColor());
187 }
188
189 manager_->SetIncognito(false);
190
191 {
192 SCOPED_TRACE("Exited Incognito");
193 EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
194 }
195 }
196
142 TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) { 197 TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
143 std::set<UiElementDebugId> visible_in_browsing = { 198 std::set<UiElementDebugId> visible_in_browsing = {
144 UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane, 199 UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane,
145 UiElementDebugId::kCeiling, UiElementDebugId::kFloor, 200 UiElementDebugId::kCeiling, UiElementDebugId::kFloor,
146 UiElementDebugId::kFloorGrid, UiElementDebugId::kUrlBar, 201 UiElementDebugId::kFloorGrid, UiElementDebugId::kUrlBar,
147 UiElementDebugId::kLoadingIndicator}; 202 UiElementDebugId::kLoadingIndicator};
148 std::set<UiElementDebugId> visible_in_fullscreen = { 203 std::set<UiElementDebugId> visible_in_fullscreen = {
149 UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane, 204 UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane,
150 UiElementDebugId::kCeiling, UiElementDebugId::kFloor, 205 UiElementDebugId::kCeiling, UiElementDebugId::kFloor,
151 UiElementDebugId::kFloorGrid}; 206 UiElementDebugId::kFloorGrid};
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 308
254 manager_->SetAudioCapturingIndicator(false); 309 manager_->SetAudioCapturingIndicator(false);
255 manager_->SetVideoCapturingIndicator(false); 310 manager_->SetVideoCapturingIndicator(false);
256 manager_->SetScreenCapturingIndicator(false); 311 manager_->SetScreenCapturingIndicator(false);
257 312
258 EXPECT_FALSE(IsVisible(kAudioCaptureIndicator)); 313 EXPECT_FALSE(IsVisible(kAudioCaptureIndicator));
259 EXPECT_FALSE(IsVisible(kVideoCaptureIndicator)); 314 EXPECT_FALSE(IsVisible(kVideoCaptureIndicator));
260 EXPECT_FALSE(IsVisible(kScreenCaptureIndicator)); 315 EXPECT_FALSE(IsVisible(kScreenCaptureIndicator));
261 } 316 }
262 } // namespace vr_shell 317 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698