Index: third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html |
diff --git a/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html b/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html |
index 292795453e47f1a14102204d8eaed4d44e1ff584..49f263ef8847a2d215e4b26cb61abef2ed2035f3 100644 |
--- a/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html |
+++ b/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html |
@@ -1,10 +1,21 @@ |
-<script> |
-if (window.testRunner) { |
- testRunner.dumpAsText(); |
- testRunner.dumpChildFramesAsText(); |
-} |
-</script> |
+<!DOCTYPE html> |
+<title>Test that play event fires when "src" set with an autoplay attribute in a sandbox with allows-scripts.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
<iframe |
- style="width: 400px; height: 600px" |
sandbox="allow-scripts allow-same-origin" |
- src="resources/auto-play-in-sandbox-with-allow-scripts-iframe.html"></iframe> |
+ src="resources/auto-play-in-sandbox-with-allow-scripts-iframe.html"> |
+</iframe> |
+<script> |
+async_test(function(t) { |
+ var iframe = document.querySelector("iframe"); |
+ |
+ iframe.onload = t.step_func(function() { |
+ var video = iframe.contentDocument.querySelector("video"); |
+ assert_true(video.paused); |
+ video.onplay = t.step_func_done(); |
+ video.src = findMediaFile("video", "content/test"); |
+ }); |
+}); |
+</script> |