diff --git a/dom/security/test/csp/file_data_csp_inheritance.html b/dom/security/test/csp/file_data_csp_inheritance.html index 299c30255aa6..cbb4865343db 100644 --- a/dom/security/test/csp/file_data_csp_inheritance.html +++ b/dom/security/test/csp/file_data_csp_inheritance.html @@ -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}, "*"); diff --git a/dom/security/test/csp/test_data_csp_inheritance.html b/dom/security/test/csp/test_data_csp_inheritance.html index 3afc4f7c02bc..bde2f5617e65 100644 --- a/dom/security/test/csp/test_data_csp_inheritance.html +++ b/dom/security/test/csp/test_data_csp_inheritance.html @@ -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(); }