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

Unified Diff: LayoutTests/fast/forms/submit-onFocus-invalidForm.html

Issue 199633017: Blink doesnt respect the form.submit() when called on "focus" event for invalid form (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed unnecessary lines from Layout Test Created 6 years, 9 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/forms/submit-onFocus-invalidForm-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/submit-onFocus-invalidForm.html
diff --git a/LayoutTests/fast/forms/submit-onFocus-invalidForm.html b/LayoutTests/fast/forms/submit-onFocus-invalidForm.html
new file mode 100644
index 0000000000000000000000000000000000000000..e5d0afd23127f692e5cc3a1e2239662699c0aa62
--- /dev/null
+++ b/LayoutTests/fast/forms/submit-onFocus-invalidForm.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<form method="GET" target="target" id="form">
+ <input name="query" value="AAA" pattern="banana|cherry" onfocus="onFocus(event)"/>
+ <input type="submit" id="submitButton"/>
+</form>
+<iframe id="target" name="target"></iframe>
+<script>
+description('Test that form.submit() when called on "focus" event for invalid form should submit the form');
+
+function onFocus(event) {
+ var form = document.getElementById('form');
+ form.action = '#foo';
+ form.submit();
+}
+
+document.getElementById('target').onload = function(event) {
+ // This should return back query AAA
+ var query = event.target.contentWindow.location.search;
+ if (query === '?query=AAA') {
+ testPassed('Form is successfully submitted and content is loaded in the frame');
+ finishJSTest();
+ }
+}
+
+window.onload = function() {
+ document.getElementById('submitButton').click();
+}
+
+if (window.testRunner)
+ window.jsTestIsAsync = true;
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/submit-onFocus-invalidForm-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698