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

Side by Side Diff: LayoutTests/fast/forms/file/file-input-empty-validation.html

Issue 132233059: Synchronize is-valid flag upon programmatic clearing of file.value (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-empty-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 <script src="../../../resources/js-test.js"></script>
3 <form method="GET" onsubmit="finish(false)">
4 <input type="file" oninvalid="finish(true)" required>
5 <input type="submit">
6 </form>
7 <pre id="console"></pre>
8 <script>
9 description("This tests that a file input cleared of its (required) value doesn' t validate.");
10
11 var invalid = false;
12 function finish(pass)
13 {
14 invalid = pass;
15 shouldBeTrue("invalid");
16 finishJSTest();
17 }
18
19 function moveMouseToCenterOfElement(element) {
20 var centerX = element.offsetLeft + element.offsetWidth / 2;
21 var centerY = element.offsetTop + element.offsetHeight / 2;
22 eventSender.mouseMoveTo(centerX, centerY);
23 }
24
25 function dragFilesOntoInput(input, files) {
26 eventSender.beginDragWithFiles(files);
27 moveMouseToCenterOfElement(input);
28 eventSender.mouseUp();
29 }
30
31 function startTest()
32 {
33 dragFilesOntoInput(document.forms[0].querySelector("[type=file]"), ['file-in put-empty-validation.html']);
34 document.forms[0].querySelector("[type=file]").value = "";
35 document.forms[0].querySelector("[type=submit]").click();
36 }
37
38 if (window.eventSender) {
39 window.jsTestIsAsync = true;
40 testRunner.dumpAsText();
tkent 2014/01/29 23:36:26 nit: You don't need dumpAsText(). js-test.js call
41 testRunner.waitUntilDone();
tkent 2014/01/29 23:36:26 nit: You don't need dumpAsText(). js-test.js call
42 window.onload = startTest;
43 }
44 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/file/file-input-empty-validation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698