Bug 115045

Summary: [Mac] media/track/track-mode.html sometimes trigger InvalidStateError
Product: WebKit Reporter: Jessie Berlin <jberlin>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, jer.noble, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch none

Description Jessie Berlin 2013-04-23 10:40:12 PDT
I have seen this happen with a couple different media/track tests.

http://build.webkit.org/results/Apple%20MountainLion%20Debug%20WK2%20(Tests)/r148970%20(9125)/media/track/track-mode-diff.txt

--- /Volumes/Data/slave/mountainlion-debug-tests-wk2/build/layout-test-results/media/track/track-mode-expected.txt
+++ /Volumes/Data/slave/mountainlion-debug-tests-wk2/build/layout-test-results/media/track/track-mode-actual.txt
@@ -1,39 +1,3 @@
-Tests that the TextTrack mode attribute is appropriately set.
+CONSOLE MESSAGE: line 59: InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
+FAIL: Timed out waiting for notifyDone to be called
 
-
-++ Test default attribute value
-EXPECTED (textTrack.mode == 'showing') OK
-EXPECTED (video.textTracks[0].mode == 'showing') OK
-
-*** Set to bogus value, should return default
-RUN(textTrack.mode = 'bogus')
-EXPECTED (textTrack.mode == 'showing') OK
-EXPECTED (video.textTracks[0].mode == 'showing') OK
-
-*** Set to known values
-++ 'disabled'
-RUN(textTrack.mode = 'disabled')
-EXPECTED (textTrack.mode == 'disabled') OK
-EXPECTED (video.textTracks[0].mode == 'disabled') OK
-EXPECTED (textTrack.cues == 'null') OK
-
-++ 0 events expected while mode = disabled
-
-++ 'hidden'
-RUN(textTrack.mode = 'hidden')
-EXPECTED (textTrack.mode == 'hidden') OK
-EXPECTED (video.textTracks[0].mode == 'hidden') OK
-EXPECTED (textTrack.cues.length == '3') OK
-
-++ 'showing'
-RUN(textTrack.mode = 'showing')
-EXPECTED (textTrack.mode == 'showing') OK
-EXPECTED (video.textTracks[0].mode == 'showing') OK
-EXPECTED (textTrack.cues.length == '3') OK
-
-++ at least 3 events expected while mode = showing
-EVENT(cuechange)
-EVENT(cuechange)
-EVENT(cuechange)
-END OF TEST
-
Comment 1 Radar WebKit Bug Importer 2013-04-23 10:40:37 PDT
<rdar://problem/13717711>
Comment 2 Eric Carlson 2013-04-24 07:28:45 PDT
+CONSOLE MESSAGE: line 59: InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.

This happens because the currentTime attribute is being set before the video element is ready. This happens because the test does this after a hard-coded delay instead of waiting for an event.
Comment 3 Eric Carlson 2013-04-24 07:41:19 PDT
Lets us this bug for the fixes to track-mode.html. Please file additional bugs for other failures.
Comment 4 Eric Carlson 2013-04-24 07:44:33 PDT
Created attachment 199453 [details]
Proposed patch
Comment 5 WebKit Commit Bot 2013-04-26 11:09:37 PDT
Comment on attachment 199453 [details]
Proposed patch

Clearing flags on attachment: 199453

Committed r149197: <http://trac.webkit.org/changeset/149197>
Comment 6 WebKit Commit Bot 2013-04-26 11:09:39 PDT
All reviewed patches have been landed.  Closing bug.