Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee

This commit is contained in:
WPT Sync Bot 2018-05-18 22:02:29 -04:00
parent fe1a057bd1
commit 24183668c4
1960 changed files with 29853 additions and 10555 deletions

View file

@ -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>