mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Update web-platform-tests to revision ac12b3e9488edb436f063b11213e954ae62d5a5e
This commit is contained in:
parent
65370f17c9
commit
b56a3b8e69
111 changed files with 3122 additions and 68 deletions
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset=utf-8 />
|
||||
<title>Element Timing: buffer elements before onload</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="resources/element-timing-helpers.js"></script>
|
||||
<body>
|
||||
<img src=resources/slow-image.py?name=square20.png&sleep=500>
|
||||
<script>
|
||||
/*
|
||||
In this test, a slow image is added to the frame to delay onload. The entry
|
||||
for the other image should be available before onload, and thus delivered to
|
||||
the performance timeline.
|
||||
*/
|
||||
async_test(function(t) {
|
||||
beforeRender = performance.now();
|
||||
const img = document.createElement('img');
|
||||
img.src = 'resources/square20.jpg';
|
||||
img.setAttribute('elementtiming', 'my_image');
|
||||
document.body.appendChild(img);
|
||||
window.onload = t.step_func_done( () => {
|
||||
const entries = performance.getEntriesByName('my_image');
|
||||
assert_equals(entries.length, 1);
|
||||
assert_greater_than_equal(performance.getEntriesByType('element').length, 1);
|
||||
assert_equals(performance.getEntries().filter(e => e.name === 'my_image').length, 1);
|
||||
const entry = entries[0];
|
||||
checkElement(entry, 'my_image', beforeRender);
|
||||
});
|
||||
}, "Element Timing: image loads before onload.");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue