Skip to content

Commit

Permalink
Bug 1761956 [wpt PR 33403] - Make sure iframe reports resource timing…
Browse files Browse the repository at this point in the history
… for non-HTML, a=testonly

Automatic update from web-platform-tests
Report resource timing for non-html iframes (#33403)

--

wpt-commits: 3cf8b13014eab753122f4064bce4fe57714eb3af
wpt-pr: 33403
  • Loading branch information
noamr authored and moz-wptsync-bot committed Apr 1, 2022
1 parent 7e4e942 commit 211d7d1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions testing/web-platform/tests/resource-timing/iframe-non-html.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test the sequence of events when reporting iframe timing.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/resource-loaders.js"></script>
<body>
<script>
function test(href, type) {
promise_test(async t => {
await load.iframe(href);
const entries = performance.getEntriesByType('resource').filter(({name}) => name.includes(href));
assert_equals(entries.length, 1);
assert_equals(entries[0].initiatorType, 'iframe');
}, `Iframes should report resource timing for ${type} iframes`);
}

test('/common/square.png', 'image');
test('/common/dummy.xhtml', 'xhtml');
test('/common/dummy.xml', 'xml');
test('/common/text-plain.txt', 'text');
</script>
</body>

0 comments on commit 211d7d1

Please sign in to comment.