2 <html manifest=
"resources/video.manifest">
4 <title>test media in the app cache
</title>
6 video { background-color: yellow; width:
320px; height:
240px; }
8 <script src=/media-resources/media-file.js
></script>
9 <script src=/media-resources/video-test.js
></script>
13 function unexpectedEvent(event
)
15 failTest(false, '<br>Unexpected "' + event
.type
+ '" event!!');
24 failTest(false, "Failed loading file included in manifest!");
35 function durationchangeEvent()
43 failTest("<br>Loaded file NOT included in manifest!");
46 failTest("<br>Loaded JavaScript file as media!");
53 consoleWrite("*** Setting 'src' to non-media file that is in manifest. This file should fail to load.<br>");
56 video
= document
.getElementsByTagName('video')[0];
57 video
.src
= "/media-resources/media-file.js";
62 consoleWrite("<br>*** Setting 'src' to valid media file not in manifest. This file should fail to load.<br>");
65 video
= document
.getElementsByTagName('video')[0];
66 video
.src
= "/media-resources/content/" + findMediaFile("audio", "silence");
71 consoleWrite("*** Setting 'src' to file specified in manifest. This file should load.<br>");
74 waitForEvent('durationchange', durationchangeEvent
);
75 waitForEvent('error', errorEvent
);
77 video
= document
.getElementsByTagName('video')[0];
78 video
.src
= "/media-resources/content/" + findMediaFile("video", "test");
81 function updateready(event
)
83 applicationCache
.swapCache();
87 applicationCache
.addEventListener("updateready", updateready
, false);
88 applicationCache
.addEventListener("noupdate", test1
, false);
89 applicationCache
.addEventListener("cached", test1
, false);
91 applicationCache
.addEventListener("obsolete", unexpectedEvent
, false);
92 applicationCache
.addEventListener("error", unexpectedEvent
, false);
98 <video controls
></video>
100 <p>Test that
<video
> can be loaded from the application cache.
</p>