| OLD | NEW |
| 1 <div id="container"> | 1 <div id="container"> |
| 2 <p>You should run this test in Test Runner</p> | 2 <p>You should run this test in Test Runner</p> |
| 3 <form method="post" action="resources/post-with-modifier.php"> | 3 <form method="post" action="resources/post-with-modifier.php"> |
| 4 <input type="hidden" name="a" value="b"> | 4 <input type="hidden" name="a" value="b"> |
| 5 <input type="submit"> | 5 <input type="submit"> |
| 6 </form> | 6 </form> |
| 7 </div> | 7 </div> |
| 8 <div id="console"></div> | 8 <div id="console"></div> |
| 9 <script src="/js-test-resources/js-test.js"></script> | |
| 10 <script> | 9 <script> |
| 11 var results; | |
| 12 function concludeTest(data) | |
| 13 { | |
| 14 results = data; | |
| 15 shouldBeEqualToString('results["method"]', 'POST'); | |
| 16 shouldBeEqualToString('results["formValue"]', 'b'); | |
| 17 | |
| 18 document.getElementById('container').outerHTML = ''; | |
| 19 finishJSTest(); | |
| 20 } | |
| 21 | |
| 22 if (window.testRunner) { | 10 if (window.testRunner) { |
| 23 window.jsTestIsAsync = true; | 11 testRunner.dumpAsText(); |
| 24 testRunner.setCanOpenWindows(true); | 12 testRunner.setCanOpenWindows(true); |
| 25 testRunner.setCloseRemainingWindowsWhenComplete(true); | 13 testRunner.setCloseRemainingWindowsWhenComplete(true); |
| 14 testRunner.waitUntilDone(); |
| 26 | 15 |
| 27 window.onload = function() { | 16 window.onload = function() { |
| 28 var submit = document.querySelector('input[type="submit"]'); | 17 var submit = document.querySelector('input[type="submit"]'); |
| 29 eventSender.dragMode = false; | 18 eventSender.dragMode = false; |
| 30 eventSender.mouseMoveTo(submit.offsetLeft + 3, submit.offsetTop + 3); | 19 eventSender.mouseMoveTo(submit.offsetLeft + 3, submit.offsetTop + 3); |
| 31 eventSender.mouseDown(0); | 20 eventSender.mouseDown(0); |
| 32 eventSender.mouseUp(0, ['shiftKey']); | 21 eventSender.mouseUp(0, ['shiftKey']); |
| 33 }; | 22 }; |
| 34 | |
| 35 // Shift-clicking doesn't set window.opener, so we allow the new window | |
| 36 // to find the opener using the name being set below. | |
| 37 // TODO(lukasza): After fixing https://crbug.com/658386, the test will | |
| 38 // need to use another mechanism for communicating verification results | |
| 39 // (most likely OOPIF-replicated testRunner.setCustomTextOutput). | |
| 40 window.name = "mainTestWindow"; | |
| 41 window.addEventListener('message', function(e) { | |
| 42 concludeTest(e.data); | |
| 43 }); | |
| 44 } | 23 } |
| 45 </script> | 24 </script> |
| OLD | NEW |