commit af344650cbfb5527c9c6fc67a35eecf4e42a2560
Author: Alex Catarineu <acat(a)torproject.org>
Date: Wed Nov 4 21:05:43 2020 +0100
fixup! Bug 12620: TorBrowser regression tests
---
tbb-tests/browser_tor_bug2950.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tbb-tests/browser_tor_bug2950.js b/tbb-tests/browser_tor_bug2950.js
index 010cc6356202..add683022d8e 100644
--- a/tbb-tests/browser_tor_bug2950.js
+++ b/tbb-tests/browser_tor_bug2950.js
@@ …
[View More]-13,19 +13,19 @@ let Ci = Components.interfaces;
// ## utility functions
-// __uri(spec)__.
-// Creates an nsIURI instance from a spec
+// __principal(spec)__.
+// Creates a principal instance from a spec
// (string address such as "http://torproject.org").
-let uri = spec => Services.io.newURI(spec, null, null);
+let principal = spec => Services.scriptSecurityManager.createContentPrincipalFromOrigin(spec);
// __setPermission(spec, key, value)__.
// Sets the site permission of type key to value, for the site located at address spec.
-let setPermission = (spec, key, value) => SitePermissions.set(uri(spec), key, value);
+let setPermission = (spec, key, value) => SitePermissions.setForPrincipal(principal(spec), key, value);
// __getPermission(spec, key)__.
// Reads the site permission value for permission type key, for the site
// located at address spec.
-let getPermission = (spec, key) => SitePermissions.get(uri(spec), key);
+let getPermission = (spec, key) => SitePermissions.getForPrincipal(principal(spec), key);
// __profileDirPath__.
// The Firefox Profile directory. Expected location of various persistent files.
@@ -54,12 +54,12 @@ let originalValue = getPermission(SITE, KEY);
window.setTimeout(
function () {
// Set the permission to a new value.
- setPermission(SITE, KEY, (originalValue === 0) ? 1 : 0);
+ setPermission(SITE, KEY, SitePermissions.BLOCK);
// Now read back the permission value again.
let newReadValue = getPermission(SITE, KEY);
// Compare to confirm that the permission
// value was successfully changed.
- isnot(newReadValue, originalValue, "Set a value in permissions db (perhaps in memory).");;
+ Assert.notDeepEqual(originalValue, newReadValue, "Set a value in permissions db (perhaps in memory).");
// If file existed or now exists, get the current time stamp.
if (permissionsFile.exists()) {
newModifiedTime = permissionsFile.lastModifiedTime;
[View Less]
commit 35ca9a2f3fcc7db381f9516ce570532bc9401717
Author: Alex Catarineu <acat(a)torproject.org>
Date: Fri Jan 8 21:03:51 2021 +0100
fixup! Bug 12620: TorBrowser regression tests
---
tbb-tests/browser_tor_TB4.js | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tbb-tests/browser_tor_TB4.js b/tbb-tests/browser_tor_TB4.js
index f08d086e3815..8bb12f360e5e 100644
--- a/tbb-tests/browser_tor_TB4.js
+++ b/tbb-tests/browser_tor_TB4.js
@@ -1,9 +1,7 @@
// # Test …
[View More]for TB4: Tor Browser's Firefox preference overrides
-// Simple regression tests to check the value of each pref and
-// decides if it is set as expected.
-
-// TODO: Write unit tests to check that each pref setting here
-// causes the browser to have the desired behavior (a big task).
+// This is a minimal test to check whether the 000-tor-browser.js
+// pref overrides are being used at all or not. More comprehensive
+// pref tests are maintained in the tor-browser-bundle-testsuite project.
function test() {
[View Less]
commit cde995d8d86fd85ec457cbb97e1ebd07a8160ee6
Author: Alex Catarineu <acat(a)torproject.org>
Date: Mon Jan 11 15:25:38 2021 +0100
fixup! Bug 12620: TorBrowser regression tests
---
run-tbb-tests | 3 +++
1 file changed, 3 insertions(+)
diff --git a/run-tbb-tests b/run-tbb-tests
index 1566c37c43cb..bc09839f9f05 100755
--- a/run-tbb-tests
+++ b/run-tbb-tests
@@ -51,6 +51,9 @@ fi
rm -f tbb-tests.log
echo $'\n''Starting tests'
+# We need `security.nocertdb = false` because of #…
[View More]18087. That pref is
+# forced to have the same value as `browser.privatebrowsing.autostart` in
+# torbutton, so we just set `browser.privatebrowsing.autostart=false` here.
./mach mochitest --log-tbpl tbb-tests.log \
--setpref network.file.path_blacklist='' \
--setpref extensions.torbutton.use_nontor_proxy=true \
[View Less]