try to make test more stable

This commit is contained in:
Karl Seguin
2026-02-28 21:21:23 +08:00
parent 4f4dbc0c22
commit ac2e276a6a
2 changed files with 7 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
<script> <script>
function frame1Onload() { function frame1Onload() {
window.f1_onload = true; window.f1_onload = 'f1_onload_loaded';
} }
</script> </script>
@@ -12,7 +12,7 @@
<script id="basic"> <script id="basic">
// reload it // reload it
$('#f1').src = 'support/sub 1.html'; $('#f2').src = 'support/sub2.html';
testing.eventually(() => { testing.eventually(() => {
testing.expectEqual(undefined, window[10]); testing.expectEqual(undefined, window[10]);
@@ -53,7 +53,8 @@
// Todo: Context security tokens // Todo: Context security tokens
// testing.expectEqual(true, window.sub1_loaded); // testing.expectEqual(true, window.sub1_loaded);
// testing.expectEqual(true, window.sub2_loaded); // testing.expectEqual(true, window.sub2_loaded);
// testing.expectEqual(2, window.sub1_count); // testing.expectEqual(1, window.sub1_count);
// testing.expectEqual(2, window.sub2_count);
}); });
</script> </script>
@@ -68,7 +69,7 @@
document.documentElement.appendChild(f3); document.documentElement.appendChild(f3);
testing.eventually(() => { testing.eventually(() => {
testing.expectEqual(true, window.f1_onload); testing.expectEqual('f1_onload_loaded', window.f1_onload);
testing.expectEqual(true, f3_load_event); testing.expectEqual(true, f3_load_event);
}); });
} }

View File

@@ -4,4 +4,5 @@
<script> <script>
// should not have access to the parent's JS context // should not have access to the parent's JS context
window.top.sub2_loaded = window.testing == undefined; window.top.sub2_loaded = window.testing == undefined;
window.top.sub2_count = (window.top.sub2_count || 0) + 1;
</script> </script>