Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / xss-DENIED-getSelection-from-inactive-domwindow.html
blob9300339b73c3241badc956493de7e6dc5f4508c7
1 <script>
2 if (window.testRunner) {
3 testRunner.dumpAsText();
4 testRunner.waitUntilDone();
7 window.onload = function()
9 frame = document.body.appendChild(document.createElement("iframe"));
10 wnd = frame.contentWindow;
11 func = wnd.Function;
13 wnd.location = "about:blank";
14 frame.onload = function() {
15 selection = func("return getSelection()")();
17 wnd.location = "http://localhost:8000/security/resources/innocent-victim.html";
18 frame.onload = function() {
19 frame.onload = null;
21 try {
22 selection.baseNode.constructor.constructor.constructor("alert(document.body.innerHTML)")()
23 } catch(ex) {
26 if (window.testRunner)
27 testRunner.notifyDone();
31 </script>
32 This tests passes if it doesn't alert the contents of innocent-victim.html.