3 <script src=
"resources/cross-frame-access.js"></script>
5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.dumpChildFramesAsText();
8 testRunner
.waitUntilDone();
13 // Add manual run buttons if the browser does not support window.postMessage
14 if (!window
.postMessage
) {
15 log("YOUR BROWSER DOES NOT SUPPORT window.postMessage");
16 log("To run this test manually, first click the button titled 'Step 1 - Set Test' in this frame.");
17 log("Then click the button in the sub frame titled 'Step 2 - Set Check' to finish the test.\n");
19 var button
= document
.createElement("button");
20 button
.appendChild(document
.createTextNode("Step 1 - Set Test"));
21 button
.onclick
= setTest
;
22 document
.body
.appendChild(button
);
26 receiver = function(e
)
28 if (e
.data
== "storedOldValuesComplete")
31 addEventListener('message', receiver
, false);
35 window
.targetWindow
= frames
[0];
37 // Put testing for the many og standard attibutes of the location object is handeled in stand alone test
38 // cases because they may produce side effects.
39 try { targetWindow
.location
.assign
= "FAIL!! CUSTOM assign"; } catch(e
) { log(e
); }
40 try { targetWindow
.location
.replace
= "FAIL!! CUSTOM replace"; } catch(e
) { log(e
); }
41 try { targetWindow
.location
.reload
= "FAIL!! CUSTOM reload"; } catch(e
) { log(e
); }
42 try { targetWindow
.location
.toString
= "FAIL!! CUSTOM toString"; } catch(e
) { log(e
); }
44 try { targetWindow
.location
.customAttribute
= "FAIL!! CUSTOM customAttribute"; } catch(e
) { log(e
); }
46 if (window
.postMessage
)
47 targetWindow
.postMessage("settingValuesComplete", "*");
49 log("\nSet Test complete! Click button entitled 'Step 2 - Set Check' to finish the test.");
54 <iframe src=
"http://localhost:8000/security/resources/cross-frame-iframe-for-location-put-test.html"></iframe>
55 <pre id=
"console"></pre>