OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 Tests that when a screen taps causes a frame that isn't presenting to gain |
| 4 focus, that the presenting frame still receives input. |
| 5 --> |
| 6 <html> |
| 7 <head> |
| 8 <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css"> |
| 9 </head> |
| 10 <body> |
| 11 <canvas id="webgl-canvas"></canvas> |
| 12 <script src="../../../../../../third_party/WebKit/LayoutTests/resources/test
harness.js"></script> |
| 13 <script src="../resources/webvr_e2e.js"></script> |
| 14 <script src="../resources/webvr_boilerplate.js"></script> |
| 15 <script> |
| 16 var t = async_test("Focus is locked to presentation"); |
| 17 var rafCount = 0; |
| 18 window.addEventListener("vrdisplaypresentchange", |
| 19 () => {finishJavaScriptStep();}, false); |
| 20 window.onfocus = function() { |
| 21 onAnimationFrameCallback = null; |
| 22 setTimeout(function() { |
| 23 document.getElementById('externalframe').contentWindow.focus(); |
| 24 }, 1000); |
| 25 }; |
| 26 window.onblur = function() { |
| 27 onAnimationFrameCallback = function() { |
| 28 if (rafCount = 3) { |
| 29 finishJavaScriptStep(); |
| 30 t.done(); |
| 31 } |
| 32 rafCount++; |
| 33 } |
| 34 } |
| 35 </script> |
| 36 <iframe id="externalframe" width="1" height="1" src="about:blank" /> |
| 37 </body> |
| 38 </html> |
OLD | NEW |