// Adding a new category dispatches an event to update
// caches, so we need to also dispatch an event to make
// sure we don't start the load until after that happens.
Services.tm.dispatchToMainThread(() => {
sendAsyncMessage("setupComplete");
});
}
// Request creating functions
function requestDocument() {
// GeckoView shows an error page for CSP errors, which breaks this test, so just skip in that case.
try {
if (!SpecialPowers.Cc["@mozilla.org/android/bridge;1"].getService(SpecialPowers.Ci.nsIGeckoViewBridge).isFennec) {
return false;
}
} catch (e){}
top.location.href = testURL;
return true;
}
function requestSubdocument() { var content = $("content");
add_task(async function() {
let chromeScript = SpecialPowers.loadChromeScript(createChromeScript);
await chromeScript.promiseOneMessage("setupComplete");
if (requestDocument()) {
let result = await chromeScript.promiseOneMessage("loadBlocked");
is(result.policyType, SpecialPowers.Ci.nsIContentPolicy.TYPE_DOCUMENT, "Content policies triggered for TYPE_DOCUMENT");
}
requestSubdocument();
result = await chromeScript.promiseOneMessage("loadBlocked");
is(result.policyType, SpecialPowers.Ci.nsIContentPolicy.TYPE_SUBDOCUMENT, "Content policies triggered for TYPE_SUBDOCUMENT");
requestObject();
result = await chromeScript.promiseOneMessage("loadBlocked");
is(result.policyType, SpecialPowers.Ci.nsIContentPolicy.TYPE_OBJECT, "Content policies triggered for TYPE_OBJECT");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.