diff --git a/src/browser/tests/animation/animation.html b/src/browser/tests/animation/animation.html index 886ac0b8..1cfb768a 100644 --- a/src/browser/tests/animation/animation.html +++ b/src/browser/tests/animation/animation.html @@ -15,7 +15,7 @@ a1.play(); cb.push(a1.playState); }); - testing.eventually(() => testing.expectEqual(['idle', 'running', 'finished', true], cb)); + testing.onload(() => testing.expectEqual(['idle', 'running', 'finished', true], cb)); diff --git a/src/browser/tests/css/font_face_set.html b/src/browser/tests/css/font_face_set.html index c0248a74..c430a15b 100644 --- a/src/browser/tests/css/font_face_set.html +++ b/src/browser/tests/css/font_face_set.html @@ -71,7 +71,7 @@ document.fonts.load("italic bold 16px Roboto"); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(true, loading); testing.expectEqual(true, loadingdone); }); diff --git a/src/browser/tests/css/stylesheet.html b/src/browser/tests/css/stylesheet.html index af6ba4ef..13a54731 100644 --- a/src/browser/tests/css/stylesheet.html +++ b/src/browser/tests/css/stylesheet.html @@ -498,7 +498,7 @@ testing.expectEqual('.async-test', sheet.cssRules[0].selectorText); replacedAsync = true; }); - testing.eventually(() => testing.expectTrue(replacedAsync)); + testing.onload(() => testing.expectTrue(replacedAsync)); } diff --git a/src/browser/tests/document/write.html b/src/browser/tests/document/write.html index d9659e81..25a9901c 100644 --- a/src/browser/tests/document/write.html +++ b/src/browser/tests/document/write.html @@ -131,7 +131,7 @@ document.open(); }, 5); - testing.eventually(() => { + testing.onload(() => { // The element should be gone now const afterOpen = document.getElementById('will_be_removed'); testing.expectEqual(null, afterOpen); diff --git a/src/browser/tests/element/html/event_listeners.html b/src/browser/tests/element/html/event_listeners.html index 73b85631..76db1a01 100644 --- a/src/browser/tests/element/html/event_listeners.html +++ b/src/browser/tests/element/html/event_listeners.html @@ -532,6 +532,6 @@ testing.expectEqual(true, result); }); - testing.eventually(() => testing.expectEqual(true, asyncBlockDispatched)); + testing.onload(() => testing.expectEqual(true, asyncBlockDispatched)); } diff --git a/src/browser/tests/element/html/image.html b/src/browser/tests/element/html/image.html index 8874bbfe..1e672a6f 100644 --- a/src/browser/tests/element/html/image.html +++ b/src/browser/tests/element/html/image.html @@ -139,7 +139,7 @@ }); }); - testing.eventually(() => testing.expectEqual(true, result)); + testing.onload(() => testing.expectEqual(true, result)); } @@ -150,7 +150,7 @@ const img = document.createElement("img"); img.addEventListener("load", () => { fired = true; }); document.body.appendChild(img); - testing.eventually(() => testing.expectEqual(false, fired)); + testing.onload(() => testing.expectEqual(false, fired)); } @@ -163,7 +163,7 @@ document.body.appendChild(img); img.src = "https://cdn.lightpanda.io/website/assets/images/docs/hn.png"; - testing.eventually(() => testing.expectEqual(true, result)); + testing.onload(() => testing.expectEqual(true, result)); } diff --git a/src/browser/tests/element/html/input.html b/src/browser/tests/element/html/input.html index 2b8576b5..d021fac6 100644 --- a/src/browser/tests/element/html/input.html +++ b/src/browser/tests/element/html/input.html @@ -210,7 +210,7 @@ }); input.setSelectionRange(1, 4); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(5, eventCount); testing.expectEqual('selectionchange', lastEvent.type); testing.expectEqual(input, lastEvent.target); @@ -247,7 +247,7 @@ input.select(); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, eventCount); testing.expectEqual('select', lastEvent.type); testing.expectEqual(input, lastEvent.target); diff --git a/src/browser/tests/element/html/link.html b/src/browser/tests/element/html/link.html index 40d45c2f..57d9e28b 100644 --- a/src/browser/tests/element/html/link.html +++ b/src/browser/tests/element/html/link.html @@ -54,7 +54,7 @@ link.rel = 'stylesheet'; link.addEventListener('load', () => { fired = true; }); document.head.appendChild(link); - testing.eventually(() => testing.expectEqual(false, fired)); + testing.onload(() => testing.expectEqual(false, fired)); } @@ -66,7 +66,7 @@ link.href = 'https://lightpanda.io/opensource-browser/15'; link.addEventListener('load', () => { fired = true; }); document.head.appendChild(link); - testing.eventually(() => testing.expectEqual(false, fired)); + testing.onload(() => testing.expectEqual(false, fired)); } @@ -81,7 +81,7 @@ // then set href. link.href = 'https://lightpanda.io/opensource-browser/15'; - testing.eventually(() => testing.expectEqual(true, result)); + testing.onload(() => testing.expectEqual(true, result)); } @@ -98,7 +98,7 @@ }); - testing.eventually(() => { + testing.onload(() => { results.forEach((r) => { testing.expectEqual(true, r); }); diff --git a/src/browser/tests/element/html/script/dynamic.html b/src/browser/tests/element/html/script/dynamic.html index dcd0d403..a6a0179c 100644 --- a/src/browser/tests/element/html/script/dynamic.html +++ b/src/browser/tests/element/html/script/dynamic.html @@ -8,14 +8,14 @@ script1.async = false; script1.src = "dynamic1.js"; document.getElementsByTagName('head')[0].appendChild(script1); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, loaded1); }); @@ -25,7 +25,7 @@ const script2a = document.createElement('script'); script2a.src = "dynamic2.js"; document.getElementsByTagName('head')[0].appendChild(script2a); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(2, loaded2); }); @@ -38,7 +38,7 @@ diff --git a/src/browser/tests/element/html/script/dynamic_inline.html b/src/browser/tests/element/html/script/dynamic_inline.html index d5cb60f2..e06b4821 100644 --- a/src/browser/tests/element/html/script/dynamic_inline.html +++ b/src/browser/tests/element/html/script/dynamic_inline.html @@ -48,7 +48,7 @@ s6.type = 'module'; s6.textContent = 'window.module_executed = true;'; document.head.appendChild(s6); - testing.eventually(() => { + testing.onload(() => { testing.expectTrue(window.module_executed); }); diff --git a/src/browser/tests/element/html/script/script.html b/src/browser/tests/element/html/script/script.html index 75547d40..4f826fe7 100644 --- a/src/browser/tests/element/html/script/script.html +++ b/src/browser/tests/element/html/script/script.html @@ -21,7 +21,7 @@ testing.expectEqual(testing.BASE_URL + 'element/html/script/empty.js', s.src); document.head.appendChild(s); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(true, dom_load); testing.expectEqual(true, attribute_load); }); diff --git a/src/browser/tests/element/html/slot.html b/src/browser/tests/element/html/slot.html index b3ee2a58..ac162817 100644 --- a/src/browser/tests/element/html/slot.html +++ b/src/browser/tests/element/html/slot.html @@ -427,7 +427,7 @@ div.setAttribute('slot', 'content'); host.appendChild(div); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls); }); } @@ -455,7 +455,7 @@ div.setAttribute('slot', 'other'); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls); }); } @@ -483,7 +483,7 @@ div.remove(); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls); }); } @@ -511,7 +511,7 @@ div.slot = 'other'; - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls); }); } diff --git a/src/browser/tests/element/html/style.html b/src/browser/tests/element/html/style.html index ee393846..5a5cb4be 100644 --- a/src/browser/tests/element/html/style.html +++ b/src/browser/tests/element/html/style.html @@ -128,7 +128,7 @@ }); }); - testing.eventually(() => testing.expectEqual(true, result)); + testing.onload(() => testing.expectEqual(true, result)); } diff --git a/src/browser/tests/element/html/textarea.html b/src/browser/tests/element/html/textarea.html index 1690a132..daf57149 100644 --- a/src/browser/tests/element/html/textarea.html +++ b/src/browser/tests/element/html/textarea.html @@ -256,7 +256,7 @@ textarea.select(); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, eventCount); testing.expectEqual('select', lastEvent.type); testing.expectEqual(textarea, lastEvent.target); @@ -295,7 +295,7 @@ }); textarea.setSelectionRange(1, 4); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(5, eventCount); testing.expectEqual('selectionchange', lastEvent.type); testing.expectEqual(textarea, lastEvent.target); diff --git a/src/browser/tests/event/abort_controller.html b/src/browser/tests/event/abort_controller.html index 4a14aee4..c3f448d4 100644 --- a/src/browser/tests/event/abort_controller.html +++ b/src/browser/tests/event/abort_controller.html @@ -242,7 +242,7 @@ diff --git a/src/browser/tests/frames/post_message.html b/src/browser/tests/frames/post_message.html index 6d206b74..837897c3 100644 --- a/src/browser/tests/frames/post_message.html +++ b/src/browser/tests/frames/post_message.html @@ -17,7 +17,7 @@ iframe.contentWindow.postMessage('ping', '*'); }); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual('pong', reply.data); testing.expectEqual(testing.ORIGIN, reply.origin); }); diff --git a/src/browser/tests/frames/target.html b/src/browser/tests/frames/target.html index 3c4c7f36..86e095e5 100644 --- a/src/browser/tests/frames/target.html +++ b/src/browser/tests/frames/target.html @@ -5,7 +5,7 @@ @@ -21,7 +21,7 @@ form.action = 'support/page.html'; form.submit(); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual('a-page\n', frame2.contentDocument.documentElement.outerHTML); }); } @@ -35,7 +35,7 @@ diff --git a/src/browser/tests/legacy/dom/animation.html b/src/browser/tests/legacy/dom/animation.html index 27e562a0..e109ab0e 100644 --- a/src/browser/tests/legacy/dom/animation.html +++ b/src/browser/tests/legacy/dom/animation.html @@ -11,5 +11,5 @@ cb.push('finished'); cb.push(x == a1); }); - testing.eventually(() => testing.expectEqual(['finished', true], cb)); + testing.onload(() => testing.expectEqual(['finished', true], cb)); diff --git a/src/browser/tests/legacy/dom/intersection_observer.html b/src/browser/tests/legacy/dom/intersection_observer.html index c48f4754..d569894f 100644 --- a/src/browser/tests/legacy/dom/intersection_observer.html +++ b/src/browser/tests/legacy/dom/intersection_observer.html @@ -11,7 +11,7 @@ count += 1; }).observe(div); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(0, count); }); } @@ -27,7 +27,7 @@ }).observe(div1); div2.appendChild(div1); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, count); }); } @@ -51,7 +51,7 @@ observer.observe(div1); testing.expectEqual(0, count); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, count); }); } @@ -75,7 +75,7 @@ testing.expectEqual(0, count); observer.unobserve(div1); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(0, count); }); } @@ -100,7 +100,7 @@ testing.expectEqual(0, count); observer.disconnect(); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(0, count); }); } @@ -117,7 +117,7 @@ document.body.appendChild(div1); new IntersectionObserver(entries => { entry = entries[0]; }).observe(div1); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(125, entry.boundingClientRect.x); testing.expectEqual(1, entry.intersectionRatio); testing.expectEqual(125, entry.intersectionRect.x); @@ -150,7 +150,7 @@ observer.observe(div); capture.push('post-observe'); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual([ 'pre-append', 'post-append', diff --git a/src/browser/tests/legacy/html/abort_controller.html b/src/browser/tests/legacy/html/abort_controller.html index fc5a1cdf..5f9f0ee0 100644 --- a/src/browser/tests/legacy/html/abort_controller.html +++ b/src/browser/tests/legacy/html/abort_controller.html @@ -31,7 +31,7 @@ diff --git a/src/browser/tests/legacy/html/slot.html b/src/browser/tests/legacy/html/slot.html index 026e13e0..36e3bc1f 100644 --- a/src/browser/tests/legacy/html/slot.html +++ b/src/browser/tests/legacy/html/slot.html @@ -94,7 +94,7 @@ lp.appendChild(div); testing.expectEqual(slot, div.assignedSlot); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls) }); } @@ -113,7 +113,7 @@ const div = $('#s2'); div.removeAttribute('slot'); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls) }); } @@ -132,7 +132,7 @@ const div = $('#s3'); div.slot = 'other'; - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls) }); } @@ -154,7 +154,7 @@ div.slot = 'other'; lp.appendChild(div); div.slot = 'slot-1' - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls) }); } @@ -172,7 +172,7 @@ }); $('#s5').remove(); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(1, calls) }); } diff --git a/src/browser/tests/legacy/window/window.html b/src/browser/tests/legacy/window/window.html index 7a2a7374..dee57062 100644 --- a/src/browser/tests/legacy/window/window.html +++ b/src/browser/tests/legacy/window/window.html @@ -16,7 +16,7 @@ start = timestamp; } requestAnimationFrame(step); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(true, start > 0) }); @@ -24,23 +24,23 @@ start = 0; }); cancelAnimationFrame(request_id); - testing.eventually(() => testing.expectEqual(true, start > 0)); + testing.onload(() => testing.expectEqual(true, start > 0)); diff --git a/src/browser/tests/window/body_onload2.html b/src/browser/tests/window/body_onload2.html index 0403b30c..eeff067e 100644 --- a/src/browser/tests/window/body_onload2.html +++ b/src/browser/tests/window/body_onload2.html @@ -7,7 +7,7 @@ // Verify: handler fires, "event" parameter is a proper Event, and handler is a function. let loadEvent = null; - testing.eventually(() => { + testing.onload(() => { testing.expectEqual("function", typeof document.body.onload); testing.expectTrue(loadEvent instanceof Event); testing.expectEqual("load", loadEvent.type); diff --git a/src/browser/tests/window/body_onload3.html b/src/browser/tests/window/body_onload3.html index 875be388..fdc5987a 100644 --- a/src/browser/tests/window/body_onload3.html +++ b/src/browser/tests/window/body_onload3.html @@ -7,7 +7,7 @@ // Verify: handler fires exactly once, and body.onload reflects to window.onload. let called = 0; - testing.eventually(() => { + testing.onload(() => { // The attribute handler should have fired exactly once. testing.expectEqual(1, called); diff --git a/src/browser/tests/window/timers.html b/src/browser/tests/window/timers.html index 0e8a09e1..9e22d4d2 100644 --- a/src/browser/tests/window/timers.html +++ b/src/browser/tests/window/timers.html @@ -17,7 +17,7 @@ testing.expectEqual(true, timer1 != timer2); - testing.eventually(() => { + testing.onload(() => { testing.expectEqual(true, set_interval1); testing.expectEqual(false, set_interval2); }); @@ -29,7 +29,7 @@ window.setTimeout((a, b) => { wst2 = a + b; }, 1, 2, 3); - testing.eventually(() => testing.expectEqual(5, wst2)); + testing.onload(() => testing.expectEqual(5, wst2));