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

Unified Diff: chrome/test/data/android/webvr_instrumentation/html/test_pose_data_unfocused_tab.html

Issue 2588703003: Add WebVR WebVR E2E test capabilities via Android instrumentation (Closed)
Patch Set: Fix copyright header Created 3 years, 10 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/test/data/android/webvr_instrumentation/html/test_pose_data_unfocused_tab.html
diff --git a/chrome/test/data/android/webvr_instrumentation/html/test_pose_data_unfocused_tab.html b/chrome/test/data/android/webvr_instrumentation/html/test_pose_data_unfocused_tab.html
new file mode 100644
index 0000000000000000000000000000000000000000..908eb08af0c2d66390ae092ec663f9062dc0643d
--- /dev/null
+++ b/chrome/test/data/android/webvr_instrumentation/html/test_pose_data_unfocused_tab.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<!--
+Tests that WebVR doesn't update frame data when the tab is not focused
+-->
+<html>
+ <head>
+ <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css">
+ </head>
+ <body>
+ <canvas id="webgl-canvas"></canvas>
+ <script src="../../../../../../third_party/WebKit/LayoutTests/resources/testharness.js"></script>
+ <script src="../resources/webvr_e2e.js"></script>
+ <script src="../resources/webvr_boilerplate.js"></script>
+ <script>
+ var t = async_test("Test pose data in unfocused tab");
+ var fd = null;
+
+ function stepCheckFrameDataWhileFocusedTab() {
+ function onAnimationFrame() {
+ fd = new VRFrameData();
+ t.step( () => {
+ assert_true(vrDisplay.getFrameData(fd),
+ "getFrameData says it updated the object");
+ assert_true(fd != null,
+ "frame data is no longer null");
+ assert_true(fd.pose != null,
+ "frame data's pose is non-null");
+ });
+ finishJavascriptStep();
+ }
+ // Make sure at least one rAF call has happened so we get valid data
+ window.requestAnimationFrame(onAnimationFrame);
+ }
+
+ function stepCheckFrameDataWhileNonFocusedTab() {
+ t.step_func_done( () => {
+ assert_false(vrDisplay.getFrameData(fd),
+ "getFrameData shouldn't provide new data when tab not focused");
+ })();
+ }
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698