Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <script> | |
| 4 | |
| 5 if (window.testRunner) { | |
| 6 testRunner.dumpAsText(); | |
| 7 testRunner.setCanOpenWindows(); | |
| 8 testRunner.waitUntilDone(); | |
| 9 } | |
| 10 | |
| 11 function log(message) | |
| 12 { | |
| 13 var console = document.getElementById("console"); | |
| 14 console.appendChild(document.createTextNode(message + "\n")); | |
| 15 } | |
| 16 | |
| 17 function zoomPage() | |
| 18 { | |
| 19 var newwindow = window.open("resources/dice.png"); | |
| 20 newwindow.onload = function() { | |
| 21 o = newwindow.document.createElement("div"); | |
| 22 o.setAttribute("id", "overlay"); | |
| 23 o.innerHTML = '<div class="modal fade" id="new-pin"><div class="modal-hea der"><h3>New Pin</h3></div><form name="testForm" action="" enctype="multipart/fo rm-data" method="get" id="ajaxform" name="pin_form" class="form-horizontal"><div class="modal-body"><div id="div_id_url" class="control-group"><label class="con trol-label" for="id_url">URL</label><div class="controls"><input type="text" nam e="url" id="id_url" /></div></div><div id="div_id_image" class="control-group">< label class="control-label" for="id_image">or Upload</label><div class="controls "><input type="file" name="image" id="id_image" /></div></div><div id="div_id_de scription" class="control-group"><label class="control-label" for="id_descriptio n">Description</label><div class="controls"><textarea id="id_description" rows=" 10" cols="40" name="description"></textarea></div></div><div id="div_id_tags" cl ass="control-group"><label class="control-label" for="id_tags">Tags</label><div class="controls"><input type="text" name="tags" id="id_tags" /></div></div></div ><div class="modal-footer"><div class="messageContainer"></div><button id="btnsu bmit" type="submit" class="btn btn-primary">Submit</button><a id="cancel" onclic k="removeOverlay()" data-toggle="modal" class="btn">Cancel</a></div></form></div >'; | |
|
pdr.
2013/10/10 19:34:22
Is all of this HTML necessary?
pdr.
2013/10/10 23:15:24
Please remove the unnecessary style data here (e.g
| |
| 24 newwindow.document.body.appendChild(o); | |
| 25 if (window.eventSender) { | |
| 26 newwindow.document.forms["testForm"]["url"].value = "fakeurl"; | |
| 27 newwindow.document.forms["testForm"]["description"].value = "som eimage"; | |
| 28 newwindow.document.forms["testForm"]["tags"].value = "image"; | |
| 29 newwindow.document.forms["testForm"].submit(); | |
| 30 log("Test Success"); | |
| 31 testRunner.notifyDone(); | |
| 32 } | |
| 33 | |
| 34 }; | |
| 35 } | |
| 36 </script> | |
| 37 <body onload="zoomPage()"> | |
| 38 <p>This tests that submitting an injected form on an "image page" doesn't crash the tab. This test requires testRunner to run. To test manually, open <a href=" resources/dice.png">this image</a> in a browser window, and inject script from t he page source and fill the form and press submit. It must not crash.</p> | |
| 39 <pre id="console"></pre> | |
| 40 </body> | |
| 41 </html> | |
| OLD | NEW |