[skip ci] various fixes
This commit is contained in:
1 parent
0c7bd4b3e0
commit
0f33f72cc1
7 files changed
+67
-2
No files matched your search
@@ -175,6 +175,7 @@ function TestSnapshot() as object
|
||||
return {
|
||||
transportMode: m.transport.transportMode
|
||||
seekSettling: m.transport.seekSettling
|
||||
onCloseCalled: m.onCloseCalled = true
|
||||
control: m.top.control
|
||||
autoplay: m.top.autoplayAfterSeek
|
||||
bifVisible: m.bifDisplay.visible
|
||||
@@ -188,3 +189,16 @@ function TestSnapshot() as object
|
||||
barRemainingText: m.trickPlayBar.findNode("remainingLabel").text
|
||||
}
|
||||
end function
|
||||
|
||||
' TestWireQueueClose — make the stub videoQueue close the player when ClosePlayer writes closePlayer, mirroring
|
||||
' the real VideoQueue.OnClosePlayer (which sets player.close = true). Opt-in: only the finish-during-tick
|
||||
' re-entrancy spec needs the full synchronous teardown chain wired up.
|
||||
function TestWireQueueClose() as void
|
||||
m.videoQueue.observeFieldScoped("closePlayer", FuncName(OnTestQueueClose))
|
||||
end function
|
||||
|
||||
function OnTestQueueClose() as void
|
||||
if m.videoQueue.closePlayer
|
||||
m.top.close = true
|
||||
end if
|
||||
end function
|
||||
@@ -49,6 +49,7 @@
|
||||
<function name="TestKey" />
|
||||
<function name="TestSetState" />
|
||||
<function name="TestSnapshot" />
|
||||
<function name="TestWireQueueClose" />
|
||||
<function name="TestSetControl" />
|
||||
<function name="TestSetLive" />
|
||||
<function name="TestFireLiveBadgeHold" />
|
||||
|
||||
@@ -417,6 +417,35 @@ namespace Tests
|
||||
m.assertTrue(true, "no crash: the closed player ignored all post-close traffic")
|
||||
end function
|
||||
|
||||
' Crash #1 (store: the dominant OnPosition crash, &hf3 ERR_RO3 "interface not a member"): a finish
|
||||
' triggered from WITHIN a position tick re-enters teardown synchronously — EnforceTransportFreeze ->
|
||||
' FinishEof -> OnPlaybackFinished -> ClosePlayer -> the queue sets player.close -> OnClose drops
|
||||
' m.sponsorblock — then OnPosition continues to `m.sponsorblock.OnPosition()` and derefs the dropped
|
||||
' controller. (`m.sponsorblock` is a field, so the invalid deref is &hf3, not &hec.) The OLD code crashes
|
||||
' here; the onCloseCalled re-check after EnforceTransportFreeze bails. Kept LAST: OnClose detaches the node.
|
||||
@it("a finish during a position tick must not deref the dropped sponsorblock (the OnPosition ERR_RO3 crash)")
|
||||
function _()
|
||||
m.top.callFunc("TestWireQueueClose") ' the stub queue now closes the player on closePlayer, as the real one does
|
||||
m.top.duration = 100
|
||||
m.top.position = 90
|
||||
' scrub the cursor to the end (atEof) while the actual position is NOT yet at the end.
|
||||
for i = 0 to 8
|
||||
m.top.callFunc("TestKey", RemoteKeys.Right, true)
|
||||
m.top.callFunc("TestKey", RemoteKeys.Right, false)
|
||||
end for
|
||||
m.assertEqual(m.Snap().transportMode, TransportController.Mode.Scrub)
|
||||
' the device is PLAYING under the active transport (the INV-D1 anomaly EnforceTransportFreeze guards).
|
||||
' Position is not yet at EOF, so this is a normal re-freeze — NOT a finish.
|
||||
m.top.callFunc("TestSetState", VideoState.Playing)
|
||||
m.assertFalse(m.Snap().onCloseCalled, "not finished yet — the position is not at EOF")
|
||||
' NOW a position tick lands at the end -> OnPosition -> EnforceTransportFreeze -> FinishEof ->
|
||||
' OnPlaybackFinished -> ClosePlayer -> (re-entrant) OnClose drops m.sponsorblock -> OnPosition then
|
||||
' derefs the dropped controller. The old code faults here (&hf3); the fix bails first.
|
||||
m.top.position = 99
|
||||
' reaching here means OnPosition survived the re-entrant teardown.
|
||||
m.assertTrue(m.Snap().onCloseCalled, "the finish closed the player from within the position tick")
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
end namespace
|
||||
Reference in new issue
Block a user