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 b7b840f62fc7a3ec23cca1bd5751d0b6b8e3a7ec..8a4af5e95871d0bdae5a05282d1953e18a4140d4 100644 |
--- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc |
+++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/android/vr_shell/ui_scene_manager.h" |
#include "base/macros.h" |
+#include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
#include "chrome/browser/android/vr_shell/ui_scene.h" |
#include "chrome/browser/android/vr_shell/vr_browser_interface.h" |
#include "testing/gmock/include/gmock/gmock.h" |
@@ -78,4 +79,40 @@ TEST_F(UiSceneManagerTest, ContentPausesOnAppButtonClick) { |
EXPECT_TRUE(scene_->GetWebVrRenderingEnabled()); |
} |
+TEST_F(UiSceneManagerTest, UiUpdatesForFullscreen) { |
+ InSequence s; |
+ // Set mode to not WebVR, everything should be visible. |
+ manager_->SetWebVRMode(false); |
+ |
+ // Hold onto the background color to make sure it changes. |
+ vr::Colorf initialBackground = scene_->GetBackgroundColor(); |
+ |
+ for (UiElement* element : manager_->browser_ui_elements_) { |
+ EXPECT_TRUE(element->visible()); |
+ } |
+ |
+ manager_->SetFullscreen(true); |
+ |
+ // All elements should be hidden except for main content. |
+ for (UiElement* element : manager_->browser_ui_elements_) { |
+ if (element == manager_->main_content_) { |
+ EXPECT_TRUE(element->visible()); |
+ continue; |
+ } |
+ EXPECT_FALSE(element->visible()); |
+ } |
+ // Make sure background has changed for fullscreen. |
+ // TODO(amp): Check more than just the red value. |
bsheedy
2017/05/09 21:27:09
This seems like a simple thing to add in this CL -
amp
2017/05/09 21:36:24
The reason for the TODO is that I really just want
amp
2017/05/09 22:47:37
Decided to go ahead and just add it. One thing is
cjgrant
2017/05/10 14:08:36
I feel your pain on this one. :) Wrapper functions
amp
2017/05/10 16:05:55
I'll leave it as is for now since we only care tha
|
+ EXPECT_NE(initialBackground.r, scene_->GetBackgroundColor().r); |
+ |
+ manager_->SetFullscreen(false); |
+ |
+ // Everything should return to original state after leaving fullscreen. |
+ for (UiElement* element : manager_->browser_ui_elements_) { |
+ EXPECT_TRUE(element->visible()); |
+ } |
+ // TODO(amp): Check more than just the red value. |
bsheedy
2017/05/09 21:27:09
Ditto.
|
+ EXPECT_EQ(initialBackground.r, scene_->GetBackgroundColor().r); |
+} |
+ |
} // namespace vr_shell |