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

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: Simplify Javascript code slightly 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..2abd76570cc0c5a0acc4be695238f26028bfe65d
--- /dev/null
+++ b/chrome/test/data/android/webvr_instrumentation/html/test_pose_data_unfocused_tab.html
@@ -0,0 +1,63 @@
+<!doctype html>
+<!--
+Tests that WebVR doesn't update frame data when the tab is not focused
+-->
+<html>
+ <head>
+ <style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ }
+ #webgl-canvas {
+ box-sizing: border-box;
+ height: 100%;
+ left: 0;
+ margin: 0;
+ position: absolute;
+ top: 0;
+ width: 100%;
+ }
+ #log {
+ display: none;
+ }
+ </style>
+ </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 onAnimationFrame1() {
Lei Lei 2017/02/16 22:04:49 Nit: no need to add 1 at end of function name.
bsheedy 2017/02/16 23:30:13 Done.
+ 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(onAnimationFrame1);
+ }
+
+ function stepCheckFrameDataWhileNonFocusedTab() {
+ t.step( () => {
Lei Lei 2017/02/16 22:04:50 Nit: you can call t.step_func_done which does t.st
bsheedy 2017/02/16 23:30:14 Done.
+ assert_false(vrDisplay.getFrameData(fd),
+ "getFrameData shouldn't provide new data when tab not focused");
+ });
+ t.done();
+ }
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698