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

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

Issue 2873043002: VrShell: Add test for fullscreen transitions. (Closed)
Patch Set: oops, forgot to 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
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698