blob: 293b4c25ffd6e49c60b29edea62d8b3ce0a6d899 [file] [log] [blame]
<!DOCTYPE html>
<title>Tests that the media player sends the User Agent string when requesting a 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.oncanplay = t.step_func_done();
var source = document.querySelector('source');
source.src = 'http://127.0.0.1:8000/media/resources/video-check-useragent.php?name=' + movie + '&type=' + type;
source.type = type;
source.onerror = t.unreached_func();
video.load();
});
iframe.src = 'data:text/html,<b>test</b>';
document.body.appendChild(iframe);
});
</script>