mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<link rel=author title="Aleks Totic" href="mailto:atotic@chromium.org">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#clean-up-after-running-script">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/common.js"></script>
|
||||
</head>
|
||||
<body style="height:2000px;">
|
||||
<script>
|
||||
/*
|
||||
promise 1, promise 2 execute immediately after rAF
|
||||
promise 1 child executes immediately after promise 2.
|
||||
|
||||
Relevant specs:
|
||||
|
||||
https://html.spec.whatwg.org/#clean-up-after-running-script
|
||||
If the JavaScript execution context stack is now empty, perform a microtask checkpoint.
|
||||
|
||||
https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
|
||||
"perform a microtask checkpoint" runs in a loop until all microtasks have been delivered.
|
||||
*/
|
||||
|
||||
var test = async_test("Microtask execute immediately after script");
|
||||
|
||||
window.requestAnimationFrame( function() {
|
||||
var events = [];
|
||||
|
||||
Promise.resolve()
|
||||
.then(function() {
|
||||
events.push("promise 1");
|
||||
return Promise.resolve();
|
||||
})
|
||||
.then(function() {
|
||||
test.step(function() {
|
||||
events.push("promise 1 child");
|
||||
assert_array_equals(events, ["promise 1", "promise 2", "promise 1 child"]);
|
||||
test.done();
|
||||
});
|
||||
});
|
||||
Promise.resolve()
|
||||
.then(function() {
|
||||
events.push("promise 2");
|
||||
});
|
||||
|
||||
// Set up events that must be executed after Promise.
|
||||
window.setTimeout(function() {
|
||||
events.push('timeout');
|
||||
}, 0);
|
||||
window.addEventListener('scroll', function() {
|
||||
events.push('scroll');
|
||||
});
|
||||
window.scrollBy(0,10);
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<link rel=author title="Aleks Totic" href="mailto:atotic@chromium.org">
|
||||
<link rel=help href="https://html.spec.whatwg.org/#clean-up-after-running-script">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/common.js"></script>
|
||||
</head>
|
||||
<body style="height:2000px;">
|
||||
<script>
|
||||
/*
|
||||
promise 1, promise 2 execute immediately after script tag
|
||||
promise 1 child executes immediately after promise 2.
|
||||
|
||||
Relevant specs:
|
||||
|
||||
https://html.spec.whatwg.org/#clean-up-after-running-script
|
||||
If the JavaScript execution context stack is now empty, perform a microtask checkpoint.
|
||||
|
||||
https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
|
||||
"perform a microtask checkpoint" runs in a loop until all microtasks have been delivered.
|
||||
*/
|
||||
|
||||
var test = async_test("Microtask immediately after script");
|
||||
|
||||
var events = [];
|
||||
|
||||
Promise.resolve()
|
||||
.then(function() {
|
||||
events.push("promise 1");
|
||||
return Promise.resolve();
|
||||
})
|
||||
.then(function() {
|
||||
test.step(function() {
|
||||
events.push("promise 1 child");
|
||||
assert_array_equals(events, ["promise 1", "promise 2", "promise 1 child"]);
|
||||
test.done();
|
||||
});
|
||||
});
|
||||
Promise.resolve()
|
||||
.then(function() {
|
||||
events.push("promise 2");
|
||||
});
|
||||
|
||||
// Set up events that must be executed after Promise.
|
||||
window.setTimeout(function() {
|
||||
events.push('timeout');
|
||||
}, 0);
|
||||
window.addEventListener('scroll', function() {
|
||||
events.push('scroll');
|
||||
});
|
||||
window.scrollBy(0,10);
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue