Title: [95133] trunk/LayoutTests
Revision
95133
Author
eric.carl...@apple.com
Date
2011-09-14 15:44:31 -0700 (Wed, 14 Sep 2011)

Log Message

Media element tests should look up controller element locations
https://bugs.webkit.org/show_bug.cgi?id=68038

Get the position of controller elements from the shadow DOM.

Reviewed by Darin Adler.

* media/audio-delete-while-slider-thumb-clicked.html:
* media/audio-delete-while-step-button-clicked.html:
* media/controls-drag-timebar.html:
* media/controls-right-click-on-timebar.html:
* media/video-controls-transformed.html:
* media/video-controls-visible-audio-only.html:
* media/video-controls-zoomed.html:
* media/video-volume-slider.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (95132 => 95133)


--- trunk/LayoutTests/ChangeLog	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/ChangeLog	2011-09-14 22:44:31 UTC (rev 95133)
@@ -1,3 +1,21 @@
+2011-09-14  Eric Carlson  <eric.carl...@apple.com>
+
+        Media element tests should look up controller element locations.
+        https://bugs.webkit.org/show_bug.cgi?id=68038
+
+        Get the position of controller elements from the shadow DOM.
+
+        Reviewed by Darin Adler.
+
+        * media/audio-delete-while-slider-thumb-clicked.html:
+        * media/audio-delete-while-step-button-clicked.html:
+        * media/controls-drag-timebar.html:
+        * media/controls-right-click-on-timebar.html:
+        * media/video-controls-transformed.html:
+        * media/video-controls-visible-audio-only.html:
+        * media/video-controls-zoomed.html:
+        * media/video-volume-slider.html:
+
 2011-09-14  David Levin  <le...@chromium.org>
 
         [chromium] Update baselines due to r95070 and r95099.

Modified: trunk/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html (95132 => 95133)


--- trunk/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -2,6 +2,8 @@
 <html>
     <head>
         <script src=""
+        <script src=""
+        <script src=""
         <script>
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
@@ -36,7 +38,6 @@
                 if (!audio)
                     return;
 
-                // delete the search
                 log("<br>deleting audio element");
                 audio.parentNode.removeChild(audio);
 
@@ -52,19 +53,23 @@
                 layoutTestController.waitUntilDone();
 
                 var audio = document.getElementById('audio');
+                var seekCoords;
+                try {
+                    seekCoords = mediaControlsButtonCoordinates(audio, "timeline");
+                } catch (exception) {
+                    failTest(exception.description);
+                    return;
+                }
+                var x = seekCoords[0];
+                var y = seekCoords[1];
 
-                var center = audio.offsetLeft + (audio.offsetWidth / 2);
-                var middle = audio.offsetTop + (audio.offsetHeight / 2);
-                
-                var x = center + 16 + 16 + 8;
-                var y = middle;
-
-                // drag slider, leave the mouse down
+                // Click in the slider to get the thumb under the mouse.
                 log("clicking in controller");
                 eventSender.mouseMoveTo(x, y);
                 eventSender.mouseDown();
                 eventSender.mouseUp();
 
+                // Click slider to scrub, leave the mouse down.
                 log("clicking on thumb");
                 eventSender.mouseDown();
                 eventSender.mouseMoveTo(x, y + 20);

Modified: trunk/LayoutTests/media/audio-delete-while-step-button-clicked.html (95132 => 95133)


--- trunk/LayoutTests/media/audio-delete-while-step-button-clicked.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/audio-delete-while-step-button-clicked.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -53,10 +53,12 @@
 
                 var audio = document.getElementById('audio');
 
-                try {
-                    var seekCoords = mediaControlsButtonCoordinates(audio, "seek-forward-button");
-                } catch (exception) {
+                var seekCoords
+                try
+                    seekCoords = mediaControlsButtonCoordinates(audio, "seek-forward-button");
+                catch (exception) {
                     failTest(exception.description);
+                    return;
                 }
                 var x = seekCoords[0];
                 var y = seekCoords[1];

Modified: trunk/LayoutTests/media/controls-drag-timebar.html (95132 => 95133)


--- trunk/LayoutTests/media/controls-drag-timebar.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/controls-drag-timebar.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -2,6 +2,7 @@
 <html>
     <head>
         <title>drag timebar test</title>
+        <script src=""
         <script src=""
         <script src=""
         <script>
@@ -19,9 +20,17 @@
                 moveCount = 0;
 
                 if (window.eventSender) {
-                    x = video.offsetLeft + (video.offsetWidth / 2);
-                    y = video.offsetTop + video.offsetHeight - 10;
 
+                    var seekCoords;
+                    try {
+                        seekCoords = mediaControlsButtonCoordinates(video, "timeline");
+                    } catch (exception) {
+                        failTest(exception.description);
+                        return;
+                    }
+                    x = seekCoords[0];
+                    y = seekCoords[1];
+
                     eventSender.dragMode = false;
                     eventSender.mouseMoveTo(x, y);
                     eventSender.mouseDown();
@@ -42,17 +51,20 @@
                 if (window.eventSender) {
                     x += delta;
                     eventSender.mouseMoveTo(x, y);
-                    window.setTimeout("move()", 100);
                 }
             }
 
             function seeked()
             {
-                if (++seekCount == 6) {
-                    if (window.eventSender)
-                        eventSender.mouseUp();
-                    endTest();
+                ++seekCount;
+                if (seekCount < 6) {
+                    window.setTimeout("move()", 100);
+                    return;
                 }
+
+                if (window.eventSender)
+                    eventSender.mouseUp();
+                endTest();
             }
 
             function start()

Modified: trunk/LayoutTests/media/controls-right-click-on-timebar.html (95132 => 95133)


--- trunk/LayoutTests/media/controls-right-click-on-timebar.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/controls-right-click-on-timebar.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -1,6 +1,7 @@
 <html>
     <head>
         <title>right click on timebar test</title>
+        <script src=""
         <script src=""
         <script src=""
         <script>
@@ -10,8 +11,16 @@
             function click()
             {
                 if (window.eventSender) {
-                    var x = video.offsetLeft + video.offsetWidth / 2;
-                    var y = video.offsetTop + video.offsetHeight - 10;
+                    var seekCoords;
+                    try {
+                        seekCoords = mediaControlsButtonCoordinates(video, "timeline");
+                    } catch (exception) {
+                        failTest(exception.description);
+                        return;
+                    }
+                    var x = seekCoords[0];
+                    var y = seekCoords[1];
+
                     eventSender.mouseMoveTo(x, y);
                     eventSender.contextClick();
                 }

Modified: trunk/LayoutTests/media/video-controls-transformed.html (95132 => 95133)


--- trunk/LayoutTests/media/video-controls-transformed.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/video-controls-transformed.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -20,10 +20,12 @@
         waitForEvent('canplaythrough', function () {
             if (window.eventSender) {
                 // Find the play button and click the middle of its bounding box.
+                var playCoords;
                 try {
-                    var playCoords = mediaControlsButtonCoordinates(video, "play-button");
+                    playCoords = mediaControlsButtonCoordinates(video, "play-button");
                 } catch (exception) {
                     failTest(exception.description);
+                    return;
                 }
                 var clickX = playCoords[0];
                 var clickY = playCoords[1];

Modified: trunk/LayoutTests/media/video-controls-visible-audio-only.html (95132 => 95133)


--- trunk/LayoutTests/media/video-controls-visible-audio-only.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/video-controls-visible-audio-only.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -38,11 +38,13 @@
                     return;
 
                 // start playback
+                var playCoords
                 try {
-                    var playCoords = mediaControlsButtonCoordinates(video, "play-button");
+                    playCoords = mediaControlsButtonCoordinates(video, "play-button");
                 } catch (exception) {
                     consoleWrite(exception.description);
                     layoutTestController.notifyDone();
+                    return;
                 }
                 var clickX = playCoords[0];
                 var clickY = playCoords[1];

Modified: trunk/LayoutTests/media/video-controls-zoomed.html (95132 => 95133)


--- trunk/LayoutTests/media/video-controls-zoomed.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/video-controls-zoomed.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -21,10 +21,12 @@
         if (window.eventSender)
         {
             // Find the play button and click the middle of its bounding box.
+            var playCoords;
             try {
-                var playCoords = mediaControlsButtonCoordinates(video, "play-button");
+                playCoords = mediaControlsButtonCoordinates(video, "play-button");
             } catch (exception) {
                 failTest(exception.description);
+                return;
             }
             var clickX = playCoords[0];
             var clickY = playCoords[1];

Modified: trunk/LayoutTests/media/video-volume-slider.html (95132 => 95133)


--- trunk/LayoutTests/media/video-volume-slider.html	2011-09-14 22:42:46 UTC (rev 95132)
+++ trunk/LayoutTests/media/video-volume-slider.html	2011-09-14 22:44:31 UTC (rev 95133)
@@ -20,10 +20,12 @@
             video.volume = 0.7;
 
             if (window.eventSender) {
+                var muteCoords;
                 try {
                     muteCoords = mediaControlsButtonCoordinates(video, "mute-button");
                 } catch (exception) {
                     layoutTestController.notifyDone();
+                    return;
                 }
                 eventSender.mouseMoveTo(muteCoords[0], muteCoords[1]);
             }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to