Unreviewed, rolling out r219700.
authorjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jul 2017 01:23:19 +0000 (01:23 +0000)
committerjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jul 2017 01:23:19 +0000 (01:23 +0000)
This revision caused consistent timouts on iOS.

Reverted changeset:

"Turn tests at media/modern-media-controls/start-support back
on"
https://bugs.webkit.org/show_bug.cgi?id=174683
http://trac.webkit.org/changeset/219700

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

LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/start-support/start-support-click-to-start-expected.txt
LayoutTests/media/modern-media-controls/start-support/start-support-click-to-start.html
LayoutTests/media/modern-media-controls/start-support/start-support-fullscreen.html
LayoutTests/media/modern-media-controls/start-support/start-support-lowPowerMode-expected.txt
LayoutTests/media/modern-media-controls/start-support/start-support-lowPowerMode.html
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js

index 0f41c4ce14efe89520c8037e48fdc31332fc3dbb..f9f4a4365b707387bb009cc804138eab117e5035 100644 (file)
@@ -1,3 +1,16 @@
+2017-07-20  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r219700.
+
+        This revision caused consistent timouts on iOS.
+
+        Reverted changeset:
+
+        "Turn tests at media/modern-media-controls/start-support back
+        on"
+        https://bugs.webkit.org/show_bug.cgi?id=174683
+        http://trac.webkit.org/changeset/219700
+
 2017-07-20  Chris Dumez  <cdumez@apple.com>
 
         Drop legacy XPathException type
index 2cd2783c01e41d61fbd7dad0cfc5dda159586263..0c45eec78800c00264312254b6b3fc171d025ea8 100644 (file)
@@ -6,7 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS mediaController.controls.showsStartButton is true
 
 Pressing on the start button
-PASS mediaController.controls.playPauseButton.element.getBoundingClientRect().width became different from 0
 Media is playing
 PASS mediaController.controls.showsStartButton is false
 
index dd8abd33d300b84c0bcd88448eddbf48045e04f4..958539c9e8dec8b889b64ded44f145582d1e8132 100644 (file)
@@ -2,43 +2,30 @@
 <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;
-        width: 800px;
-        height: 600px;
-    }
-    
-</style>
-<video src="../../content/test.mp4" controls></video>
-<div id="host"></div>
+<video src="../../content/test.mp4" style="width: 320px; height: 240px;" controls></video>
+<div id="shadow"></div>
 <script type="text/javascript">
 
 window.jsTestIsAsync = true;
 
 description("Testing the <code>MediaController</code> click-to-start behavior.");
 
-const host = document.querySelector("div#host");
+const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
 const media = document.querySelector("video");
-const mediaController = createControls(host, media, null);
+const mediaController = createControls(shadowRoot, media, null);
 
 media.addEventListener("loadedmetadata", function() {
     shouldBeTrue("mediaController.controls.showsStartButton");
     debug("");
     debug("Pressing on the start button");
-    shouldBecomeDifferent("mediaController.controls.playPauseButton.element.getBoundingClientRect().width", "0", () => {
-        pressOnElement(mediaController.controls.playPauseButton.element)
-    });
+    window.requestAnimationFrame(() => pressOnElement(mediaController.controls.startButton.element));
 });
 
 media.addEventListener("play", function() {
     debug("Media is playing");
     shouldBeFalse("mediaController.controls.showsStartButton");
     debug("");
-    host.remove();
+    shadowRoot.host.remove();
     media.remove();
     finishJSTest();
 });
index 75e8731ce9a2af1cf5b311e6779fb10a8b4ed4e9..b2d999fcb77afa0c0ed94c1438d930c9c1516e43 100644 (file)
@@ -1,32 +1,19 @@
 <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;
-        width: 320px;
-        height: 240px;
-    }
-    
-</style>
-<video src="../../content/test.mp4"></video>
-<div id="host"></div>
+<video src="../../content/test.mp4" style="width: 320px; height: 240px;"></video>
+<div id="shadow"></div>
 <script type="text/javascript">
 
 window.jsTestIsAsync = true;
 
 description("Testing the <code>StartSupport</code> behavior with no source.");
 
-const host = document.querySelector("div#host");
+const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
 const media = document.querySelector("video");
-const mediaController = createControls(host, media, null);
+const mediaController = createControls(shadowRoot, media, null);
 
-const button = document.body.appendChild(document.createElement("div"));
-button.textContent = "Enter Fullscreen";
+const button = document.body.appendChild(document.createElement("button"));
 button.addEventListener("click", event => {
     try {
         media.webkitEnterFullscreen();
@@ -40,13 +27,21 @@ media.addEventListener("webkitfullscreenchange", function() {
     debug("Media entered fullscreen");
     shouldBeFalse("mediaController.controls.showsStartButton");
     debug("");
-    host.remove();
+    shadowRoot.host.remove();
     media.remove();
     button.remove();
     finishJSTest();
 });
 
-media.addEventListener("loadedmetadata", event => pressOnElement(button));
+media.addEventListener("loadedmetadata", event => {
+    if ("eventSender" in window) {
+        // Click the button so that we may enter fullscreen.
+        eventSender.mouseMoveTo(button.offsetLeft + 1, button.offsetTop + 1);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    } else
+        debug("This test is designed to run in DRT");
+});
 
 </script>
 <script src="../../../resources/js-test-post.js"></script>
index 9d31466ac4ef83d5499d884bf75925285500f6d5..88886c5d1d954e03eca0d166016db9c815d71740 100644 (file)
@@ -4,12 +4,12 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 Received 'canplaythrough' event
-PASS !!internals.shadowRoot(media).querySelector('button.play-pause.center') became true
+PASS !!internals.shadowRoot(media).querySelector('button.start') became true
 PASS media.controls is false
 Pressing on the start button
 Received 'play' event
 PASS media.controls is false
-PASS internals.shadowRoot(media).querySelector('button.play-pause.center') became null
+PASS internals.shadowRoot(media).querySelector('button.start') became null
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 58e17f1677948c898d71679ab6302be4dc25418b..6e6b89807b8f086b455bb263aef2e3c388a2007a 100644 (file)
@@ -26,12 +26,12 @@ function endTest()
 media.addEventListener("canplaythrough", function() {
     debug("Received 'canplaythrough' event");
     // We should display the start button since we denied autoplay and the user needs a way to start playback.
-    shouldBecomeEqual("!!internals.shadowRoot(media).querySelector('button.play-pause.center')", "true", function() {
+    shouldBecomeEqual("!!internals.shadowRoot(media).querySelector('button.start')", "true", function() {
         shouldBeFalse("media.controls");
 
         debug("Pressing on the start button");
         hasUserGesture = true;
-        pressOnElement(internals.shadowRoot(media).querySelector('button.play-pause.center'));
+        pressOnElement(internals.shadowRoot(media).querySelector('button.start'));
     });
 });
 
@@ -39,7 +39,7 @@ media.addEventListener("play", function() {
     debug("Received 'play' event");
     shouldBeFalse("media.controls");
     if (hasUserGesture) {
-        shouldBecomeEqual("internals.shadowRoot(media).querySelector('button.play-pause.center')", "null", endTest);
+        shouldBecomeEqual("internals.shadowRoot(media).querySelector('button.start')", "null", endTest);
     } else {
         testFailed("Media started playing without user interaction");
         endTest();
index 78a7e1dc797a12ba5327900d5d910fd750dce01b..da4e8b99a58b748b655d46965d78b749282a1e81 100644 (file)
@@ -100,7 +100,6 @@ media/modern-media-controls/scrubber-support [ Pass ]
 media/modern-media-controls/skip-back-button [ Pass ]
 media/modern-media-controls/skip-forward-button [ Pass ]
 media/modern-media-controls/slider [ Pass ]
-media/modern-media-controls/start-support [ Pass ]
 media/modern-media-controls/status-label [ Pass ]
 media/modern-media-controls/time-control [ Pass ]
 media/modern-media-controls/time-label [ Pass ]
@@ -119,14 +118,12 @@ media/modern-media-controls/mute-support/mute-support-press-on-button.html [ Ski
 media/modern-media-controls/pip-support/ipad/pip-support-tap.html [ Skip ]
 media/modern-media-controls/placard-support/ipad [ Skip ]
 media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html [ Skip ]
-media/modern-media-controls/start-support/start-support-click-to-start.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 ]
 media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html [ Skip ]
 media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html [ Skip ]
 media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html [ Skip ]
-media/modern-media-controls/start-support/start-support-fullscreen.html [ Skip ]
 
 # These tests specifically test iOS-only media controls features
 media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding.html [ Pass ]
index 38f1472404d148f3ce694b381aad7b58ecbbc9d3..d31a94fb71168a78404fcbb5e3ae0a0df3bc2df9 100644 (file)
@@ -1581,7 +1581,6 @@ media/modern-media-controls/scrubber-support [ Pass ]
 media/modern-media-controls/skip-back-button [ Pass ]
 media/modern-media-controls/skip-forward-button [ Pass ]
 media/modern-media-controls/slider [ Pass ]
-media/modern-media-controls/start-support [ Pass ]
 media/modern-media-controls/status-label [ Pass ]
 media/modern-media-controls/time-control [ Pass ]
 media/modern-media-controls/time-label [ Pass ]
index 6c2a475cdc45b38aa4cfaaf93216ab6ffb446a08..cee5bce3b3332de4d94163665f2543e2a459a8e8 100644 (file)
@@ -1,3 +1,16 @@
+2017-07-20  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r219700.
+
+        This revision caused consistent timouts on iOS.
+
+        Reverted changeset:
+
+        "Turn tests at media/modern-media-controls/start-support back
+        on"
+        https://bugs.webkit.org/show_bug.cgi?id=174683
+        http://trac.webkit.org/changeset/219700
+
 2017-07-20  David Quesada  <david_quesada@apple.com>
 
         Add SPI to notify WKNavigationDelegate about client redirects
index 22530c72603a5904342bfc10bf0c588972af595c..3bae7a91c0ab20c5fd8db940dcf66616f5844d4a 100644 (file)
@@ -118,12 +118,6 @@ class InlineMediaControls extends MediaControls
             return;
         }
 
-        if (!this.bottomControlsBar)
-            return;
-
-        this.leftContainer.buttons = this._leftContainerButtons();
-        this.rightContainer.buttons = this._rightContainerButtons();
-
         // If we should show the start button, then only show that button.
         if (this._showsStartButton) {
             this.playPauseButton.style = this.width <= MaximumSizeToShowSmallProminentControl || this.height <= MaximumSizeToShowSmallProminentControl ? Button.Styles.SmallCenter : Button.Styles.Center;
@@ -131,6 +125,9 @@ class InlineMediaControls extends MediaControls
             return;
         }
 
+        if (!this.bottomControlsBar)
+            return;
+
         // Update the top left controls bar.
         this._topLeftControlsBarContainer.buttons = this._topLeftContainerButtons();
         this._topLeftControlsBarContainer.layout();
@@ -163,6 +160,8 @@ class InlineMediaControls extends MediaControls
         // Iterate through controls to see if we need to drop any of them. Reset all default states before we proceed.
         this.bottomControlsBar.visible = true;
         this.playPauseButton.style = Button.Styles.Bar;
+        this.leftContainer.buttons = this._leftContainerButtons();
+        this.rightContainer.buttons = this._rightContainerButtons();
         this.rightContainer.buttons.concat(this.leftContainer.buttons).forEach(button => delete button.dropped);
         this.muteButton.style = this.preferredMuteButtonStyle;
         this.muteButton.usesRTLIconVariant = false;
@@ -248,8 +247,6 @@ class InlineMediaControls extends MediaControls
 
     _leftContainerButtons()
     {
-        if (this._showsStartButton)
-            return [this.skipBackButton, this.skipForwardButton];
         return [this.skipBackButton, this.playPauseButton, this.skipForwardButton];
     }