-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
load-event-iframe-element.html
49 lines (44 loc) · 1.85 KB
/
load-event-iframe-element.html
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<meta charset="UTF-8">
<title>"load" event fires on the iframe element when loading the initial empty document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/helpers.js"></script>
<body></body>
<script>
"use strict";
promise_test(async t => {
const iframe = document.createElement("iframe");
let eventAssertionPromise = assertEventFired(t, "load", iframe, 1);
document.body.appendChild(iframe);
await eventAssertionPromise;
}, "load event fires on <iframe> element created with no src");
promise_test(async t => {
const iframe = document.createElement("iframe");
iframe.src = "";
let eventAssertionPromise = assertEventFired(t, "load", iframe, 1);
document.body.appendChild(iframe);
await eventAssertionPromise;
}, "load event fires on <iframe> element created with src=''");
promise_test(async t => {
const iframe = document.createElement("iframe");
iframe.src = "about:blank";
let eventAssertionPromise = assertEventFired(t, "load", iframe, 1);
document.body.appendChild(iframe);
await eventAssertionPromise;
}, "load event fires on <iframe> element created with src='about:blank'");
promise_test(async t => {
const iframe = document.createElement("iframe");
iframe.src = "about:blank#foo";
let eventAssertionPromise = assertEventFired(t, "load", iframe, 1);
document.body.appendChild(iframe);
await eventAssertionPromise;
}, "load event fires on <iframe> element created with src='about:blank#foo'");
promise_test(async t => {
const iframe = document.createElement("iframe");
iframe.src = "about:blank?foo";
let eventAssertionPromise = assertEventFired(t, "load", iframe, 1);
document.body.appendChild(iframe);
await eventAssertionPromise;
}, "load event fires on <iframe> element created with src='about:blank?foo'");
</script>