Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html

Issue 2146923002: Convert auto-play-in-sandbox* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698