test_pointerlock_xorigin_iframe.html (1471B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1662587 5 --> 6 <head> 7 <title>Test for Bug 1662587</title> 8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1662587">Mozilla Bug 1662587</a> 14 <div id="content"></div> 15 <pre id="test"> 16 <script type="application/javascript"> 17 /** 18 * Pointer Lock tests for bug 1662587. 19 */ 20 21 SimpleTest.waitForExplicitFinish(); 22 23 let gTestFiles = [ 24 "file_pointerlock_xorigin_iframe.html", 25 "file_pointerlock_xorigin_iframe_no_user_gesture.html", 26 "file_pointerlock_xorigin_iframe_not_focused.html", 27 ]; 28 29 let gTestWindow = null; 30 let gTestIndex = 0; 31 32 SpecialPowers.pushPrefEnv({"set": [ 33 // This will make dispatched event going through parent process. 34 ["test.events.async.enabled", true] 35 ]}, nextTest); 36 37 function nextTest() { 38 if (gTestWindow) { 39 gTestWindow.close(); 40 } 41 SimpleTest.waitForFocus(runNextTest); 42 } 43 44 function runNextTest() { 45 if (gTestIndex < gTestFiles.length) { 46 let file = gTestFiles[gTestIndex]; 47 gTestIndex++; 48 49 info(`Testing ${file}`); 50 gTestWindow = window.open(file, "", "width=500,height=500"); 51 info(`Test finish`); 52 } else { 53 SimpleTest.finish(); 54 } 55 } 56 </script> 57 </pre> 58 </body> 59 </html>