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

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

Issue 2914623003: [VrShell] Centralize color handling and enable close button on fullscreen (Closed)
Patch Set: clean up after rebase 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 0e1345feed931f2bd1e06f09a7a0feed91bf8d96..c8eeab7217e4430691fb12ae93e4827f0437f82d 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
@@ -127,71 +127,88 @@ TEST_F(UiSceneManagerTest, WebVrWarningsDoNotShowWhenInitiallyOutsideWebVr) {
EXPECT_TRUE(IsVisible(kWebVrTransientHttpSecurityWarning));
}
-TEST_F(UiSceneManagerTest, CctButtonVisibleInCct) {
+TEST_F(UiSceneManagerTest, CloseButtonVisibleInCctFullscreen) {
+ // Button should be visible in cct.
MakeManager(kInCct, kNotInWebVr);
EXPECT_TRUE(IsVisible(kCloseButton));
+ // Button should not be visible when not in cct or fullscreen.
MakeManager(kNotInCct, kNotInWebVr);
EXPECT_FALSE(IsVisible(kCloseButton));
+ // Button should be visible in fullscreen and hidden when leaving fullscreen.
+ manager_->SetFullscreen(true);
+ EXPECT_TRUE(IsVisible(kCloseButton));
+ manager_->SetFullscreen(false);
+ EXPECT_FALSE(IsVisible(kCloseButton));
+
+ // Button should not be visible when in WebVR.
MakeManager(kInCct, kInWebVr);
EXPECT_FALSE(IsVisible(kCloseButton));
manager_->SetWebVrMode(false);
EXPECT_TRUE(IsVisible(kCloseButton));
+
+ // Button should be visible in Cct across transistions in fullscreen.
+ MakeManager(kInCct, kNotInWebVr);
+ EXPECT_TRUE(IsVisible(kCloseButton));
+ manager_->SetFullscreen(true);
+ EXPECT_TRUE(IsVisible(kCloseButton));
+ manager_->SetFullscreen(false);
+ 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();
+ SkColor initial_background = scene_->GetWorldBackgroundColor();
manager_->SetFullscreen(true);
{
SCOPED_TRACE("Entered Fullsceen");
// Make sure background has changed for fullscreen.
- EXPECT_NE(initial_background, scene_->GetBackgroundColor());
+ EXPECT_NE(initial_background, scene_->GetWorldBackgroundColor());
}
- SkColor fullscreen_background = scene_->GetBackgroundColor();
+ SkColor fullscreen_background = scene_->GetWorldBackgroundColor();
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());
+ EXPECT_NE(fullscreen_background, scene_->GetWorldBackgroundColor());
+ EXPECT_NE(initial_background, scene_->GetWorldBackgroundColor());
}
- SkColor incognito_background = scene_->GetBackgroundColor();
+ SkColor incognito_background = scene_->GetWorldBackgroundColor();
manager_->SetIncognito(false);
{
SCOPED_TRACE("Exited Incognito");
- EXPECT_EQ(fullscreen_background, scene_->GetBackgroundColor());
+ EXPECT_EQ(fullscreen_background, scene_->GetWorldBackgroundColor());
}
manager_->SetFullscreen(false);
{
SCOPED_TRACE("Exited Fullsceen");
- EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
+ EXPECT_EQ(initial_background, scene_->GetWorldBackgroundColor());
}
manager_->SetIncognito(true);
{
SCOPED_TRACE("Entered Incognito");
- EXPECT_EQ(incognito_background, scene_->GetBackgroundColor());
+ EXPECT_EQ(incognito_background, scene_->GetWorldBackgroundColor());
}
manager_->SetIncognito(false);
{
SCOPED_TRACE("Exited Incognito");
- EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
+ EXPECT_EQ(initial_background, scene_->GetWorldBackgroundColor());
}
}
@@ -201,13 +218,14 @@ TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
UiElementDebugId::kCeiling, UiElementDebugId::kFloor,
UiElementDebugId::kUrlBar, UiElementDebugId::kLoadingIndicator};
std::set<UiElementDebugId> visible_in_fullscreen = {
- UiElementDebugId::kContentQuad, UiElementDebugId::kBackplane,
- UiElementDebugId::kCeiling, UiElementDebugId::kFloor};
+ UiElementDebugId::kContentQuad, UiElementDebugId::kCloseButton,
+ UiElementDebugId::kBackplane, UiElementDebugId::kCeiling,
+ UiElementDebugId::kFloor};
MakeManager(kNotInCct, kNotInWebVr);
// Hold onto the background color to make sure it changes.
- SkColor initial_background = scene_->GetBackgroundColor();
+ SkColor initial_background = scene_->GetWorldBackgroundColor();
for (const auto& element : scene_->GetUiElements()) {
SCOPED_TRACE(element->debug_id());
@@ -230,7 +248,7 @@ TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
{
SCOPED_TRACE("Entered Fullsceen");
// Make sure background has changed for fullscreen.
- EXPECT_NE(initial_background, scene_->GetBackgroundColor());
+ EXPECT_NE(initial_background, scene_->GetWorldBackgroundColor());
}
// Exit fullscreen.
@@ -245,7 +263,7 @@ TEST_F(UiSceneManagerTest, UiUpdatesForFullscreenChanges) {
}
{
SCOPED_TRACE("Exited Fullsceen");
- EXPECT_EQ(initial_background, scene_->GetBackgroundColor());
+ EXPECT_EQ(initial_background, scene_->GetWorldBackgroundColor());
}
}

Powered by Google App Engine
This is Rietveld 408576698