Unregister from GCM when the only GCM app is removed
[chromium-blink-merge.git] / chrome / test / data / prerender / prerender_html5_video_media_source.html
blobebae12eab9bb8650a821f2d50341fa6ec7797620
1 <html>
2 <!--
3 This test checks that video tags created by javascript are are deferred
4 during prerendering and the autoplay is enabled during swap ins.
5 -->
6 <head>
7 <title>Prerender for HTML5 Media Source Video.</title>
8 </head>
10 <body>
11 <video id="mediaEl" autoplay controls></video>
13 <script>
14 var willPlay = true;
15 var testNetworkEvents = false;
16 </script>
18 <script src="prerender_html5_common.js"></script>
20 <script>
22 function onSourceOpen(e) {
23 var srcBuffer = mediaSource.addSourceBuffer('video/webm; codecs="vp8"');
24 var xhr = new XMLHttpRequest();
25 xhr.open('GET', 'bear-320x240-video-only.webm');
26 xhr.responseType = 'arraybuffer';
27 xhr.addEventListener('load', function(e) {
28 srcBuffer.appendBuffer(new Uint8Array(e.target.response));
29 srcBuffer.addEventListener('updateend', function(e) {
30 mediaSource.endOfStream();
31 });
32 });
33 xhr.send();
36 var mediaSource = new MediaSource();
37 mediaSource.addEventListener('sourceopen', onSourceOpen);
38 mediaEl.src = window.URL.createObjectURL(mediaSource);
39 </script>
41 </body>
42 </html>