mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1054572 - Reload iframe in test_classifier.html to test cache API calls in nsChannelClassifier.cpp r=gcp
This commit is contained in:
parent
dd1d112130
commit
197fb2b272
@ -15,6 +15,15 @@ function checkLoads() {
|
||||
var style = document.defaultView.getComputedStyle(elt, "");
|
||||
window.parent.isnot(style.visibility, "hidden", "Should not load bad css");
|
||||
|
||||
// Call parent.loadTestFrame again to test classification metadata in HTTP
|
||||
// cache entries.
|
||||
if (window.parent.firstLoad) {
|
||||
window.parent.info("Reloading from cache...");
|
||||
window.parent.firstLoad = false;
|
||||
window.parent.loadTestFrame();
|
||||
return;
|
||||
}
|
||||
|
||||
// End (parent) test.
|
||||
window.parent.SimpleTest.finish();
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
var Cc = SpecialPowers.Cc;
|
||||
var Ci = SpecialPowers.Ci;
|
||||
var firstLoad = true;
|
||||
|
||||
// Add some URLs to the malware database.
|
||||
var testData = "malware.example.com/";
|
||||
@ -26,6 +27,10 @@ var testUpdate =
|
||||
var dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
|
||||
.getService(Ci.nsIUrlClassifierDBService);
|
||||
|
||||
function loadTestFrame() {
|
||||
document.getElementById("testFrame").src = "classifierFrame.html";
|
||||
}
|
||||
|
||||
function doUpdate(update) {
|
||||
var listener = {
|
||||
QueryInterface: function(iid)
|
||||
@ -46,10 +51,7 @@ function doUpdate(update) {
|
||||
updateSuccess: function(requestedTimeout) {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{"set" : [["browser.safebrowsing.malware.enabled", true]]},
|
||||
function loadTestFrame() {
|
||||
document.getElementById("testFrame").src = "classifierFrame.html";
|
||||
}
|
||||
);
|
||||
loadTestFrame);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user