|
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/. */ |
|
4 |
|
5 function test() { |
|
6 let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]. |
|
7 getService(Ci.mozIJSSubScriptLoader); |
|
8 let rootDir = getRootDirectory(gTestPath); |
|
9 let jar = getJar(rootDir); |
|
10 if (jar) { |
|
11 let tmpdir = extractJarToTmp(jar); |
|
12 rootDir = "file://" + tmpdir.path + '/'; |
|
13 } |
|
14 loader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this); |
|
15 let runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime); |
|
16 |
|
17 run_test_subset(Array.concat([ |
|
18 test_custom_retention("acceptCookies", "remember"), |
|
19 test_custom_retention("acceptCookies", "custom") |
|
20 ], |
|
21 (runtime.isReleaseBuild ? [ |
|
22 test_custom_retention("acceptThirdPartyMenu", "remember", "visited"), |
|
23 test_custom_retention("acceptThirdPartyMenu", "custom", "always") |
|
24 ] |
|
25 : [ |
|
26 test_custom_retention("acceptThirdPartyMenu", "remember", "always"), |
|
27 test_custom_retention("acceptThirdPartyMenu", "custom", "visited") |
|
28 ]), [ |
|
29 test_custom_retention("keepCookiesUntil", "remember", 1), |
|
30 test_custom_retention("keepCookiesUntil", "custom", 2), |
|
31 test_custom_retention("keepCookiesUntil", "custom", 0), |
|
32 test_custom_retention("alwaysClear", "remember"), |
|
33 test_custom_retention("alwaysClear", "custom"), |
|
34 test_historymode_retention("remember", "remember"), |
|
35 |
|
36 // reset all preferences to their default values once we're done |
|
37 reset_preferences |
|
38 ])); |
|
39 } |