| 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>
|
|
|