mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Update web-platform-tests to revision e45156b5e558c062a609356905c83a0258c516e3
This commit is contained in:
parent
9f6005be16
commit
5fcf52d946
199 changed files with 4430 additions and 530 deletions
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
This tests that 'performance.measure' throws exceptions with reasonable messages.
|
||||
</head>
|
||||
<body>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
window.performance.clearMarks();
|
||||
window.performance.clearMeasures();
|
||||
|
||||
window.performance.mark('mark');
|
||||
|
||||
const eventMarks = [
|
||||
'unloadEventStart',
|
||||
'unloadEventEnd',
|
||||
'redirectStart',
|
||||
'redirectEnd',
|
||||
'secureConnectionStart',
|
||||
'domInteractive',
|
||||
'domContentLoadedEventStart',
|
||||
'domContentLoadedEventEnd',
|
||||
'domComplete',
|
||||
'loadEventStart',
|
||||
'loadEventEnd',
|
||||
];
|
||||
eventMarks.forEach(function(name) {
|
||||
test(()=>{
|
||||
assert_throws("InvalidAccessError", ()=>{
|
||||
window.performance.measure("measuring", name, "mark");
|
||||
}, "Should throw");
|
||||
}, `Passing '${name}' as a mark to measure API should cause error when the mark is empty.`);
|
||||
});
|
||||
|
||||
const args = [
|
||||
51.15, // Verify that number is parsed as string, not number.
|
||||
"DoesNotExist", // Non-existant mark name should cause error.
|
||||
];
|
||||
args.forEach(each => {
|
||||
test(()=>{
|
||||
assert_throws("SyntaxError", ()=>{
|
||||
window.performance.measure("measuring", each, "mark");
|
||||
}, "Should throw");
|
||||
}, `Passing ${each} as a mark to measure API should cause error.`);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue