Sat, 03 Jan 2015 20:18:00 +0100
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.
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=448600
5 -->
6 <head>
7 <title>Test for Bug 448600</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448600">Mozilla Bug 448600</a>
13 <p id="display"></p>
16 <pre id="test">
17 <script type="application/javascript">
19 function filename(uri) {
20 return uri.substr(uri.lastIndexOf("/")+1);
21 }
23 function e(id) {
24 return document.getElementById(id);
25 }
27 var gLoadError = new Object();
29 gLoadError['video1'] = 0;
30 gLoadError['video2'] = 0;
31 gLoadError['video3'] = 0;
33 var gErrorCount = 0;
35 SimpleTest.waitForExplicitFinish();
37 function finishTest() {
38 is(e('video1').currentSrc,
39 "",
40 'video1 currentSrc should be empty when there\'s no playable typed source children');
41 is(filename(e('video2').currentSrc),
42 filename(e('video2').src),
43 'video2 currentSrc should match src');
44 is(filename(e('video3').currentSrc),
45 filename(e('video3').src),
46 'video3 currentSrc should match src');
48 is(gLoadError['video1'], 2, "Expect one error per invalid source child on video1");
49 is(gLoadError['video2'], 1, "Expect one error on video2");
50 is(gLoadError['video3'], 1, "Expect one error on video3");
52 SimpleTest.finish();
53 }
55 function videoError(event, id) {
56 gLoadError[id]++;
57 gErrorCount++;
58 if (gErrorCount >= 4) {
59 finishTest();
60 }
61 }
63 </script>
64 <!-- We make the resource URIs unique to ensure that they are (re)loaded with the new disable-decoder prefs. -->
65 <div id="content">
66 </div>
67 <script>
68 function makeVideos() {
69 document.getElementById('content').innerHTML = '<video id="video1" preload="metadata"><source type="video/ogg" src="320x240.ogv?decoder_disabled=1" onerror="videoError(event, \'video1\');"/><source type="audio/wave" src="r11025_u8_c1.wav?decoder_disabled=1" id=\'s2\' onerror="videoError(event, \'video1\');"/></video><video id="video2" preload="metadata" src="320x240.ogv?decoder_disabled=2" onerror="videoError(event, \'video2\');"></video><video id="video3" preload="metadata" src="r11025_u8_c1.wav?decoder_disabled=2" onerror="videoError(event, \'video3\');"></video>';
70 }
72 SpecialPowers.pushPrefEnv({"set": [["media.ogg.enabled", false], ["media.wave.enabled", false]]}, makeVideos);
73 </script>
75 </pre>
77 </body>
78 </html>