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

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

Issue 2881233002: WebVR: lock focus while presenting to presenting window (Closed)
Patch Set: Created 3 years, 7 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_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>

Powered by Google App Engine
This is Rietveld 408576698