Commit 66f2fa7f authored by srirama.m's avatar srirama.m Committed by Commit bot

Convert auto-play-in-sandbox* tests to testharness.js

Cleaning up auto-play-in-sandbox* tests in media/
to use testharness.js instead of video-test.js.
This will enable to upstream these tests to web-platform-tests.

BUG=588956

Review-Url: https://codereview.chromium.org/2146923002
Cr-Commit-Position: refs/heads/master@{#405259}
parent cfd0445d
--------
Frame: '<!--framePath //<!--frame0-->-->'
--------
Test that play event fires when "src" set with an autoplay attribute in a sandbox with allows-scripts.
EXPECTED (video.paused == 'true') OK
EVENT(play)
PLAY fired OK
END OF TEST
<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 newline at end of file
<!DOCTYPE html>
<base href="..">
<video autoplay controls></video>
<p>Test that play event fires when "src" set with an autoplay attribute in a sandbox with allows-scripts.</p>
<script src=media-file.js></script>
<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
(Please avoid writing new tests using video-test.js) -->
<script src=video-test.js></script>
<script>
testExpected("video.paused", true);
waitForEvent('play', function () {
logResult(true, "PLAY fired");
endTest();
} );
video.src = findMediaFile("video", "content/test");
</script>
<video autoplay></video>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment