Index: LayoutTests/fast/images/image-page-injected-script-crash.html |
diff --git a/LayoutTests/fast/images/image-page-injected-script-crash.html b/LayoutTests/fast/images/image-page-injected-script-crash.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9da105de64ccd46a7677b45f4dae463888cbbe3b |
--- /dev/null |
+++ b/LayoutTests/fast/images/image-page-injected-script-crash.html |
@@ -0,0 +1,41 @@ |
+<!DOCTYPE html> |
+<html> |
+<script> |
+ |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.setCanOpenWindows(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+function log(message) |
+{ |
+ var console = document.getElementById("console"); |
+ console.appendChild(document.createTextNode(message + "\n")); |
+} |
+ |
+function zoomPage() |
+{ |
+ var newwindow = window.open("resources/dice.png"); |
+ newwindow.onload = function() { |
+ o = newwindow.document.createElement("div"); |
+ o.setAttribute("id", "overlay"); |
+ o.innerHTML = '<div class="modal fade" id="new-pin"><div class="modal-header"><h3>New Pin</h3></div><form name="testForm" action="" enctype="multipart/form-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="control-label" for="id_url">URL</label><div class="controls"><input type="text" name="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_description" class="control-group"><label class="control-label" for="id_description">Description</label><div class="controls"><textarea id="id_description" rows="10" cols="40" name="description"></textarea></div></div><div id="div_id_tags" class="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="btnsubmit" type="submit" class="btn btn-primary">Submit</button><a id="cancel" onclick="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
|
+ newwindow.document.body.appendChild(o); |
+ if (window.eventSender) { |
+ newwindow.document.forms["testForm"]["url"].value = "fakeurl"; |
+ newwindow.document.forms["testForm"]["description"].value = "someimage"; |
+ newwindow.document.forms["testForm"]["tags"].value = "image"; |
+ newwindow.document.forms["testForm"].submit(); |
+ log("Test Success"); |
+ testRunner.notifyDone(); |
+ } |
+ |
+ }; |
+} |
+</script> |
+<body onload="zoomPage()"> |
+<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 the page source and fill the form and press submit. It must not crash.</p> |
+<pre id="console"></pre> |
+</body> |
+</html> |