mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Update web-platform-tests to revision abd18b3e018d25ed668d179c905b7869dca5e239
This commit is contained in:
parent
908a642063
commit
158f7eec0e
117 changed files with 2997 additions and 434 deletions
|
@ -0,0 +1,28 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
|
||||
'use strict';
|
||||
|
||||
// https://w3c.github.io/paint-timing/
|
||||
|
||||
idl_test(
|
||||
['paint-timing'],
|
||||
['performance-timeline'],
|
||||
(idl_array, t) => {
|
||||
idl_array.add_objects({
|
||||
PerformancePaintTiming: ['paintTiming'],
|
||||
});
|
||||
|
||||
const awaitPaint = new Promise(resolve => {
|
||||
let observer = new PerformanceObserver(list => {
|
||||
self.paintTiming = list.getEntries()[0];
|
||||
resolve();
|
||||
});
|
||||
observer.observe({ entryTypes: ['paint'] });
|
||||
});
|
||||
const timeout = new Promise((_, reject) => {
|
||||
t.step_timeout(() => reject('Timed out waiting for paint event'), 3000);
|
||||
});
|
||||
return Promise.race([awaitPaint, timeout]);
|
||||
},
|
||||
'paint-timing interfaces.');
|
Loading…
Add table
Add a link
Reference in a new issue