Skip to content

Commit

Permalink
Add infra test that window.load happens before reftest capture
Browse files Browse the repository at this point in the history
This adds a WPT infrastructure test to enforce that the harness
waits for window.load before capturing reftest images. That allows
testing like this:

```
<link rel=match href=green.html>
<script>
  window.onload = () => document.body.append('test');
</script>
```

See [1] for conversation.

[1] #43310

Change-Id: I1f3f9836ca880350b294538dd2f2d58689485f7b
  • Loading branch information
Mason Freed authored and chromium-wpt-export-bot committed Nov 27, 2023
1 parent e570039 commit 9f50c3c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions infrastructure/reftest/reftest_window_load.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<title>rel=match waits for window load</title>
<link rel=match href=green.html>
<script>
window.onload = () => {
const s = document.createElement('style');
s.innerText = ':root {background-color:green}';
document.body.appendChild(s);
};
</script>

0 comments on commit 9f50c3c

Please sign in to comment.