Index: LayoutTests/fast/forms/form-submission-cancelable.html |
diff --git a/LayoutTests/fast/forms/form-submission-cancelable.html b/LayoutTests/fast/forms/form-submission-cancelable.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3518456fac7285bf4fd5b7e3bb3d00d98984b553 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/form-submission-cancelable.html |
@@ -0,0 +1,57 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<form method="GET" target="target"> |
+ <input name="query" value="AAA" /> |
+ <input type="submit" id="submitButton"/> |
+</form> |
+<form method="GET" target="target1"> |
+ <input name="query1" value="AAA" /> |
+ <input type="submit" id="submitButton1"/> |
+</form> |
+<iframe id="target" ></iframe> |
+<iframe id="target1" ></iframe> |
+<script> |
+description('Test that form submit within onsubmit event handlers are not delayed and sends the form data when invoked'); |
+var count = 2; |
+document.forms[0].onsubmit = function (event) { |
+ document.forms[0].submit(); |
+ document.forms[0].children.query.value = 'BBB'; |
+ return false; |
+} |
+ |
+document.forms[1].onsubmit = function (event) { |
+ document.forms[1].submit(); |
+ document.forms[1].children.query1.value = 'BBB'; |
+ return true; |
+} |
+ |
+document.getElementById('target').onload = function(event) { |
+ shouldBeEqualToString('event.target.contentWindow.location.search', '?query=AAA'); |
+ if (--count == 0) |
+ finishJSTest(); |
+} |
+ |
+document.getElementById('target1').onload = function(event) { |
+ shouldBeEqualToString('event.target.contentWindow.location.search', '?query1=BBB'); |
+ if (--count == 0) |
+ finishJSTest(); |
+} |
+ |
+window.onload = function() { |
+ document.getElementById('submitButton1').click(); |
+ document.getElementById('submitButton').click(); |
tkent
2014/03/17 06:39:20
Form submission and load events are asynchronous.
|
+} |
+ |
+if (window.testRunner) |
+ window.jsTestIsAsync = true; |
+</script> |
+</body> |
+</html> |
+ |
+ |
+ |
+ |