Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
|
acolwell GONE FROM CHROMIUM
2014/04/21 16:51:16
nit: 4 space indent tags as well please.
sof
2014/04/21 18:35:01
Done.
| |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| 5 <script src=../media-file.js></script> | |
| 6 <script src=../video-test.js></script> | |
| 7 <script> | |
| 8 var cue; | |
| 9 var track; | |
| 10 var j = 0; | |
| 11 var cueLimit = 10; | |
| 12 | |
| 13 function checkNativeProperty() | |
| 14 { | |
| 15 cue = this; | |
| 16 testExpected("cue.hasOwnProperty('custom')", true); | |
| 17 if (++j >= cueLimit) | |
| 18 endTest(); | |
| 19 } | |
| 20 | |
| 21 function startTest() | |
| 22 { | |
| 23 findMediaElement(); | |
| 24 video.src = findMediaFile('video', '../content/test'); | |
| 25 | |
| 26 consoleWrite("** Add a text track to the video element **"); | |
| 27 track = video.addTextTrack("captions", "regular captions track", "en"); | |
| 28 track.custom = "track"; | |
| 29 testExpected("track.hasOwnProperty('custom')", true); | |
| 30 | |
| 31 consoleWrite("** Add cues with own native property to the track with enter e vent listener. **"); | |
| 32 for (var i = 0; i < cueLimit; i++) { | |
| 33 var c = new VTTCue(i / 4, i / 2 + 1, "Label" + i); | |
| 34 c.custom = "cue"; | |
| 35 c.addEventListener("enter", checkNativeProperty); | |
| 36 track.addCue(c); | |
| 37 } | |
| 38 for (var i = 0; i < 10; i++) { | |
| 39 cue = track.cues[i]; | |
| 40 testExpected("cue.hasOwnProperty('custom')", true); | |
| 41 } | |
| 42 | |
| 43 consoleWrite(""); | |
| 44 consoleWrite("** Trigger a garbage collection. **"); | |
| 45 track = null; | |
| 46 gc(); | |
| 47 track = video.textTracks[0]; | |
| 48 testExpected("track.hasOwnProperty('custom')", true); | |
| 49 | |
| 50 consoleWrite(""); | |
| 51 consoleWrite("** Play the video and test cue wrappers. **"); | |
| 52 run("video.play()"); | |
| 53 track.mode = "showing"; | |
| 54 } | |
| 55 </script> | |
| 56 </head> | |
| 57 <body onload="startTest()"> | |
| 58 <p>Tests that added cue object wrappers live across garbage collections.</p> | |
| 59 <video controls /> | |
| 60 </body> | |
| 61 </html> | |
| OLD | NEW |