// Please note that 'fakeServer' does not exist because the test relies
// on "csp-on-violate-policy" , and "specialpowers-http-notify-request"
// which fire if either the request is blocked or fires. The test does
// not rely on the result of the load.
function fail() {
ok(false, "Should not call this")
}
function examiner() {
SpecialPowers.addObserver(this, "csp-on-violate-policy");
SpecialPowers.addObserver(this, "specialpowers-http-notify-request");
}
examiner.prototype = {
observe(subject, topic, data) {
if (topic === "csp-on-violate-policy") {
let asciiSpec = SpecialPowers.getPrivilegedProps(
SpecialPowers.do_QueryInterface(subject, "nsIURI"), "asciiSpec");
if (asciiSpec.includes("fakeServer")) {
ok (false, "Should not attempt fetch, not even blocked by CSP.");
}
}
if (topic === "specialpowers-http-notify-request") {
if (data.includes("fakeServer")) {
ok (false, "Should not try fetch");
}
}
},
remove() {
SpecialPowers.removeObserver(this, "csp-on-violate-policy");
SpecialPowers.removeObserver(this, "specialpowers-http-notify-request");
}
}
window.examiner = new examiner();
let div = document.getElementsByTagName("div")[0]; div.innerHTML = "