GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Unverified Commit db44f840 authored by boklm's avatar boklm
Browse files

Fix the https-everywhere-disabled test

Now that https-everywhere is installed as an xpi file the test fail
because we can't update the preferences.js file from the extension.
We now use the global preferences/extension-overrides.js preferences
file instead.
parent 1f7f5bb7
......@@ -244,8 +244,9 @@ our @tests = (
type => 'marionette',
descr => 'Check that https everywhere is not doing anything when disabled',
use_net => 1,
pre => sub { toggle_https_everywhere($_[0], 0) },
post => sub { toggle_https_everywhere($_[0], 1) },
prefs => {
'extensions.https_everywhere.globalEnabled' => 'false',
},
},
{
name => 'settings',
......@@ -452,26 +453,6 @@ our @tests = (
},
);
sub toggle_https_everywhere {
my ($tbbinfos, $t) = @_;
my $prefs = $tbbinfos->{ffprofiledir} . '/extensions/'
. 'https-everywhere@eff.org/defaults/preferences/preferences.js';
my $prefs_eff = $tbbinfos->{ffprofiledir} . '/extensions/'
. 'https-everywhere-eff@eff.org/defaults/preferences/preferences.js';
$prefs = $prefs_eff unless -f $prefs;
my @f = read_file($prefs);
foreach (@f) {
if ($t) {
s/pref\("extensions\.https_everywhere\.globalEnabled",false\);
/pref("extensions.https_everywhere.globalEnabled",true);/x;
} else {
s/pref\("extensions\.https_everywhere\.globalEnabled",true\);
/pref("extensions.https_everywhere.globalEnabled",false);/x;
}
}
write_file($prefs, @f);
}
sub set_test_prefs {
my ($tbbinfos, $t) = @_;
return unless $t->{prefs};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment