1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // This tests that the nsIClientAuthRememberService correctly reads its backing
10 let stateFile = do_get_profile();
11 stateFile.append(CLIENT_AUTH_FILE_NAME);
12 let outputStream = FileUtils.openFileOutputStream(stateFile);
15 key: "example.com,C9:65:33:89:EE:DC:4D:05:DA:16:3D:D0:12:61:BC:61:21:51:AF:2B:CC:C6:E1:72:B3:78:23:0F:13:B1:C7:4D,",
19 key: "example.com,C9:65:33:89:EE:DC:4D:05:DA:16:3D:D0:12:61:BC:61:21:51:AF:2B:CC:C6:E1:72:B3:78:23:0F:13:B1:C7:4D,^partitionKey=%28https%2Cexample.com%29",
22 { key: "example.test,,", value: "CCCC" },
24 for (let keyValuePair of keyValuePairs) {
25 append_line_to_data_storage_file(
35 let clientAuthRememberService = Cc[
36 "@mozilla.org/security/clientAuthRememberService;1"
37 ].getService(Ci.nsIClientAuthRememberService);
41 clientAuthRememberService.hasRememberedDecisionScriptable(
47 equal(dbKey.value, "AAAA");
51 clientAuthRememberService.hasRememberedDecisionScriptable(
53 { partitionKey: "(https,example.com)" },
57 equal(dbKey.value, "BBBB");
60 !clientAuthRememberService.hasRememberedDecisionScriptable(
67 !clientAuthRememberService.hasRememberedDecisionScriptable(
69 { partitionKey: "(https,example.org)" },
76 clientAuthRememberService.hasRememberedDecisionScriptable(
82 equal(dbKey.value, "CCCC");