Skip to content

Commit

Permalink
Iframes with missing redirect location should fire load event and que…
Browse files Browse the repository at this point in the history
…ue RT entry (web-platform-tests#33317)

* Iframes with missing redirect location should fire load event and queue RT entry

See whatwg/html#7531

* Rename and use loader
  • Loading branch information
noamr authored and DanielRyanSmith committed Mar 25, 2022
1 parent 885525b commit 0ae1d76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions resource-timing/iframe-redirect-without-location.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!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>
promise_test(async t => {
const href = new URL('resources/redirect-without-location.py', location.href);
await load.iframe(href);
const entries = performance.getEntriesByType('resource').filter(({name}) => name.startsWith(href));
assert_equals(entries.length, 1);
assert_equals(entries[0].initiatorType, 'iframe');
}, 'Iframes should report resource timing for redirect responses without a location');
</script>
</body>
2 changes: 2 additions & 0 deletions resource-timing/resources/redirect-without-location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main(request, response):
response.status = 302

0 comments on commit 0ae1d76

Please sign in to comment.