Skip to content

Commit 1d50e09

Browse files
committed
add window.onload test
1 parent c587e38 commit 1d50e09

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/tests/window/window.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,16 @@
104104
});
105105
testing.eventually(() => testing.expectEqual(true, dcl));
106106
</script>
107+
108+
<script id=window.onload>
109+
let isWindowTarget = false;
110+
111+
const callback = (e) => isWindowTarget = e.target === window;
112+
// Callback is not set yet.
113+
testing.expectEqual(null, window.onload);
114+
// Callback is set.
115+
window.onload = callback;
116+
testing.expectEqual(callback, window.onload);
117+
118+
testing.eventually(() => testing.expectEqual(true, isWindowTarget));
119+
</script>

0 commit comments

Comments
 (0)