| <script src="../../resources/js-test-pre.js"></script> |
| description('This tests the order by which tasks are scheduled across documents of file URI documents.'); |
| testFailed('This test relies on window.internals'); |
| 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); |
| 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')); |
| shouldBeEqualToString('logs.join(", ")', '1, 2, 3, 4, 5, 6'); |
| shouldBeTrue('internals.hasSameEventLoopAs(frame1.contentWindow)'); |
| shouldBeTrue('internals.hasSameEventLoopAs(frame2.contentWindow)'); |
| successfullyParsed = true; |
| <script src="../../resources/js-test-post.js"></script> |