Chromium Code Reviews| 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, |