Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Unified Diff: LayoutTests/fast/images/image-page-injected-script-crash.html

Issue 25417007: Handle crash when submitting an injected form on an "image page". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test cleanup and rebase code. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/images/image-page-injected-script-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..34ec9f22d17d89ad5760718d7e2cec29af7c347f
--- /dev/null
+++ b/LayoutTests/fast/images/image-page-injected-script-crash.html
@@ -0,0 +1,46 @@
+<!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 = '<form name="testForm" action="" enctype="multipart/form-data" method="get" id="ajaxform" name="pin_form" class="form-horizontal"><input type="text" name="url" id="id_url" /><button id="btnsubmit" type="submit" class="btn btn-primary">Submit</button></form>';
+ newwindow.document.body.appendChild(o);
+ if (window.eventSender) {
+ newwindow.document.forms["testForm"]["url"].value = "some-url";
+ newwindow.document.forms["testForm"].submit();
+
+ setTimeout(function(){
+ if(newwindow.location.search == "?url=some-url")
+ log("Test Success");
+ else
+ log("Test failed: URL passed: " + newwindow.location.search);
+ testRunner.notifyDone();
+ },3000);
+
+ }
+
+ };
+}
+</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 and the url must have ?url=some-url as the parameter.</p>
+<pre id="console"></pre>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/images/image-page-injected-script-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698