blob: 9485ca1ed7e6fc5dc63e7695bffcaf742d831187 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/js-test-pre.js"></script>
<script>
description('This tests the order by which tasks are scheduled across documents of similar origins.');
if (!window.internals)
testFailed('This test relies on window.internals');
else {
jsTestIsAsync = true;
logs = [];
frame1 = document.createElement('iframe');
document.body.appendChild(frame1);
frame2 = document.createElement('iframe');
frame2.src = 'resources/eventloop-helper.html';
frame2.addEventListener('load', runTest);
document.body.appendChild(frame2);
}
function runTest() {
internals.queueTask("DOMManipulation", () => logs.push('1'));
frame1.contentWindow.internals.queueTask("DOMManipulation", () => logs.push('2'));
internals.queueTask("DOMManipulation", () => logs.push('3'));
frame2.contentWindow.internals.queueTask("DOMManipulation", () => logs.push('4'));
frame1.contentWindow.internals.queueTask("DOMManipulation", () => logs.push('5'));
internals.queueTask("DOMManipulation", () => logs.push('6'));
setTimeout(() => {
shouldBeEqualToString('logs.join(", ")', '1, 2, 3, 4, 5, 6');
finishJSTest();
}, 100);
}
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>