mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Use a BTreeMap for Document::animation_frame_list (fixes #9834)
The callbacks must stay ordered.
This commit is contained in:
parent
f7db68eff7
commit
1d87f61350
4 changed files with 66 additions and 10 deletions
|
@ -5562,6 +5562,12 @@
|
|||
"url": "/_mozilla/mozilla/collections.html"
|
||||
}
|
||||
],
|
||||
"mozilla/deterministic-raf.html": [
|
||||
{
|
||||
"path": "mozilla/deterministic-raf.html",
|
||||
"url": "/_mozilla/mozilla/deterministic-raf.html"
|
||||
}
|
||||
],
|
||||
"mozilla/documentElement.html": [
|
||||
{
|
||||
"path": "mozilla/documentElement.html",
|
||||
|
|
43
tests/wpt/mozilla/tests/mozilla/deterministic-raf.html
Normal file
43
tests/wpt/mozilla/tests/mozilla/deterministic-raf.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
async_test(function (t) {
|
||||
var i = 0;
|
||||
var log = [];
|
||||
var loopB_ended = false;
|
||||
|
||||
var loopA = function () {
|
||||
log.push("A");
|
||||
if (i++ < 5) {
|
||||
requestAnimationFrame(loopA);
|
||||
} else {
|
||||
assert_true(loopB_ended);
|
||||
t.step(function () {
|
||||
assert_array_equals(log,
|
||||
["A", "B", "A", "B", "A", "B", "A", "B", "A", "B", "A"]);
|
||||
});
|
||||
t.done();
|
||||
}
|
||||
};
|
||||
|
||||
var loopB = function () {
|
||||
log.push("B");
|
||||
if (i < 5) {
|
||||
requestAnimationFrame(loopB);
|
||||
} else {
|
||||
assert_false(loopB_ended);
|
||||
loopB_ended = true;
|
||||
t.step(function () {
|
||||
assert_array_equals(log,
|
||||
["A", "B", "A", "B", "A", "B", "A", "B", "A", "B"]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
loopA();
|
||||
loopB();
|
||||
}, "Concurrent requestAnimationFrame loops are deterministic");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue