mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1720535: Add https-first-disabled annotation to mochitest harness r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D119970
This commit is contained in:
parent
adf989bb23
commit
5a0e65f9c3
@ -110,6 +110,7 @@
|
||||
function browserTest(aTestFile) {
|
||||
this.path = aTestFile['url'];
|
||||
this.expected = aTestFile['expected'];
|
||||
this.https_first_disabled = aTestFile['https_first_disabled'] || false,
|
||||
this.dumper = gDumper;
|
||||
this.results = [];
|
||||
this.scope = null;
|
||||
|
@ -797,6 +797,14 @@ Tester.prototype = {
|
||||
name
|
||||
);
|
||||
let time = Date.now() - this.lastStartTime;
|
||||
|
||||
// HTTPS-First (Bug 1704453) TODO: in case a test is annoated
|
||||
// with https_first_disabled then we explicitly flip the pref
|
||||
// dom.security.https_first to false for the duration of the test.
|
||||
if (this.currentTest.https_first_disabled) {
|
||||
window.SpecialPowers.popPrefEnv();
|
||||
}
|
||||
|
||||
this.structuredLogger.testEnd(
|
||||
this.currentTest.path,
|
||||
"OK",
|
||||
@ -955,6 +963,15 @@ Tester.prototype = {
|
||||
));
|
||||
let currentTest = this.currentTest;
|
||||
|
||||
// HTTPS-First (Bug 1704453) TODO: in case a test is annoated
|
||||
// with https_first_disabled then we explicitly flip the pref
|
||||
// dom.security.https_first to false for the duration of the test.
|
||||
if (currentTest.https_first_disabled) {
|
||||
window.SpecialPowers.pushPrefEnv({
|
||||
set: [["dom.security.https_first", false]],
|
||||
});
|
||||
}
|
||||
|
||||
// Import utils in the test scope.
|
||||
let { scope } = this.currentTest;
|
||||
scope.EventUtils = this.EventUtils;
|
||||
|
@ -30,6 +30,7 @@ function parseTestManifest(testManifest, params, callback) {
|
||||
test: {
|
||||
url: name,
|
||||
expected: obj.expected,
|
||||
https_first_disabled: obj.https_first_disabled,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
@ -41,6 +42,7 @@ function parseTestManifest(testManifest, params, callback) {
|
||||
test: {
|
||||
url: name,
|
||||
expected: obj.expected,
|
||||
https_first_disabled: obj.https_first_disabled,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -1627,6 +1627,8 @@ toolbar#nav-bar {
|
||||
testob["disabled"] = test["disabled"]
|
||||
if "expected" in test:
|
||||
testob["expected"] = test["expected"]
|
||||
if "https_first_disabled" in test:
|
||||
testob["https_first_disabled"] = test["https_first_disabled"] == "true"
|
||||
if "scheme" in test:
|
||||
testob["scheme"] = test["scheme"]
|
||||
if "tags" in test:
|
||||
|
Loading…
Reference in New Issue
Block a user