Skip to content

Commit c054cd1

Browse files
authored
Remove update channels, which interfere when interacting with UX elements, when running selenium tests. (EFForg#15075)
1 parent a2c17bb commit c054cd1

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

make.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
cd $(dirname $0)
2323

24-
if [ -n "$1" -a "$1" != "--remove-update-channel" ]; then
24+
if [ -n "$1" -a "$1" != "--remove-extension-update" -a "$1" != "--remove-update-channels" ]; then
2525
BRANCH=`git branch | head -n 1 | cut -d \ -f 2-`
2626
SUBDIR=checkout
2727
[ -d $SUBDIR ] || mkdir $SUBDIR
@@ -74,13 +74,21 @@ python3.6 -c "import json; m=json.loads(open('pkg/crx/manifest.json').read()); m
7474
# Remove the 'update_url' manifest key from the xpi version of the extension delivered to AMO
7575
python3.6 -c "import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); del m['applications']['gecko']['update_url']; m['applications']['gecko']['id'] = 'https-everywhere@eff.org'; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
7676

77-
# If the --remove-update-channel flag is set, ensure the extension is unable to update
78-
if [ "$1" == "--remove-update-channel" -o "$2" == "--remove-update-channel" ]; then
79-
echo "Flag --remove-update-channel specified. Removing the XPI extensions' ability to update."
77+
# If the --remove-extension-update flag is set, ensure the extension is unable to update
78+
if [ "$1" == "--remove-extension-update" -o "$2" == "--remove-extension-update" -o "$3" == "--remove-extension-update" ]; then
79+
echo "Flag --remove-extension-update specified. Removing the XPI extensions' ability to update."
8080
python3.6 -c "import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); m['applications']['gecko']['update_url'] = 'data:text/plain,'; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
8181
python3.6 -c "import json; m=json.loads(open('pkg/xpi-eff/manifest.json').read()); m['applications']['gecko']['update_url'] = 'data:text/plain,'; open('pkg/xpi-eff/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
8282
fi
8383

84+
# If the --remove-update-channels flag is set, remove all out-of-band update channels
85+
if [ "$1" == "--remove-update-channels" -o "$2" == "--remove-update-channels" -o "$3" == "--remove-update-channels" ]; then
86+
echo "Flag --remove-update-channels specified. Removing all out-of-band update channels."
87+
echo "update_channels = [];" >> pkg/crx/background-scripts/update_channels.js
88+
echo "update_channels = [];" >> pkg/xpi-amo/background-scripts/update_channels.js
89+
echo "update_channels = [];" >> pkg/xpi-eff/background-scripts/update_channels.js
90+
fi
91+
8492
if [ -n "$BRANCH" ] ; then
8593
crx="pkg/https-everywhere-$VERSION.crx"
8694
xpi_amo="pkg/https-everywhere-$VERSION-amo.xpi"

test/selenium/shim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ def get_browser_name(string):
5252

5353
def build_crx():
5454
'''Builds the .crx file for Chrome and returns the path to it'''
55-
cmd = [os.path.join(get_git_root(), 'make.sh')]
55+
cmd = [os.path.join(get_git_root(), 'make.sh'), '--remove-update-channels']
5656
return os.path.join(get_git_root(), run_shell_command(cmd).split()[-1])
5757

5858

5959
def build_xpi():
60-
cmd = [os.path.join(get_git_root(), 'make.sh')]
60+
cmd = [os.path.join(get_git_root(), 'make.sh'), '--remove-update-channels']
6161
return os.path.join(get_git_root(), run_shell_command(cmd).split()[-3])
6262

6363

0 commit comments

Comments
 (0)