blob: 113433a2913d1c022ed570aba2cb15e6e1c7ecea [file] [log] [blame]
<!DOCTYPE html>
<title>Tests that the media player will send the relevant referer when requesting the media file.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../../media-resources/media-file.js"></script>
<body>
<video>
<source></source>
</video>
<script>
async_test(function(t) {
var movie = 'test.ogv';
var type = mimeTypeForExtension(movie.split('.').pop());
var iframe = document.createElement('iframe');
iframe.onload = t.step_func(function() {
var video = document.querySelector('video');
video.onerror = t.unreached_func();
video.oncanplay = t.step_func_done();
var source = document.querySelector('source');
source.src = 'http://127.0.0.1:8000/media/resources/video-referer-check-referer.php?name=' + movie + '&type=' + type;
source.type = type;
video.load();
});
iframe.src = 'data:text/html,<b>test</b>';
document.body.appendChild(iframe);
});
</script>