https://bugs.webkit.org/show_bug.cgi?id=124898
Reviewed by Dan Bernstein.
Source/WebCore:
Test: media/video-currentsrc-cleared.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad): Set m_currentSrc to empty in
preparation for attempting to load a new url.
LayoutTests:
* media/video-currentsrc-cleared-expected.txt: Added.
* media/video-currentsrc-cleared.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159789
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-11-26 Eric Carlson <eric.carlson@apple.com>
+
+ video.currentSrc should return empty when no resource is loaded
+ https://bugs.webkit.org/show_bug.cgi?id=124898
+
+ Reviewed by Dan Bernstein.
+
+ * media/video-currentsrc-cleared-expected.txt: Added.
+ * media/video-currentsrc-cleared.html: Added.
+
2013-11-26 Hans Muller <hmuller@adobe.com>
[CSS Shapes] Support for shape-margin in BoxShape
--- /dev/null
+
+Check that 'currentsrc' is cleared when there is no media resource.
+
+EVENT(canplaythrough)
+EXPECTED (video.currentSrc.indexOf("content/test") > '-1') OK
+RUN(video.src = "")
+
+EVENT(error)
+EXPECTED (video.currentSrc == '') OK
+
+END OF TEST
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=media-file.js></script>
+ <script src=video-test.js></script>
+ <script>
+ function error()
+ {
+ testExpected('video.currentSrc', '');
+ consoleWrite('');
+ endTest();
+ }
+
+ function canplaythrough()
+ {
+ testExpected('video.currentSrc.indexOf("content/test")', -1, '>');
+ run('video.src = ""');
+ consoleWrite('');
+ }
+
+ function start()
+ {
+ findMediaElement();
+ waitForEvent('error', error);
+ waitForEvent('canplaythrough', canplaythrough);
+ video.src = findMediaFile("video", "content/test");
+ }
+ </script>
+ </head>
+ <body onload="start()">
+ <video ></video>
+ <p>Check that 'currentsrc' is cleared when there is no media resource.</p>
+ </body>
+</html>
+2013-11-26 Eric Carlson <eric.carlson@apple.com>
+
+ video.currentSrc should return empty when no resource is loaded
+ https://bugs.webkit.org/show_bug.cgi?id=124898
+
+ Reviewed by Dan Bernstein.
+
+ Test: media/video-currentsrc-cleared.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::prepareForLoad): Set m_currentSrc to empty in
+ preparation for attempting to load a new url.
+
2013-11-26 Hans Muller <hmuller@adobe.com>
[CSS Shapes] Support for shape-margin in BoxShape
m_completelyLoaded = false;
m_havePreparedToPlay = false;
m_displayMode = Unknown;
+ m_currentSrc = URL();
// 1 - Abort any already-running instance of the resource selection algorithm for this element.
m_loadState = WaitingForSource;