summaryrefslogtreecommitdiffstats
path: root/devtools
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-14 12:17:00 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-14 12:17:00 +0100
commitf4cc93fc9ee9059c44bb9bc28266b01397ede4a3 (patch)
tree617a6230d01f2d4100b88eb67ed0dd0df66322ed /devtools
parentd5a604bb8900875baec73b80554f7d1e540028af (diff)
downloadUXP-f4cc93fc9ee9059c44bb9bc28266b01397ede4a3.tar
UXP-f4cc93fc9ee9059c44bb9bc28266b01397ede4a3.tar.gz
UXP-f4cc93fc9ee9059c44bb9bc28266b01397ede4a3.tar.lz
UXP-f4cc93fc9ee9059c44bb9bc28266b01397ede4a3.tar.xz
UXP-f4cc93fc9ee9059c44bb9bc28266b01397ede4a3.zip
Issue #1289 - Part 3: Update tests.
Diffstat (limited to 'devtools')
-rw-r--r--devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js4
-rw-r--r--devtools/shared/webconsole/test/test_network_security-hpkp.html11
2 files changed, 10 insertions, 5 deletions
diff --git a/devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js b/devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js
index 3ee33669d..39870fd54 100644
--- a/devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js
+++ b/devtools/client/webconsole/test/browser_webconsole_hpkp_invalid-headers.js
@@ -14,14 +14,18 @@ const SJS_URL = "https://example.com/browser/devtools/client/webconsole/" +
"test/test_hpkp-invalid-headers.sjs";
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
"Public_Key_Pinning" + DOCS_GA_PARAMS;
+const HPKP_ENABLED_PREF = "security.cert_pinning.hpkp.enabled";
const NON_BUILTIN_ROOT_PREF = "security.cert_pinning.process_headers_from_" +
"non_builtin_roots";
add_task(function* () {
registerCleanupFunction(() => {
+ Services.prefs.clearUserPref(HPKP_ENABLED_PREF);
Services.prefs.clearUserPref(NON_BUILTIN_ROOT_PREF);
});
+ Services.prefs.setBoolPref(HPKP_ENABLED_PREF, true);
+
yield loadTab(TEST_URI);
let hud = yield openConsole();
diff --git a/devtools/shared/webconsole/test/test_network_security-hpkp.html b/devtools/shared/webconsole/test/test_network_security-hpkp.html
index 55e2621a8..bc1a9642c 100644
--- a/devtools/shared/webconsole/test/test_network_security-hpkp.html
+++ b/devtools/shared/webconsole/test/test_network_security-hpkp.html
@@ -17,7 +17,8 @@
SimpleTest.waitForExplicitFinish();
let gCurrentTestCase = -1;
-const HPKP_PREF = "security.cert_pinning.process_headers_from_non_builtin_roots";
+const HPKP_ENABLED_PREF = "security.cert_pinning.hpkp.enabled";
+const PROCESS_HPKP_FROM_NON_BUILTIN_ROOTS_PREF = "security.cert_pinning.process_headers_from_non_builtin_roots";
// Static pins tested by unit/test_security-info-static-hpkp.js.
const TEST_CASES = [
@@ -41,11 +42,11 @@ const TEST_CASES = [
function startTest()
{
- // Need to enable this pref or pinning headers are rejected due test
- // certificate.
- Services.prefs.setBoolPref(HPKP_PREF, true);
+ Services.prefs.setBoolPref(HPKP_ENABLED_PREF, true);
+ Services.prefs.setBoolPref(PROCESS_HPKP_FROM_NON_BUILTIN_ROOTS_PREF, true);
SimpleTest.registerCleanupFunction(() => {
- Services.prefs.setBoolPref(HPKP_PREF, false);
+ Services.prefs.setBoolPref(HPKP_ENABLED_PREF, false);
+ Services.prefs.setBoolPref(PROCESS_HPKP_FROM_NON_BUILTIN_ROOTS_PREF, false);
// Reset pinning state.
let gSSService = Cc["@mozilla.org/ssservice;1"]