mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
fix intermittency of child-document-raf-order test (#33480)
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
cfd15dd14d
commit
9508b83af6
2 changed files with 26 additions and 4 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -703330,7 +703330,7 @@
|
|||
},
|
||||
"update-rendering": {
|
||||
"child-document-raf-order.html": [
|
||||
"222c1af444e5c3f7aab2ac466b6bd1a7e2c93e3e",
|
||||
"eccc1bde7fb83449275ed61e0dacaeb13d684456",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -47,6 +47,17 @@ callbacks for each.
|
|||
|
||||
<script>
|
||||
|
||||
// Split array into chunks of len.
|
||||
function chunk (arr, len) {
|
||||
var chunks = [],
|
||||
i = 0,
|
||||
n = arr.length;
|
||||
while (i < n) {
|
||||
chunks.push(arr.slice(i, i += len));
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
||||
async_test(function (t) {
|
||||
step_timeout(setup, 0);
|
||||
|
||||
|
@ -108,9 +119,20 @@ async_test(function (t) {
|
|||
});
|
||||
|
||||
let finish = t.step_func(function() {
|
||||
assert_array_equals(notification_sequence,
|
||||
["parent_raf", "first_child_raf", "second_child_raf"],
|
||||
"expected order of notifications");
|
||||
|
||||
// The test requests rafs recursively,
|
||||
// but since all three rafs run as part of the same "update the rendering" task,
|
||||
// they should always come in a triplet.
|
||||
assert_equals(notification_sequence.length % 3, 0);
|
||||
|
||||
let chunks = chunk(notification_sequence, 3);
|
||||
for (var i = 0; i < chunks.length; i++) {
|
||||
// Assert correct ordering per triplet of rafs.
|
||||
assert_array_equals(chunks[i],
|
||||
["parent_raf", "first_child_raf", "second_child_raf"],
|
||||
"expected order of notifications");
|
||||
}
|
||||
|
||||
t.done();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue