tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_pointercapture_xorigin_iframe.html (1328B)


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