зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1387811 - Follow up for Test within Bug 1381761: CSP JSON is never null, hence it's better to check actual contents of JSON for testing. r=dveditz
This commit is contained in:
Родитель
a5f2311154
Коммит
a1341ccf6d
|
@ -13,8 +13,10 @@
|
|||
var frame = document.getElementById("dataFrame");
|
||||
var principal = SpecialPowers.wrap(frame.contentDocument).nodePrincipal;
|
||||
var cspJSON = principal.cspJSON;
|
||||
var result = principal.cspJSON ? "dataInheritsCSP" : "dataDoesNotInheritCSP";
|
||||
window.parent.postMessage({result}, "*");
|
||||
var cspOBJ = JSON.parse(principal.cspJSON);
|
||||
// make sure we got >>one<< policy
|
||||
var policies = cspOBJ["csp-policies"];
|
||||
window.parent.postMessage({result: policies.length}, "*");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -22,7 +22,9 @@ SimpleTest.waitForExplicitFinish();
|
|||
window.addEventListener("message", receiveMessage);
|
||||
function receiveMessage(event) {
|
||||
window.removeEventListener("message", receiveMessage);
|
||||
is(event.data.result, "dataInheritsCSP",
|
||||
// toplevel CSP should apply to data: URI iframe hence resulting
|
||||
// in 1 applied policy.
|
||||
is(event.data.result, 1,
|
||||
"data: URI iframe inherits CSP from including context");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче