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

Side by Side 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, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <form method="GET" onsubmit="fail()">
3 <input type="file" oninvalid="pass()" required>
4 <input type="reset">
5 <input type="submit">
6 </form>
7 <pre id="console"></pre>
8 <script>
9 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
10 {
11 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n"));
12 }
13
14 function pass()
15 {
16 log("PASS: Reset file input failed to validate on submit");
17 if (window.testRunner)
18 testRunner.notifyDone();
19 }
20
21 function fail()
22 {
23 log("FAIL: Form validated ok and and was submitted.");
24 if (window.testRunner)
25 testRunner.notifyDone();
26 return false;
27 }
28
29 function startTest()
30 {
31 eventSender.beginDragWithFiles(['file-input-reset-validation.html']);
32 eventSender.mouseMoveTo(10, 10);
33 eventSender.mouseUp();
34 document.forms[0].querySelector("[type=reset]").click();
35 document.forms[0].querySelector("[type=submit]").click();
36 }
37
38 if (window.eventSender) {
39 testRunner.dumpAsText();
40 testRunner.waitUntilDone();
41 window.onload = startTest;
42 }
43 </script>
OLDNEW
« 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