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

Unified 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 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 bf7078e0b6c3f280b8c6457331574ec8a7a90d7b..e40184501acaafb97b592f390b7f25510a26162f 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -139,6 +139,61 @@ TEST_F(UiSceneManagerTest, CctButtonVisibleInCct) {
EXPECT_TRUE(IsVisible(kCloseButton));
}
+TEST_F(UiSceneManagerTest, UiUpdatesForIncognito) {
+ MakeManager(kNotInCct, kNotInWebVr);
+
+ // Hold onto the background color to make sure it changes.
+ SkColor initial_background = scene_->GetBackgroundColor();
+ 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
+
+ {
+ SCOPED_TRACE("Entered Fullsceen");
+ // Make sure background has changed for fullscreen.
+ EXPECT_NE(initial_background, scene_->GetBackgroundColor());
+ }
+
+ SkColor fullscreen_background = scene_->GetBackgroundColor();
+
+ manager_->SetIncognito(true);
+
+ {
+ SCOPED_TRACE("Entered Incognito");
+ // Make sure background has changed for incognito.
+ EXPECT_NE(fullscreen_background, scene_->GetBackgroundColor());
+ EXPECT_NE(initial_background, scene_->GetBackgroundColor());
+ }
+
+ SkColor incognito_background = scene_->GetBackgroundColor();
+
+ manager_->SetIncognito(false);
+
+ {
+ SCOPED_TRACE("Exited Incognito");
+ EXPECT_EQ(fullscreen_background, scene_->GetBackgroundColor());
+ }
+
+ manager_->SetFullscreen(false);
+
+ {
+ SCOPED_TRACE("Exited Fullsceen");
+ EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
+ }
+
+ manager_->SetIncognito(true);
+
+ {
+ SCOPED_TRACE("Entered Incognito");
+ EXPECT_EQ(incognito_background, scene_->GetBackgroundColor());
+ }
+
+ manager_->SetIncognito(false);
+
+ {
+ SCOPED_TRACE("Exited Incognito");
+ EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
+ }
+}
+
TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
std::set<UiElementDebugId> visible_in_browsing = {
UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane,

Powered by Google App Engine
This is Rietveld 408576698