mirror of
https://github.com/servo/servo.git
synced 2025-09-02 11:08:22 +01:00
Update web-platform-tests to revision 60220357131c65146444da1f54624d5b54d0975d
This commit is contained in:
parent
c45192614c
commit
775b784f79
2144 changed files with 58115 additions and 29658 deletions
|
@ -6,21 +6,47 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
promise_test(async () => {
|
||||
const idl_array = new IdlArray();
|
||||
const idl = await fetch("/interfaces/performance-timeline.idl").then(r => r.text());
|
||||
const dom = await fetch("/interfaces/dom.idl").then(r => r.text());
|
||||
const hrtime = await fetch("/interfaces/hr-time.idl").then(r => r.text());
|
||||
|
||||
// create first mark
|
||||
self.performance.mark("mark");
|
||||
|
||||
idl_array.add_idls(idl);
|
||||
idl_array.add_dependency_idls(hrtime);
|
||||
idl_array.add_dependency_idls(dom);
|
||||
idl_array.add_objects({
|
||||
Performance: ["performance"],
|
||||
PerformanceMark: [self.performance.getEntriesByName("mark")[0]],
|
||||
promise_test(async t => {
|
||||
const observe = new Promise((resolve, reject) => {
|
||||
try {
|
||||
self.observer = new PerformanceObserver((entries, observer) => {
|
||||
self.entryList = entries;
|
||||
self.mark = entries.getEntries()[0];
|
||||
resolve();
|
||||
});
|
||||
observer.observe({ entryTypes: ['mark'] });
|
||||
performance.mark('test');
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
idl_array.test();
|
||||
}, "Test IDL implementation of performance-timeline API");
|
||||
const timeout = new Promise((_, reject) => {
|
||||
t.step_timeout(() => reject('Timed out waiting for observation'), 3000);
|
||||
});
|
||||
const user = await fetch('/interfaces/user-timing.idl').then(r => r.text());
|
||||
const execute_test = () => {
|
||||
idl_test(
|
||||
['performance-timeline'],
|
||||
['hr-time', 'dom'],
|
||||
idl_array => {
|
||||
idl_array.add_idls(user, {only: ['PerformanceMark']});
|
||||
idl_array.add_objects({
|
||||
Performance: ['performance'],
|
||||
// NOTE: PerformanceMark cascadingly tests PerformanceEntry
|
||||
PerformanceMark: ['mark'],
|
||||
PerformanceObserver: ['observer'],
|
||||
PerformanceObserverEntryList: ['entryList'],
|
||||
});
|
||||
},
|
||||
'Test IDL implementation of performance-timeline API'
|
||||
);
|
||||
};
|
||||
|
||||
return Promise.race([observe, timeout]).then(
|
||||
execute_test,
|
||||
reason => {
|
||||
execute_test();
|
||||
return Promise.reject(reason);
|
||||
}
|
||||
);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue