iOS playback user action tests fail on some machines
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2016 20:23:58 +0000 (20:23 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2016 20:23:58 +0000 (20:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162504
rdar://problem/28013994

Reviewed by Jer Noble.

Avoid the need to have a timeout.

* TestWebKitAPI/Tests/WebKit/ios/audio-only.html:
* TestWebKitAPI/Tests/WebKit/ios/video-with-audio.html:
* TestWebKitAPI/Tests/WebKit/ios/video-without-audio.html:
* TestWebKitAPI/Tests/WebKit2Cocoa/large-video-without-audio.html:

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

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit/ios/audio-only.html
Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-audio.html
Tools/TestWebKitAPI/Tests/WebKit/ios/video-without-audio.html
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/large-video-without-audio.html

index 68e1679..46dafdd 100644 (file)
@@ -1,3 +1,18 @@
+2016-09-23  Alexey Proskuryakov  <ap@apple.com>
+
+        iOS playback user action tests fail on some machines
+        https://bugs.webkit.org/show_bug.cgi?id=162504
+        rdar://problem/28013994
+
+        Reviewed by Jer Noble.
+
+        Avoid the need to have a timeout.
+
+        * TestWebKitAPI/Tests/WebKit/ios/audio-only.html:
+        * TestWebKitAPI/Tests/WebKit/ios/video-with-audio.html:
+        * TestWebKitAPI/Tests/WebKit/ios/video-without-audio.html:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/large-video-without-audio.html:
+
 2016-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r204163): [GTK] API test /webkit2/WebKitSecurityManager/file-xhr is failing
index c4a24fa..aa7c3ee 100644 (file)
@@ -4,13 +4,10 @@
     <script>
     function go() {
         var audio = document.getElementsByTagName('audio')[0];
-        timeout = window.setTimeout(notPlaying, 250);
-        audio.addEventListener('playing', playing);
-        audio.play();
+        audio.play().then(playing).catch(notPlaying);
     }
 
     function playing() {
-        window.clearTimeout(timeout);
         try {
             window.webkit.messageHandlers.testHandler.postMessage('playing');
         } catch(e) {
@@ -28,4 +25,4 @@
 <body onload="go()">
     <audio src="video-with-audio.mp4"></video>
 </body>
-</html>
\ No newline at end of file
+</html>
index 808ddce..141c5f9 100644 (file)
@@ -6,13 +6,10 @@
 
     function go() {
         var video = document.getElementsByTagName('video')[0];
-        timeout = window.setTimeout(notPlaying, 250);
-        video.addEventListener('playing', playing);
-        video.play();
+        video.play().then(playing).catch(notPlaying);
     }
 
     function playing() {
-        window.clearTimeout(timeout);
         try {
             window.webkit.messageHandlers.testHandler.postMessage('playing');
         } catch(e) {
@@ -30,4 +27,4 @@
 <body onload="go()">
     <video src="video-with-audio.mp4" webkit-playsinline></video>
 </body>
-</html>
\ No newline at end of file
+</html>
index 275e7e1..3fe64ab 100644 (file)
@@ -4,13 +4,10 @@
     <script>
     function go() {
         var video = document.getElementsByTagName('video')[0];
-        timeout = window.setTimeout(notPlaying, 250);
-        video.addEventListener('playing', playing);
-        video.play();
+        video.play().then(playing).catch(notPlaying);
     }
 
     function playing() {
-        window.clearTimeout(timeout);
         try {
             window.webkit.messageHandlers.testHandler.postMessage('playing');
         } catch(e) {
@@ -28,4 +25,4 @@
 <body onload="go()">
     <video src="video-without-audio.mp4" webkit-playsinline></video>
 </body>
-</html>
\ No newline at end of file
+</html>
index f492fa4..27838eb 100644 (file)
@@ -5,13 +5,10 @@
 
     function go() {
         var video = document.getElementsByTagName('video')[0];
-        timeout = window.setTimeout(notPlaying, 250);
-        video.addEventListener('playing', playing);
-        video.play();
+        video.play().then(playing).catch(notPlaying);
     }
 
     function playing() {
-        window.clearTimeout(timeout);
         try {
             window.webkit.messageHandlers.testHandler.postMessage('playing');
         } catch(e) {