зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1296201 - Wait for SafeBrowsing,jsm to be initialized before running testcase. r=francois
MozReview-Commit-ID: 8o3cszqJK36 --HG-- extra : rebase_source : 92816999a5704f1e5854db713352d7f8f5280412
This commit is contained in:
Родитель
71297dcaaf
Коммит
d7abe4a988
|
@ -49,7 +49,8 @@ SpecialPowers.pushPrefEnv(
|
|||
{"set" : [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple"],
|
||||
["urlclassifier.phishTable", "test-phish-simple"]]},
|
||||
function() {
|
||||
classifierHelper.addUrlToDB(testData)
|
||||
classifierHelper.waitForInit()
|
||||
.then(() => { classifierHelper.addUrlToDB(testData); })
|
||||
.then(updateSuccess)
|
||||
.catch(err => {
|
||||
updateError(err);
|
||||
|
|
|
@ -56,7 +56,8 @@ SpecialPowers.pushPrefEnv(
|
|||
{"set" : [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple"],
|
||||
["urlclassifier.phishTable", "test-phish-simple"]]},
|
||||
function() {
|
||||
classifierHelper.addUrlToDB(testData)
|
||||
classifierHelper.waitForInit()
|
||||
.then(() => { classifierHelper.addUrlToDB(testData); })
|
||||
.then(updateSuccess)
|
||||
.catch(err => {
|
||||
updateError(err);
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
SpecialPowers.clearUserPref(PREF);
|
||||
}
|
||||
|
||||
function addMalewareUrlToDB() {
|
||||
function setup() {
|
||||
var testData = [
|
||||
{ url: "malware.example.com/",
|
||||
db: "test-malware-simple"
|
||||
|
@ -133,7 +133,8 @@
|
|||
|
||||
function runTest() {
|
||||
Promise.resolve()
|
||||
.then(addMalewareUrlToDB)
|
||||
.then(classifierHelper.waitForInit)
|
||||
.then(setup)
|
||||
.then(testValidTrack)
|
||||
.then(testBlacklistTrackSafebrowsingOff)
|
||||
.then(testBlacklistTrackSafebrowsingOn)
|
||||
|
|
|
@ -106,7 +106,7 @@ function setup404() {
|
|||
]);
|
||||
}
|
||||
|
||||
function setupCompletion() {
|
||||
function setup() {
|
||||
classifierHelper.allowCompletion([MALWARE_LIST, UNWANTED_LIST], GETHASH_URL);
|
||||
|
||||
return Promise.all([
|
||||
|
@ -125,7 +125,8 @@ function reset() {
|
|||
function runTest() {
|
||||
Promise.resolve()
|
||||
// This test resources get blocked when gethash returns successfully
|
||||
.then(setupCompletion)
|
||||
.then(classifierHelper.waitForInit)
|
||||
.then(setup)
|
||||
.then(() => loadTestFrame("testFrame1"))
|
||||
.then(reset)
|
||||
// This test resources are not blocked when gethash returns an error
|
||||
|
|
Загрузка…
Ссылка в новой задаче