mirror of
https://github.com/servo/servo.git
synced 2025-09-17 10:28:22 +01:00
Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee
This commit is contained in:
parent
fe1a057bd1
commit
24183668c4
1960 changed files with 29853 additions and 10555 deletions
|
@ -0,0 +1,44 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
const keys = [
|
||||
'name',
|
||||
'entryType',
|
||||
'startTime',
|
||||
'duration',
|
||||
];
|
||||
test(() => {
|
||||
performance.mark('a');
|
||||
const markEntries = performance.getEntriesByType('mark');
|
||||
assert_equals(1, markEntries.length);
|
||||
const markEntry = markEntries[0];
|
||||
assert_equals(markEntry.entryType, 'mark');
|
||||
assert_equals(typeof(markEntry.toJSON), 'function');
|
||||
const markJSON = markEntry.toJSON();
|
||||
assert_equals(typeof(markJSON), 'object');
|
||||
for (const key of keys) {
|
||||
assert_equals(markJSON[key], markEntry[key], `PerformanceMark ${key} entry does not match its toJSON value`);
|
||||
}
|
||||
}, 'Test toJSON() in PerformanceMark');
|
||||
|
||||
test(() => {
|
||||
performance.measure('m');
|
||||
const measureEntries = performance.getEntriesByType('measure');
|
||||
assert_equals(1, measureEntries.length);
|
||||
const measureEntry = measureEntries[0];
|
||||
assert_equals(measureEntry.entryType, 'measure');
|
||||
assert_equals(typeof(measureEntry.toJSON), 'function');
|
||||
const measureJSON = measureEntry.toJSON();
|
||||
assert_equals(typeof(measureJSON), 'object');
|
||||
for (const key of keys) {
|
||||
assert_equals(measureJSON[key], measureEntry[key], `PerformanceMeasure ${key} entry does not match its toJSON value`);
|
||||
}
|
||||
}, 'Test toJSON() in PerformanceMeasure');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue