Rebaseline media/modern-media-controls/fullscreen-support
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 01:03:31 +0000 (01:03 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 01:03:31 +0000 (01:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173199

Reviewed by Simon Fraser.

Source/WebCore:

Test: media/modern-media-controls/fullscreen-support/fullscreen-support-press.html

We no longer need to track the "error" event for FullscreenSupport since we don't actually
enable or disable the fullscreen button when an error happens, instead the media controls
code will simply not present it since we'll be showing a placard instead.

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

LayoutTests:

We no longer need to test the "error" event for FullscreenSupport since we don't actually
enable or disable the fullscreen button when an error happens, instead the media controls
code will simply not present it since we'll be showing a placard instead.

We also remove the iPad-specific test since the fullscreen button is now accessible on an
iPhone as well, so it no longer needs a special iPad test.

* media/modern-media-controls/fullscreen-support/fullscreen-support-enabled-expected.txt:
* media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html:
* media/modern-media-controls/fullscreen-support/fullscreen-support-press-expected.txt: Renamed from LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click-expected.txt.
* media/modern-media-controls/fullscreen-support/fullscreen-support-press.html: Renamed from LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click.html.
* media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap-expected.txt: Removed.
* media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html: Removed.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-enabled-expected.txt
LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html
LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-press-expected.txt [moved from LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click-expected.txt with 100% similarity]
LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-press.html [moved from LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click.html with 91% similarity]
LayoutTests/media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap-expected.txt [deleted file]
LayoutTests/media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html [deleted file]
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js

index c5de8aa..c4fa753 100644 (file)
@@ -1,3 +1,26 @@
+2017-06-11  Antoine Quint  <graouts@apple.com>
+
+        Rebaseline media/modern-media-controls/fullscreen-support
+        https://bugs.webkit.org/show_bug.cgi?id=173199
+
+        Reviewed by Simon Fraser.
+
+        We no longer need to test the "error" event for FullscreenSupport since we don't actually
+        enable or disable the fullscreen button when an error happens, instead the media controls
+        code will simply not present it since we'll be showing a placard instead.
+        
+        We also remove the iPad-specific test since the fullscreen button is now accessible on an
+        iPhone as well, so it no longer needs a special iPad test.
+
+        * media/modern-media-controls/fullscreen-support/fullscreen-support-enabled-expected.txt:
+        * media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html:
+        * media/modern-media-controls/fullscreen-support/fullscreen-support-press-expected.txt: Renamed from LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click-expected.txt.
+        * media/modern-media-controls/fullscreen-support/fullscreen-support-press.html: Renamed from LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-click.html.
+        * media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap-expected.txt: Removed.
+        * media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html: Removed.
+        * platform/ios-simulator/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2017-06-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Fix linter warnings on the GTK Debug TestExpectation file and update some expectations for Debug.
index 1cbd881..a0d421e 100644 (file)
@@ -6,9 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 Once media loads and we have tracks in the video, the fullscreen button should become enabled
 PASS mediaController.controls.fullscreenButton.enabled became true
 
-We now set the media source to be the empty string to force an error, which should disable the fullscreen button
-PASS mediaController.controls.fullscreenButton.enabled is false
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 7cdd199..974de78 100644 (file)
@@ -29,16 +29,10 @@ const mediaController = createControls(container, media, null);
 
 debug("Once media loads and we have tracks in the video, the fullscreen button should become enabled");
 shouldBecomeEqual("mediaController.controls.fullscreenButton.enabled", "true", () => {
-    media.addEventListener("error", () => {
-        shouldBeFalse("mediaController.controls.fullscreenButton.enabled");
-        debug("");
-        container.remove();
-        media.remove();
-        finishJSTest();
-    });
     debug("");
-    debug("We now set the media source to be the empty string to force an error, which should disable the fullscreen button");
-    media.src = "";
+    container.remove();
+    media.remove();
+    finishJSTest();
 });
 
 </script>
@@ -38,7 +38,7 @@ scheduler.frameDidFire = function() {
     scheduler.frameDidFire = null;
 };
 
-media.addEventListener("webkitfullscreenchange", () => {
+media.addEventListener(media.webkitPresentationMode ? "webkitpresentationmodechanged" : "webkitfullscreenchange", () => {
     shouldBeTrue("media.webkitDisplayingFullscreen");
     container.remove();
     media.remove();
diff --git a/LayoutTests/media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap-expected.txt b/LayoutTests/media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap-expected.txt
deleted file mode 100644 (file)
index 809e449..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Testing the FullscreenSupport behavior when tapping the fullscreen button.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS media.webkitDisplayingFullscreen is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html b/LayoutTests/media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
deleted file mode 100644 (file)
index 0aaa54d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<script src="../../../../resources/js-test-pre.js"></script>
-<script src="../../resources/media-controls-loader.js" type="text/javascript"></script>
-<script src="../../resources/media-controls-utils.js" type="text/javascript"></script>
-<body>
-<style type="text/css" media="screen">
-    
-    video, #host {
-        position: absolute;
-        top: 0;
-        left: 0;
-    }
-
-    video {
-        width: 768px;
-        height: 240px;
-    }
-    
-</style>
-<video src="../../../content/test.mp4" autoplay controls></video>
-<div id="host"></div>
-<script type="text/javascript">
-
-window.jsTestIsAsync = true;
-
-description("Testing the <code>FullscreenSupport</code> behavior when tapping the fullscreen button.");
-
-const container = document.querySelector("div#host");
-const media = document.querySelector("video");
-const mediaController = createControls(container, media, null);
-
-media.addEventListener("webkitpresentationmodechanged", () => {
-    if (media.webkitDisplayingFullscreen) {
-        shouldBeTrue("media.webkitDisplayingFullscreen");
-        media.webkitExitFullscreen();
-    } else {
-        // We're giving the test time to finish the animation to exit fullscreen
-        // so that we are in a clean state for the next test.
-        setTimeout(() => {
-            container.remove();
-            media.remove();
-            finishJSTest();
-        }, 1000);
-    }
-});
-
-scheduler.frameDidFire = function() {
-    if (media.paused)
-        return;
-
-    if (pressOnElement(mediaController.controls.fullscreenButton.element))
-        scheduler.frameDidFire = null;
-};
-
-</script>
-<script src="../../../../resources/js-test-post.js"></script>
-</body>
index d7fc9d0..242af2d 100644 (file)
@@ -75,6 +75,7 @@ media/modern-media-controls/buttons-container [ Pass ]
 media/modern-media-controls/controls-visibility-support [ Pass ]
 media/modern-media-controls/forward-button [ Pass ]
 media/modern-media-controls/fullscreen-button [ Pass ]
+media/modern-media-controls/fullscreen-support [ Pass ]
 media/modern-media-controls/icon-service [ Pass ]
 media/modern-media-controls/invalid-placard [ Pass ]
 media/modern-media-controls/layout-item [ Pass ]
@@ -96,6 +97,7 @@ webkit.org/b/166062 media/modern-media-controls/audio/audio-controls-buttons.htm
 # These tests use touch events and don't work in OpenSource
 media/modern-media-controls/button/button.html [ Skip ]
 media/modern-media-controls/button/button-active-state.html [ Skip ]
+media/modern-media-controls/fullscreen-support/fullscreen-support-press.html [ Skip ]
 
 # These tests rely on fullscreen which do not use the WebKit media controls on iOS
 media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-parent-element.html [ Skip ]
index 64ad7b1..cc4eba2 100644 (file)
@@ -1555,6 +1555,7 @@ media/modern-media-controls/buttons-container [ Pass ]
 media/modern-media-controls/controls-visibility-support [ Pass ]
 media/modern-media-controls/forward-button [ Pass ]
 media/modern-media-controls/fullscreen-button [ Pass ]
+media/modern-media-controls/fullscreen-support [ Pass ]
 media/modern-media-controls/icon-service [ Pass ]
 media/modern-media-controls/invalid-placard [ Pass ]
 media/modern-media-controls/layout-item [ Pass ]
index 541cb68..e79c757 100644 (file)
@@ -1,3 +1,19 @@
+2017-06-11  Antoine Quint  <graouts@apple.com>
+
+        Rebaseline media/modern-media-controls/fullscreen-support
+        https://bugs.webkit.org/show_bug.cgi?id=173199
+
+        Reviewed by Simon Fraser.
+
+        Test: media/modern-media-controls/fullscreen-support/fullscreen-support-press.html
+
+        We no longer need to track the "error" event for FullscreenSupport since we don't actually
+        enable or disable the fullscreen button when an error happens, instead the media controls
+        code will simply not present it since we'll be showing a placard instead.
+
+        * Modules/modern-media-controls/media/fullscreen-support.js:
+        (FullscreenSupport.prototype.get mediaEvents):
+
 2017-06-13  Matt Rajca  <mrajca@apple.com>
 
         WebsitePolicies: let clients select specific autoplay quirks
index 3cc3fd4..e7e4c8b 100644 (file)
@@ -35,7 +35,7 @@ class FullscreenSupport extends MediaControllerSupport
 
     get mediaEvents()
     {
-        return ["loadedmetadata", "error"];
+        return ["loadedmetadata"];
     }
 
     get tracksToMonitor()