Title: [213514] trunk
Revision
213514
Author
[email protected]
Date
2017-03-07 08:23:30 -0800 (Tue, 07 Mar 2017)

Log Message

[Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
https://bugs.webkit.org/show_bug.cgi?id=169280
<rdar://problem/30876078>

Patch by Antoine Quint <[email protected]> on 2017-03-07
Reviewed by Jon Lee.

Source/WebCore:

We need to track when a new load start to see if we might have recovered from an error
and hide the "invalid" placard.

Test: media/modern-media-controls/placard-support/placard-support-error-recover.html

* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents):

LayoutTests:

Add a new test that checks that we know to remove the "invalid" placard if a new source is
set and media starts loading again.

* media/modern-media-controls/placard-support/placard-support-error-recover-expected.txt: Added.
* media/modern-media-controls/placard-support/placard-support-error-recover.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (213513 => 213514)


--- trunk/LayoutTests/ChangeLog	2017-03-07 14:45:42 UTC (rev 213513)
+++ trunk/LayoutTests/ChangeLog	2017-03-07 16:23:30 UTC (rev 213514)
@@ -1,3 +1,17 @@
+2017-03-07  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
+        https://bugs.webkit.org/show_bug.cgi?id=169280
+        <rdar://problem/30876078>
+
+        Reviewed by Jon Lee.
+
+        Add a new test that checks that we know to remove the "invalid" placard if a new source is
+        set and media starts loading again.
+
+        * media/modern-media-controls/placard-support/placard-support-error-recover-expected.txt: Added.
+        * media/modern-media-controls/placard-support/placard-support-error-recover.html: Added.
+
 2017-03-07  Carlos Alberto Lopez Perez  <[email protected]>
 
         [GTK] Mark media/video-buffered.html as flaky.

Added: trunk/LayoutTests/media/modern-media-controls/placard-support/placard-support-error-recover-expected.txt (0 => 213514)


--- trunk/LayoutTests/media/modern-media-controls/placard-support/placard-support-error-recover-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/placard-support/placard-support-error-recover-expected.txt	2017-03-07 16:23:30 UTC (rev 213514)
@@ -0,0 +1,13 @@
+Testing the PlacardSupport behavior when we recover from an error.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS mediaController.controls.showsPlacard is true
+PASS mediaController.controls.children.includes(mediaController.controls.invalidPlacard) is true
+PASS mediaController.controls.showsPlacard is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/media/modern-media-controls/placard-support/placard-support-error-recover.html (0 => 213514)


--- trunk/LayoutTests/media/modern-media-controls/placard-support/placard-support-error-recover.html	                        (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/placard-support/placard-support-error-recover.html	2017-03-07 16:23:30 UTC (rev 213514)
@@ -0,0 +1,33 @@
+<script src=""
+<script src="" type="text/_javascript_"></script>
+<body>
+<video src="" style="width: 320px; height: 240px;"></video>
+<div id="shadow"></div>
+<script type="text/_javascript_">
+
+window.jsTestIsAsync = true;
+
+description("Testing the <code>PlacardSupport</code> behavior when we recover from an error.");
+
+const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
+const media = document.querySelector("video");
+const mediaController = createControls(shadowRoot, media, null);
+
+media.addEventListener("error", () => {
+    shouldBeTrue("mediaController.controls.showsPlacard");
+    shouldBeTrue("mediaController.controls.children.includes(mediaController.controls.invalidPlacard)");
+
+    media.addEventListener("loadstart", () => {
+        shouldBeFalse("mediaController.controls.showsPlacard");
+        debug("");
+        shadowRoot.host.remove();
+        media.remove();
+        finishJSTest();
+    });
+
+    media.src = ""
+});
+
+</script>
+<script src=""
+</body>

Modified: trunk/Source/WebCore/ChangeLog (213513 => 213514)


--- trunk/Source/WebCore/ChangeLog	2017-03-07 14:45:42 UTC (rev 213513)
+++ trunk/Source/WebCore/ChangeLog	2017-03-07 16:23:30 UTC (rev 213514)
@@ -1,3 +1,19 @@
+2017-03-07  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
+        https://bugs.webkit.org/show_bug.cgi?id=169280
+        <rdar://problem/30876078>
+
+        Reviewed by Jon Lee.
+
+        We need to track when a new load start to see if we might have recovered from an error
+        and hide the "invalid" placard.
+
+        Test: media/modern-media-controls/placard-support/placard-support-error-recover.html
+
+        * Modules/modern-media-controls/media/placard-support.js:
+        (PlacardSupport.prototype.get mediaEvents):
+
 2017-03-07  Andy Estes  <[email protected]>
 
         REGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js (213513 => 213514)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js	2017-03-07 14:45:42 UTC (rev 213513)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js	2017-03-07 16:23:30 UTC (rev 213514)
@@ -36,7 +36,7 @@
 
     get mediaEvents()
     {
-        return ["error", "webkitpresentationmodechanged", "webkitcurrentplaybacktargetiswirelesschanged"];
+        return ["loadstart", "error", "webkitpresentationmodechanged", "webkitcurrentplaybacktargetiswirelesschanged"];
     }
 
     handleEvent(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to