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

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

Issue 2442873002: Control the VrShell content quad via the HTML UI. (Closed)
Patch Set: Rebase; address nits and bug. Created 4 years, 2 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.cc ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/ui_scene_unittest.cc
diff --git a/chrome/browser/android/vr_shell/ui_scene_unittest.cc b/chrome/browser/android/vr_shell/ui_scene_unittest.cc
index 35e92bb7e827d5d2c165276d642cb193575f3ec8..91a8196a1b509ff68e36ee410c9fdd70e5b49b2f 100644
--- a/chrome/browser/android/vr_shell/ui_scene_unittest.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_unittest.cc
@@ -68,6 +68,29 @@ TEST(UiScene, AddRemoveElements) {
EXPECT_EQ(scene.GetUiElements().size(), 0u);
}
+TEST(UiScene, AddRemoveContentQuad) {
+ UiScene scene;
+
+ EXPECT_EQ(scene.GetContentQuad(), nullptr);
+
+ base::DictionaryValue dict;
+ dict.SetInteger("id", 0);
+ dict.SetBoolean("contentQuad", true);
+ scene.AddUiElementFromDict(dict);
+ EXPECT_NE(scene.GetContentQuad(), nullptr);
+
+ dict.SetBoolean("contentQuad", false);
+ scene.UpdateUiElementFromDict(dict);
+ EXPECT_EQ(scene.GetContentQuad(), nullptr);
+
+ dict.SetBoolean("contentQuad", true);
+ scene.UpdateUiElementFromDict(dict);
+ EXPECT_NE(scene.GetContentQuad(), nullptr);
+
+ scene.RemoveUiElement(0);
+ EXPECT_EQ(scene.GetContentQuad(), nullptr);
+}
+
TEST(UiScene, AddRemoveAnimations) {
UiScene scene;
addElement(&scene, 0);
@@ -193,6 +216,7 @@ TEST(UiScene, AddUiElementFromDictionary) {
dict.SetBoolean("visible", false);
dict.SetBoolean("hitTestable", false);
dict.SetBoolean("lockToFov", true);
+ dict.SetBoolean("contentQuad", true);
std::unique_ptr<base::DictionaryValue> copy_rect(new base::DictionaryValue);
copy_rect->SetInteger("x", 100);
@@ -237,6 +261,7 @@ TEST(UiScene, AddUiElementFromDictionary) {
EXPECT_EQ(element->visible, false);
EXPECT_EQ(element->hit_testable, false);
EXPECT_EQ(element->lock_to_fov, true);
+ EXPECT_EQ(element->content_quad, true);
EXPECT_EQ(element->copy_rect.x, 100);
EXPECT_EQ(element->copy_rect.y, 101);
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene.cc ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698