Index: chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html |
diff --git a/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html b/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f7fb828f474e8df448bc0cdb088d29b93cf608da |
--- /dev/null |
+++ b/chrome/test/data/android/webvr_instrumentation/html/test_presentation_locks_focus.html |
@@ -0,0 +1,38 @@ |
+<!doctype html> |
+<!-- |
+Tests that when a screen taps causes a frame that isn't presenting to gain |
+focus, that the presenting frame still receives input. |
+--> |
+<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("Focus is locked to presentation"); |
+ var rafCount = 0; |
+ window.addEventListener("vrdisplaypresentchange", |
+ () => {finishJavaScriptStep();}, false); |
+ window.onfocus = function() { |
+ onAnimationFrameCallback = null; |
+ setTimeout(function() { |
+ document.getElementById('externalframe').contentWindow.focus(); |
+ }, 1000); |
+ }; |
+ window.onblur = function() { |
+ onAnimationFrameCallback = function() { |
+ if (rafCount = 3) { |
+ finishJavaScriptStep(); |
+ t.done(); |
+ } |
+ rafCount++; |
+ } |
+ } |
+ </script> |
+ <iframe id="externalframe" width="1" height="1" src="about:blank" /> |
+ </body> |
+</html> |