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 <head>
4 <title>Test for Login Manager</title>
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <script type="text/javascript" src="pwmgr_common.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8 </head>
9 <body>
10 Login Manager test: master password cleanup
11 <p id="display"></p>
13 <div id="content" style="display: none">
14 </div>
16 <pre id="test">
17 <script class="testbody" type="text/javascript">
20 /*
21 * The entire purpose of this test is to make sure that, if the previous master
22 * password test did not complete successfully, we don't screw up other pwmgr
23 * tests by having a master password unexpectedly set.
24 */
25 function cleanup() {
26 ok(true, "ensuring MP is cleared");
28 var pk11db = Cc["@mozilla.org/security/pk11tokendb;1"].
29 getService(Ci.nsIPK11TokenDB);
30 var token = pk11db.getInternalKeyToken();
32 if (!token.checkPassword("")) {
33 ok(true, "Oops! MP still set, clearing it...");
34 disableMasterPassword();
35 } else {
36 ok(true, "Master password already cleared.");
37 }
39 ok(true, "done.");
40 }
42 const Cc = SpecialPowers.Cc;
43 const Ci = SpecialPowers.Ci;
45 cleanup();
46 </script>
47 </pre>
48 </body>
49 </html>