mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-31 13:08:15 +00:00
test: prove the frame lifecycle fixes against the real extension
The evidence for the frame-observation fixes was a reimplementation of the logic measured in a browser console, not the shipped code. Two extension specs now cover the observable behaviour end to end: a player frame that swaps its document, and the same one level deeper. The nested case fails against the pre-fix content.js and passes now. The top-level case already passed before the fix, so that fix removed dead observer registrations without changing what a user could see; recorded here so the distinction is not lost. Also adds bench-finder.mjs, which measures the extracted shipped finder instead of a transcription of it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Outer</title>
|
||||
<style>body { margin: 0 }</style>
|
||||
<!-- Wrapper frame with no video of its own: the player sits one level deeper,
|
||||
so anything that only walks the top document's frames misses it. -->
|
||||
<iframe class="inner_player" width="860" height="490" src="player-frame.html"></iframe>
|
||||
@@ -0,0 +1,7 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>V2</title>
|
||||
<style>body { margin: 0 }</style>
|
||||
<!-- The frame's second server/quality choice: a different element, so
|
||||
re-attaching to it is distinguishable from staying on the old one. -->
|
||||
<video id="framed-player-2" data-expected width="854" height="480" controls src="../../media/player-1080p-30s.mp4"></video>
|
||||
@@ -0,0 +1,6 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Nested player frame</title>
|
||||
<h1>Player two frame levels down</h1>
|
||||
<iframe class="outer_frame" width="870" height="500" src="frames/outer-frame.html"></iframe>
|
||||
<script src="ready.js"></script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Reloading player frame</title>
|
||||
<h1>Player frame that swaps its document, like a server or quality switch</h1>
|
||||
<!-- Nothing in the top document changes when the frame navigates, so the top
|
||||
document's MutationObserver never fires. Only a load hook on the frame can
|
||||
notice, which is exactly what this fixture pins down. -->
|
||||
<iframe class="player_frame" width="860" height="490" src="frames/player-frame.html"></iframe>
|
||||
<script src="ready.js"></script>
|
||||
Reference in New Issue
Block a user