blob: 0ed8c09044fd8962690f86b512e99c9814960520 [file] [log] [blame]
<!DOCTYPE html>
<html manifest="resources/video.manifest">
<title>Test that "video" can be loaded from the application cache.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
applicationCache.onupdateready = t.unreached_func();
applicationCache.onobsolete = t.unreached_func();
applicationCache.onerror = t.unreached_func();
applicationCache.oncached = t.step_func(test1);
applicationCache.onnoupdate = t.step_func(test1);
video = document.querySelector("video");
function test1() {
// Setting "src" to file specified in manifest. This file should load.
video.ondurationchange = t.step_func(test2);
video.onerror = t.unreached_func();
video.src = "/media-resources/content/test.ogv";
}
function test2() {
// Setting "src" to valid media file not in manifest. This file should fail to load.
video.ondurationchange = t.unreached_func();
video.onerror = t.step_func(test3);
video.src = "/media-resources/content/silence.oga";
}
function test3() {
// Setting "src" to non-media file that is in manifest. This file should fail to load.
video.src = "/media-resources/media-file.js";
video.onerror = t.step_func_done();
}
});
</script>