content/media/test/test_bug883173.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=883173
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <meta charset='utf-8'>
michael@0 8 <title>Test for Bug 883173 - TextTrackCue(List) Sorting</title>
michael@0 9 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
michael@0 10 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 12 </head>
michael@0 13 <body>
michael@0 14 <p id="display"></p>
michael@0 15 <div id="content">
michael@0 16 </div>
michael@0 17 <pre id="test">
michael@0 18 <script class="testbody" type="text/javascript">
michael@0 19 SimpleTest.waitForExplicitFinish();
michael@0 20 SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
michael@0 21 function() {
michael@0 22 var video = document.createElement("video");
michael@0 23 video.src = "seek.webm";
michael@0 24 video.preload = "auto";
michael@0 25 var trackElement = document.createElement("track");
michael@0 26 trackElement.src = "bug883173.vtt";
michael@0 27 trackElement.kind = "subtitles";
michael@0 28 document.getElementById("content").appendChild(video);
michael@0 29 video.appendChild(trackElement);
michael@0 30 video.addEventListener("loadedmetadata",
michael@0 31 function run_tests() {
michael@0 32 // Re-queue run_tests() at the end of the event loop until the track
michael@0 33 // element has loaded its data.
michael@0 34 if (trackElement.readyState == 1) {
michael@0 35 setTimeout(run_tests, 0);
michael@0 36 return;
michael@0 37 }
michael@0 38 is(trackElement.readyState, 2, "Track::ReadyState should be set to LOADED.");
michael@0 39 // Set mode to hidden so that the active cue lists are being updated.
michael@0 40 trackElement.track.mode = "hidden";
michael@0 41
michael@0 42 var expected = [[1, 2], [1, 3], [2, 3], [2, 4], [3, 4]];
michael@0 43 var cueList = trackElement.track.cues;
michael@0 44
michael@0 45 is(cueList.length, expected.length, "Cue list length should be 5.");
michael@0 46 for (var i = 0; i < expected.length; i++) {
michael@0 47 is(cueList[i].startTime, expected[i][0], "Cue's start time should be " + expected[i][0]);
michael@0 48 is(cueList[i].endTime, expected[i][1], "Cue's end time should be " + expected[i][1]);
michael@0 49 }
michael@0 50
michael@0 51 SimpleTest.finish();
michael@0 52 }
michael@0 53 );
michael@0 54 }
michael@0 55 );
michael@0 56
michael@0 57 </script>
michael@0 58 </pre>
michael@0 59 </body>
michael@0 60 </html>

mercurial