Skip to content

Commit 28f49a1

Browse files
committed
Firefox: Removing SDK extension tests and generalizing selenium tests to support FF
1 parent 4dc43c5 commit 28f49a1

File tree

12 files changed

+119
-171
lines changed

12 files changed

+119
-171
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "addon-sdk"]
2-
path = addon-sdk
3-
url = https://github.com/mozilla/addon-sdk.git
41
[submodule "translations"]
52
path = translations
63
url = https://git.torproject.org/translation.git

addon-sdk

Lines changed: 0 additions & 1 deletion
This file was deleted.

install-dev-dependencies.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ if type apt-get >/dev/null ; then
2020
# In Debian, `python-` is assumed to be python 2.7, no need to specify - dkg
2121
$SUDO_SHIM apt-get install libxml2-dev libxml2-utils libxslt1-dev \
2222
python-dev $BROWSERS zip sqlite3 python-pip libcurl4-openssl-dev xvfb \
23-
libssl-dev git $CHROMEDRIVER
23+
libssl-dev git curl $CHROMEDRIVER
24+
if ! type geckodriver >/dev/null; then
25+
curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-linux64.tar.gz"
26+
tar -zxvf "geckodriver-v0.16.1-linux64.tar.gz"
27+
rm -f "geckodriver-v0.16.1-linux64.tar.gz"
28+
$SUDO_SHIM mv geckodriver /usr/bin/geckodriver
29+
$SUDO_SHIM chown root /usr/bin/geckodriver
30+
$SUDO_SHIM chmod 755 /usr/bin/geckodriver
31+
fi
2432
elif type brew >/dev/null ; then
2533
brew list python &>/dev/null || brew install python
2634
brew install libxml2 gnu-sed chromedriver
@@ -42,9 +50,16 @@ elif type dnf >/dev/null ; then
4250
rm -f "chromedriver_linux$ARCH.zip"
4351
$SUDO_SHIM mv chromedriver /usr/bin/chromedriver
4452
$SUDO_SHIM chown root /usr/bin/chromedriver
45-
$SUDO_SHIM chmod +x /usr/bin/chromedriver
4653
$SUDO_SHIM chmod 755 /usr/bin/chromedriver
4754
fi
55+
if ! type geckodriver >/dev/null; then
56+
curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-macos.tar.gz"
57+
tar -zxvf "geckodriver-v0.16.1-macos.tar.gz"
58+
rm -f "geckodriver-v0.16.1-macos.tar.gz"
59+
$SUDO_SHIM mv geckodriver /usr/bin/geckodriver
60+
$SUDO_SHIM chown root /usr/bin/geckodriver
61+
$SUDO_SHIM chmod 755 /usr/bin/geckodriver
62+
fi
4863
# This is needed for Firefox on some systems. See here for more information:
4964
# https://github.com/EFForg/https-everywhere/pull/5584#issuecomment-238655443
5065
if [ ! -f /var/lib/dbus/machine-id ]; then

test/chromium.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ else
3939
./makecrx.sh
4040
echo "running tests"
4141
CRX_NAME="`ls -tr pkg/*.crx | tail -1`"
42-
$XVFB_RUN python2.7 test/chromium/script.py $CRX_NAME
42+
$XVFB_RUN python2.7 test/script.py Chrome $CRX_NAME
4343
fi

test/chromium/script.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

test/firefox.sh

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ fi
1414

1515
source utils/mktemp.sh
1616

17-
# dummy Jetpack addon that contains tests
18-
TEST_ADDON_PATH=./test/firefox/
19-
2017
# We'll create a Firefox profile here and install HTTPS Everywhere into it.
2118
PROFILE_DIRECTORY="$(mktemp -d)"
2219
trap 'rm -r "$PROFILE_DIRECTORY"' EXIT
@@ -38,10 +35,6 @@ die() {
3835
exit 1
3936
}
4037

41-
if [ ! -f "addon-sdk/bin/activate" ]; then
42-
die "Addon SDK not available. Run git submodule update."
43-
fi
44-
4538
if [ ! -d "$HTTPSE_INSTALL_DIRECTORY" ]; then
4639
die "Firefox profile does not have HTTPS Everywhere installed"
4740
fi
@@ -51,17 +44,6 @@ if [ -z "$XVFB_RUN" -a -n "$(which xvfb-run)" ]; then
5144
XVFB_RUN=xvfb-run
5245
fi
5346

54-
# Activate the Firefox Addon SDK.
55-
pushd addon-sdk
56-
source bin/activate
57-
popd
58-
59-
if ! type cfx > /dev/null; then
60-
die "Addon SDK failed to activiate."
61-
fi
62-
63-
pushd $TEST_ADDON_PATH
64-
6547
# If you just want to run Firefox with the latest code:
6648
if [ "$1" == "--justrun" ]; then
6749
echo "running firefox"
@@ -73,14 +55,11 @@ if [ "$1" == "--justrun" ]; then
7355
fi
7456
else
7557
echo "running tests"
58+
59+
PATH=/home/user/geckodriver:$PATH
7660
if [ -n "$FIREFOX" ]; then
77-
$XVFB_RUN cfx test -b $FIREFOX --profiledir="$PROFILE_DIRECTORY" --verbose
61+
$XVFB_RUN python2.7 test/script.py Firefox "$PROFILE_DIRECTORY" $FIREFOX
7862
else
79-
$XVFB_RUN cfx test --profiledir="$PROFILE_DIRECTORY" --verbose
63+
$XVFB_RUN python2.7 test/script.py Firefox "$PROFILE_DIRECTORY"
8064
fi
8165
fi
82-
83-
popd
84-
85-
shasum=$(openssl sha -sha256 "$XPI_NAME")
86-
echo -e "Git commit `git rev-parse HEAD`\n$shasum"

test/firefox/lib/main.js

Whitespace-only changes.

test/firefox/package.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/firefox/test/test-httpse-installed.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

test/firefox/test/test-main.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)