tor-browser

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

iframe.html (935B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>TestDriver actions on a document in an iframe</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 <script src="/resources/testdriver-actions.js"></script>
      9 
     10 <iframe src="iframeChild.html"></iframe>
     11 
     12 <script>
     13 setup({single_test: true});
     14 addEventListener("load", async () => {
     15  let input = frames[0].document.getElementsByTagName("input")[0];
     16  await new test_driver.Actions()
     17   .pointerMove(0, 0, {origin: input})
     18   .pointerDown()
     19   .pointerUp()
     20   .send();
     21  await new test_driver.Actions()
     22   .setContext(frames[0])
     23   .keyDown("P")
     24   .keyUp("P")
     25   .keyDown("A")
     26   .keyUp("A")
     27   .keyDown("S")
     28   .keyUp("S")
     29   .keyDown("S")
     30   .keyUp("S")
     31   .send();
     32  assert_equals(input.value, "PASS");
     33  done();
     34 });
     35 </script>