Skip to content

Commit f9fe700

Browse files
authored
Fix tests by ensuring UX controls only appear after being set (EFForg#13912)
* Change version of geckodriver in dev environment to be standard with tests * Move scripts back to header
1 parent dd5efb7 commit f9fe700

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

chromium/popup.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@
55
<title data-i18n="about_ext_name"></title>
66

77
<link href="popup.css" rel="stylesheet">
8+
<script src="popup.js"></script>
9+
<script src="translation.js"></script>
10+
<script src="send-message.js"></script>
811
</head>
912
<body>
1013
<header>
1114
<h1 data-i18n="about_ext_name"></h1>
1215
</header>
1316

14-
<section id="disableButton" class="options">
17+
<section id="disableButton" class="options" style="visibility: hidden;">
1518
<div class="onoffswitch">
1619
<input id="onoffswitch" type="checkbox" checked>
1720
<label data-i18n="menu_globalEnable" for="onoffswitch"></label>
1821
</div>
1922
</section>
2023

21-
<section id="HttpNowhere" class="options">
24+
<section id="HttpNowhere" class="options" style="visibility: hidden;">
2225
<input id="http-nowhere-checkbox" type="checkbox">
2326
<label data-i18n="menu_blockUnencryptedRequests" for="http-nowhere-checkbox"></label>
2427
</section>
@@ -69,8 +72,5 @@ <h3 data-i18n="chrome_experimental_rules"></h3>
6972
<p><small>(<span data-i18n="about_version">Version</span>: <span id="current-version"></span>)</small></p>
7073
</footer>
7174

72-
<script src="popup.js"></script>
73-
<script src="translation.js"></script>
74-
<script src="send-message.js"></script>
7575
</body>
7676
</html>

chromium/popup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ function showHttpNowhereUI() {
8989
if (item.httpNowhere) {
9090
e('http-nowhere-checkbox').checked = true;
9191
}
92-
show(e('HttpNowhere'));
92+
e('HttpNowhere').style.visibility = "visible";
9393
});
9494
};
9595

9696
// Change the UI to reflect extension enabled/disabled
9797
function updateEnabledDisabledUI() {
9898
getOption_('globalEnabled', true, function(item) {
9999
document.getElementById('onoffswitch').checked = item.globalEnabled;
100-
show(e('disableButton'));
100+
e('disableButton').style.visibility = "visible";
101101
// Hide or show the rules sections
102102
if (item.globalEnabled) {
103103
document.body.className = ""

install-dev-dependencies.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ if type apt-get >/dev/null ; then
3939
python-dev $BROWSERS zip sqlite3 python-pip libcurl4-openssl-dev xvfb \
4040
libssl-dev git curl $CHROMEDRIVER
4141
if ! type geckodriver >/dev/null; then
42-
curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-linux64.tar.gz"
43-
tar -zxvf "geckodriver-v0.16.1-linux64.tar.gz"
44-
rm -f "geckodriver-v0.16.1-linux64.tar.gz"
42+
curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz"
43+
tar -zxvf "geckodriver-v0.17.0-linux64.tar.gz"
44+
rm -f "geckodriver-v0.17.0-linux64.tar.gz"
4545
$SUDO_SHIM mv geckodriver /usr/bin/geckodriver
4646
$SUDO_SHIM chown root /usr/bin/geckodriver
4747
$SUDO_SHIM chmod 755 /usr/bin/geckodriver
@@ -73,9 +73,9 @@ elif type dnf >/dev/null ; then
7373
$SUDO_SHIM chmod 755 /usr/bin/chromedriver
7474
fi
7575
if ! type geckodriver >/dev/null; then
76-
curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-macos.tar.gz"
77-
tar -zxvf "geckodriver-v0.16.1-macos.tar.gz"
78-
rm -f "geckodriver-v0.16.1-macos.tar.gz"
76+
curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-macos.tar.gz"
77+
tar -zxvf "geckodriver-v0.17.0-macos.tar.gz"
78+
rm -f "geckodriver-v0.17.0-macos.tar.gz"
7979
$SUDO_SHIM mv geckodriver /usr/bin/geckodriver
8080
$SUDO_SHIM chown root /usr/bin/geckodriver
8181
$SUDO_SHIM chmod 755 /usr/bin/geckodriver

test/selenium/shim.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ def install_ext_on_ff(driver, extension_path):
6868
included in Selenium. See https://github.com/SeleniumHQ/selenium/issues/4215
6969
'''
7070
command = 'addonInstall'
71-
driver.command_executor._commands[command] = ('POST', '/session/$sessionId/moz/addon/install')
72-
driver.execute(command, params={'path': extension_path, 'temporary': True})
71+
driver.install_addon(extension_path, temporary = True)
7372
time.sleep(2)
7473

7574

0 commit comments

Comments
 (0)