summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/testdriver/actions/iframe.html
blob: 6c64d6f49abc14cb03c5173536bb2d38c6d16e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<meta charset="utf-8">
<title>TestDriver actions on a document in an iframe</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>

<iframe src="iframeChild.html"></iframe>

<script>
setup({single_test: true});
addEventListener("load", async () => {
  let input = frames[0].document.getElementsByTagName("input")[0];
  await new test_driver.Actions()
   .pointerMove(0, 0, {origin: input})
   .pointerDown()
   .pointerUp()
   .send();
  await new test_driver.Actions()
   .setContext(frames[0])
   .keyDown("P")
   .keyUp("P")
   .keyDown("A")
   .keyUp("A")
   .keyDown("S")
   .keyUp("S")
   .keyDown("S")
   .keyUp("S")
   .send();
  assert_equals(input.value, "PASS");
  done();
});
</script>