blob: 8f6661bcb85b38884cbe8f9e8d7479335f373bdd [file] [log] [blame]
<html manifest="resources/simple-video-async.manifest">
<script>
if (window.testRunner) {
testRunner.dumpAsText()
testRunner.waitUntilDone();
}
function finishTest(message) {
document.getElementById('result').innerHTML = message;
testRunner.notifyDone();
}
function cached()
{
try {
var req = new XMLHttpRequest();
req.open("GET", "resources/fake-video.mp4");
req.send();
req.onloadend = function() {
if (req.getResponseHeader("Content-Type") != "video/mp4")
finishTest("FAILURE: Did not get correct content type from cached resource");
if (req.responseText.trim() != "This is a fake video")
finishTest("FAILURE: Did not get correct data from cached resource");
finishTest("SUCCESS");
}
} catch (e) {
finishTest("FAILURE: Could not load video data from cache");
}
}
applicationCache.addEventListener('cached', cached, false);
applicationCache.addEventListener('noupdate', cached, false);
</script>
<div>This tests that the application cache works for video retrieved by async XMLHttpRequest</div>
<div id="result">FAILURE</div>
</html>