Changeset 65779 in webkit
- Timestamp:
- Aug 21, 2010 11:40:01 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65778 r65779 1 2010-08-21 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Media engine should not be asked to open all urls 6 https://bugs.webkit.org/show_bug.cgi?id=44370 7 8 * media/video-source-none-supported-expected.txt: 9 * media/video-source-none-supported.html: 10 * media/video-source-type.html: 11 1 12 2010-08-21 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> 2 13 -
trunk/LayoutTests/media/video-source-none-supported-expected.txt
r63684 r65779 1 1 1. Test that no usable <source> element leaves the media element with networkState == NETWORK_NO_SOURCE 2 2 3 EVENT(error) 3 ++ ERROR, src = test.mp4, type = "audio/x-chicken-face" 4 4 EXPECTED (event.target.tagName == 'SOURCE') OK 5 EXPECTED (video.networkState == '3') OK 5 EXPECTED (event.target.parentNode.networkState > '1') OK 6 7 ++ ERROR, src = test.ogv, type = "video/x-higglety-pigglety" 8 EXPECTED (event.target.tagName == 'SOURCE') OK 9 EXPECTED (event.target.parentNode.networkState > '1') OK 10 11 ++ ERROR, src = doesnotexist.mp4, type = "" 12 EXPECTED (event.target.tagName == 'SOURCE') OK 13 EXPECTED (event.target.parentNode.networkState == '3') OK 14 6 15 END OF TEST 7 16 -
trunk/LayoutTests/media/video-source-none-supported.html
r53478 r65779 5 5 <script src=video-test.js></script> 6 6 <script> 7 7 8 function setup() 8 9 { 10 findMediaElement(); 9 11 document.addEventListener("error", errorEvent, true); 10 12 } … … 12 14 function errorEvent(evt) 13 15 { 14 consoleWrite("EVENT(error)"); 16 consoleWrite("++ ERROR, src = " + relativeURL(event.target.src) + ", type = \"" + event.target.type + "\""); 17 testExpected("event.target.tagName", "SOURCE", "=="); 18 19 // Any more source elements pending? 20 var nextSource = event.target.nextSibling; 21 while (video.hasChildNodes()) { 22 if (!nextSource || nextSource.tagName == "SOURCE") 23 break; 24 nextSource = nextSource.nextSibling; 25 } 15 26 16 testExpected("event.target.tagName", "SOURCE", "=="); 27 if (!nextSource) { 28 testExpected("event.target.parentNode.networkState", HTMLMediaElement.NETWORK_NO_SOURCE, "=="); 29 consoleWrite(""); 30 endTest(); 31 } else { 32 // Because the error event is fired asynchronously the network state can be either 33 // NETWORK_LOADING or NETWORK_NO_SOURCE, depending on whether or not 34 testExpected("event.target.parentNode.networkState", HTMLMediaElement.NETWORK_IDLE, ">"); 35 } 17 36 18 findMediaElement(); 19 testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_NO_SOURCE, "=="); 20 endTest(); 37 consoleWrite(""); 21 38 } 39 </script> 22 40 23 </script>24 41 </head> 25 42 <body> 26 <video controls><source src="doesnotexist.mp4"></video> 43 <video controls> 44 <source src="test.mp4" type="audio/x-chicken-face"> 45 <source src="test.ogv" type="video/x-higglety-pigglety"> 46 <source src="doesnotexist.mp4"> 47 </video> 27 48 28 49 <p>1. Test that no usable <source> element leaves the media element with -
trunk/LayoutTests/media/video-source-type.html
r48539 r65779 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title> <source> @type attribute</title> 5 6 <script src=media-file.js></script> 7 <script src=video-test.js></script> 8 <script> 9 function setup() 10 { 11 video = mediaElement = document.getElementsByTagName('video')[0]; 12 13 waitForEvent("loadstart", function () { 14 testExpected("relativeURL(video.currentSrc) ", findMediaFile("video", "content/test")); 15 endTest(); 16 }); 17 } 18 </script> 19 </head> 1 20 <body> 2 <script src=media-file.js></script> 3 <script src=video-test.js></script> 4 <video controls> 5 <source src=content/error.mpeg type=video/blahblah> 6 <source src=content/test.mp4 type=video/mpeg> 7 <source src=content/test.ogv type=video/ogg> 8 <source src=content/error2.mpeg type=video/mpeg> 9 </video> 10 <script> 11 video = mediaElement = document.getElementsByTagName('video')[0]; 12 13 waitForEvent("loadstart", function () { 14 testExpected("relativeURL(video.currentSrc) ", findMediaFile("video", "content/test")); 15 endTest(); 16 }); 17 </script> 21 <video controls> 22 <source src=content/error.mpeg type=video/blahblah> 23 <source src=test.mp4 type=video/x-chicken-face> 24 <source src=test.ogv type=audio/x-higglety-pigglety> 25 <source src=content/test.mp4 type=video/mpeg> 26 <source src=content/test.ogv type=video/ogg> 27 <source src=content/error2.mpeg type=video/mpeg> 28 </video> 29 <script>setup();</script> 30 </body> 31 </html> -
trunk/WebCore/ChangeLog
r65776 r65779 1 2010-08-21 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Media engine should not be asked to open all urls 6 https://bugs.webkit.org/show_bug.cgi?id=44370 7 8 * platform/graphics/MediaPlayer.cpp: 9 (WebCore::MediaPlayer::load): Do nothing with urls with a type attribute that would be 10 rejected by canPlayType(). 11 1 12 2010-08-21 Ariya Hidayat <ariya@sencha.com> 2 13 -
trunk/WebCore/platform/graphics/MediaPlayer.cpp
r65758 r65779 292 292 engine = chooseBestEngineForTypeAndCodecs(type, typeCodecs); 293 293 294 // if we didn't find an engine that claims the MIME type, just use the first engine295 if (!engine && !installedMediaEngines().isEmpty())294 // If we didn't find an engine and no MIME type is specified, just use the first engine. 295 if (!engine && type.isEmpty() && !installedMediaEngines().isEmpty()) 296 296 engine = installedMediaEngines()[0]; 297 297 298 // don't delete and recreate the player unless it comes from a different engine 299 if (engine && m_currentMediaEngine != engine) { 298 // Don't delete and recreate the player unless it comes from a different engine 299 if (!engine) { 300 m_currentMediaEngine = engine; 301 m_private.clear(); 302 } else if (m_currentMediaEngine != engine) { 300 303 m_currentMediaEngine = engine; 301 304 m_private.clear();
Note: See TracChangeset
for help on using the changeset viewer.