Stop media/video-controls-toggling.html from timing out.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Aug 2017 22:17:24 +0000 (22:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Aug 2017 22:17:24 +0000 (22:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116266

Patch by Ms2ger <Ms2ger@gmail.com> on 2017-08-21
Reviewed by Dean Jackson.

Use getComputedStyle to check the display property. Element::style only
contains properties set in the style attribute, but the display property
is set through CSS using the 'hidden' class.

* media/video-controls-toggling-expected.txt:
* media/video-controls-toggling.html:
* platform/gtk/TestExpectations:
* platform/gtk/media/video-controls-toggling-expected.txt:
  Copied from LayoutTests/media/video-controls-toggling-expected.txt.
  I'm not sure where the console message comes from, but it seems to
  be in the GTK-specific code.

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

LayoutTests/ChangeLog
LayoutTests/media/video-controls-toggling-expected.txt
LayoutTests/media/video-controls-toggling.html
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/media/video-controls-toggling-expected.txt [new file with mode: 0644]

index 47138f0691d9ad8bc8ca31f762bad8ea04eda350..7a06d851b697faf7c174c4d99fda84bc12fb4a0d 100644 (file)
@@ -1,3 +1,22 @@
+2017-08-21  Ms2ger  <Ms2ger@gmail.com>
+
+        Stop media/video-controls-toggling.html from timing out.
+        https://bugs.webkit.org/show_bug.cgi?id=116266
+
+        Reviewed by Dean Jackson.
+
+        Use getComputedStyle to check the display property. Element::style only
+        contains properties set in the style attribute, but the display property
+        is set through CSS using the 'hidden' class.
+
+        * media/video-controls-toggling-expected.txt:
+        * media/video-controls-toggling.html:
+        * platform/gtk/TestExpectations:
+        * platform/gtk/media/video-controls-toggling-expected.txt:
+          Copied from LayoutTests/media/video-controls-toggling-expected.txt.
+          I'm not sure where the console message comes from, but it seems to
+          be in the GTK-specific code.
+
 2017-08-21  Dean Jackson  <dino@apple.com>
 
         Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported" in Safari 10.1.2
index 8b890290514a32b35169883931c33f65527127b5..04493762375b4897914ae4fccaa40247280db2cd 100644 (file)
@@ -1,4 +1,4 @@
-Tests that showing / hiding video controls uses the sets the display:none property
+Tests that showing / hiding video controls uses the display:none property
 
 
 ** Playing the video **
@@ -8,13 +8,13 @@ RUN(video.play())
 RUN(eventSender.mouseMoveTo(muteButtonCoordinates[0], muteButtonCoordinates[1]))
 
 ** Test that controls are shown when controls attribute is present **
-EXPECTED (panel.style['display'] != 'none') OK
+EXPECTED (getComputedStyle(panel).display != 'none') OK
 
 ** Move mouse outside the video **
 RUN(eventSender.mouseMoveTo(video.offsetLeft, video.offsetTop + 2 * video.offsetHeight))
 
 ** The controls should have the display property set to none
-EXPECTED (panel.style['display'] == 'none') OK
+EXPECTED (getComputedStyle(panel).display == 'none') OK
 
 ** Remove controls attribute**
 RUN(video.removeAttribute('controls'))
@@ -23,7 +23,7 @@ RUN(video.removeAttribute('controls'))
 RUN(eventSender.mouseMoveTo(muteButtonCoordinates[0], muteButtonCoordinates[1]))
 
 ** Video controls should not be shown **
-EXPECTED (panel.style['display'] == 'none') OK
+EXPECTED (getComputedStyle(panel).display == 'none') OK
 
 END OF TEST
 
index 73c39662617073c5800358ded8e7f323e70aa582..0175402f3530cc4f949026d2958adc86def4e5fa 100644 (file)
@@ -40,7 +40,7 @@
 
             consoleWrite("");
             consoleWrite("** Test that controls are shown when controls attribute is present **");
-            testExpected("panel.style['display']", 'none', "!=");
+            testExpected("getComputedStyle(panel).display", 'none', "!=");
 
             if (window.eventSender) {
                 consoleWrite("");
 
         function continueTest()
         {
-            if (panel.style['display'] != 'none') {
+            if (getComputedStyle(panel).display != 'none') {
                 setTimeout(continueTest, fadeoutTime);
                 return;
             }
 
             consoleWrite("");
             consoleWrite("** The controls should have the display property set to none");
-            testExpected("panel.style['display']", 'none', "==");
+            testExpected("getComputedStyle(panel).display", 'none', "==");
 
             consoleWrite("");
             consoleWrite("** Remove controls attribute**");
@@ -72,7 +72,7 @@
 
             consoleWrite("");
             consoleWrite("** Video controls should not be shown **");
-            testExpected("panel.style['display']", 'none', "==");
+            testExpected("getComputedStyle(panel).display", 'none', "==");
 
             consoleWrite("");
 
@@ -82,7 +82,7 @@
     </script>
 </head>
 <body onload="init()">
-    Tests that showing / hiding video controls uses the sets the display:none property<br>
+    Tests that showing / hiding video controls uses the display:none property<br>
     <video onplay="test()" controls></video>
 </body>
 </html>
index 42d163a7a94ac9128b35c0e0f7ce50e43c116eb6..05fed1297408c64632e288cd23c37b58ec004ab5 100644 (file)
@@ -2117,9 +2117,6 @@ webkit.org/b/143990 media/track/track-disabled.html [ Timeout Pass ]
 
 webkit.org/b/130971 media/track/track-remove-track.html [ Timeout ]
 
-# After webkit.org/b/123097 we flag these tests that also fail in mac
-webkit.org/b/123097 media/video-controls-toggling.html [ Timeout ]
-
 webkit.org/b/145053 http/tests/xmlhttprequest/origin-exact-matching.html [ Timeout Pass ]
 
 webkit.org/b/145168 media/track/track-cue-inline-assertion-crash.html [ Timeout Pass ]
diff --git a/LayoutTests/platform/gtk/media/video-controls-toggling-expected.txt b/LayoutTests/platform/gtk/media/video-controls-toggling-expected.txt
new file mode 100644 (file)
index 0000000..e7dc669
--- /dev/null
@@ -0,0 +1,30 @@
+CONSOLE MESSAGE: line 122: TypeError: undefined is not an object (evaluating 'this.captionMenu.style')
+Tests that showing / hiding video controls uses the display:none property
+
+
+** Playing the video **
+RUN(video.play())
+
+** Move mouse somewhere over the panel **
+RUN(eventSender.mouseMoveTo(muteButtonCoordinates[0], muteButtonCoordinates[1]))
+
+** Test that controls are shown when controls attribute is present **
+EXPECTED (getComputedStyle(panel).display != 'none') OK
+
+** Move mouse outside the video **
+RUN(eventSender.mouseMoveTo(video.offsetLeft, video.offsetTop + 2 * video.offsetHeight))
+
+** The controls should have the display property set to none
+EXPECTED (getComputedStyle(panel).display == 'none') OK
+
+** Remove controls attribute**
+RUN(video.removeAttribute('controls'))
+
+** Move mouse back over the panel **
+RUN(eventSender.mouseMoveTo(muteButtonCoordinates[0], muteButtonCoordinates[1]))
+
+** Video controls should not be shown **
+EXPECTED (getComputedStyle(panel).display == 'none') OK
+
+END OF TEST
+