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

Unified Diff: LayoutTests/fast/forms/file/file-input-reset-validation.html

Issue 148463008: Update is-valid flag upon resetting input elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/file/file-input-reset-validation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/file/file-input-reset-validation.html
diff --git a/LayoutTests/fast/forms/file/file-input-reset-validation.html b/LayoutTests/fast/forms/file/file-input-reset-validation.html
new file mode 100644
index 0000000000000000000000000000000000000000..baf1667afc281081094327f8d7c90235a6731f25
--- /dev/null
+++ b/LayoutTests/fast/forms/file/file-input-reset-validation.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<form method="GET" onsubmit="fail()">
+<input type="file" oninvalid="pass()" required>
+<input type="reset">
+<input type="submit">
+</form>
+<pre id="console"></pre>
+<script>
+function log(message)
tkent 2014/01/28 11:05:46 nit: I recommend to use js-test.js.
sof 2014/01/28 11:38:51 Thanks, good idea. Switched over now. (There's an
+{
+ document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
+}
+
+function pass()
+{
+ log("PASS: Reset file input failed to validate on submit");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+function fail()
+{
+ log("FAIL: Form validated ok and and was submitted.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ return false;
+}
+
+function startTest()
+{
+ eventSender.beginDragWithFiles(['file-input-reset-validation.html']);
+ eventSender.mouseMoveTo(10, 10);
+ eventSender.mouseUp();
+ document.forms[0].querySelector("[type=reset]").click();
+ document.forms[0].querySelector("[type=submit]").click();
+}
+
+if (window.eventSender) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ window.onload = startTest;
+}
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/file/file-input-reset-validation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698