Skip to content

Commit

Permalink
Merge r220985 - Stop media/video-controls-toggling.html from timing out.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ms2ger authored and carlosgcampos committed Aug 28, 2017
1 parent 385c637 commit 1986fab
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 12 deletions.
19 changes: 19 additions & 0 deletions LayoutTests/ChangeLog
@@ -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 Ms2ger <Ms2ger@igalia.com>

[GTK][WPE] Rebaseline tests with list item markers.
Expand Down
8 changes: 4 additions & 4 deletions LayoutTests/media/video-controls-toggling-expected.txt
@@ -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 **
Expand All @@ -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'))
Expand All @@ -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

10 changes: 5 additions & 5 deletions LayoutTests/media/video-controls-toggling.html
Expand Up @@ -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("");
Expand All @@ -53,14 +53,14 @@

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**");
Expand All @@ -72,7 +72,7 @@

consoleWrite("");
consoleWrite("** Video controls should not be shown **");
testExpected("panel.style['display']", 'none', "==");
testExpected("getComputedStyle(panel).display", 'none', "==");

consoleWrite("");

Expand All @@ -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>
3 changes: 0 additions & 3 deletions LayoutTests/platform/gtk/TestExpectations
Expand Up @@ -2134,9 +2134,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 ]
Expand Down
@@ -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

0 comments on commit 1986fab

Please sign in to comment.