40 lines
1.0 KiB
HTML
40 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Security-Policy" content="media-src *">
|
|
<style>
|
|
video {
|
|
background-color: red;
|
|
width: 128px;
|
|
height: 128px;
|
|
}
|
|
</style>
|
|
<script src="../../media/media-file.js"></script>
|
|
<script>
|
|
if (window.testRunner)
|
|
testRunner.waitUntilDone();
|
|
|
|
function testFinished()
|
|
{
|
|
if (window.testRunner)
|
|
testRunner.notifyDone();
|
|
}
|
|
|
|
window.onload = function ()
|
|
{
|
|
var video = document.getElementById("video");
|
|
video.oncanplaythrough = function () {
|
|
// Use a zero timer to ensure that the first frame of the video is drawn.
|
|
window.setTimeout(testFinished, 0);
|
|
}
|
|
video.onerror = testFinished;
|
|
video.src = "../../media/" + findMediaFile("video", "content/test");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p>This tests that loading a video with a file URL is allowed when the page that is loaded from file URL has Content Security Policy "media-src *". This test PASSED if you don't see a solid red square. Otherwise, it FAILED.</p>
|
|
<video id="video"></video>
|
|
</body>
|
|
</html>
|