To reproduce: 1. Download the attached test to LayoutTests/media 2. run-webkit-tests media/media-no-source.html The test times out because the error event is never fired. HTML5 says we should fire an error event. See <http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#concept-media-load-algorithm> step 6.10: > Failed: Queue a task to fire a simple event named error at the > candidate element, in the context of the fetching process that > was used to try to obtain candidate's corresponding media > resource in the resource fetch algorithm. Note that the error event *does* fire for <video src=doesnotexist.mp4></video>
<rdar://problem/7547649>
I think we need to fire the event here <http://trac.webkit.org/browser/trunk/WebCore/html/HTMLMediaElement.cpp?rev=53146#L692>: // If we failed while trying to load a <source> element, the movie was never parsed, and there are more // <source> children, schedule the next one if (m_readyState < HAVE_METADATA && m_loadState == LoadingFromSourceElement) { m_currentSourceNode->scheduleErrorEvent(); if (havePotentialSourceChild()) scheduleNextSourceChild(); return; }
This seems related to bug 33744.
Looks like you forgot to attach the test case.
Created attachment 46816 [details] test case
This test is incorrect as the event listener is on the <video> element but 'error' events don't bubble. Attach the listener to the document or source element and it will be triggered.