diff options
Diffstat (limited to 'Tools/TestWebKitAPI/Tests/WebKit2Cocoa/autoplaying-video-with-audio.html')
| -rw-r--r-- | Tools/TestWebKitAPI/Tests/WebKit2Cocoa/autoplaying-video-with-audio.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/autoplaying-video-with-audio.html b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/autoplaying-video-with-audio.html new file mode 100644 index 000000000..53b456388 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/autoplaying-video-with-audio.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> +<head> + <script> + var timeout; + + function pauseVideo() { + document.getElementsByTagName("video")[0].pause(); + } + + function handlePaused() { + // Wait until the next runloop to allow media controls to update. + setTimeout(function() { + try { + window.webkit.messageHandlers.testHandler.postMessage("paused"); + } catch(e) { } + }, 0); + } + + function beganAutoplaying() { + setTimeout(function() { + try { + window.webkit.messageHandlers.testHandler.postMessage("autoplayed"); + } catch(e) { + } + }, 0) + } + + </script> +</head> +<body onmousedown=pauseVideo()> + <video autoplay controls onplaying=beganAutoplaying() src="video-with-audio.mp4" webkit-playsinline onpause=handlePaused()></video> +</body> +</html> |
