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

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: Switch test over to use js-test.js 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..628705495126751065bb795c5b1fdad3a97f6566
--- /dev/null
+++ b/LayoutTests/fast/forms/file/file-input-reset-validation.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<form method="GET" onsubmit="finish(false)">
+<input type="file" oninvalid="finish(true)" required>
+<input type="reset">
+<input type="submit">
+</form>
+<pre id="console"></pre>
+<script>
+description("This tests that a reset file input with a required value doesn't validate.");
+
+var invalid = false;
+function finish(pass)
+{
+ invalid = pass;
+ shouldBeTrue("invalid");
+ finishJSTest();
+}
+
+function moveMouseToCenterOfElement(element) {
+ var centerX = element.offsetLeft + element.offsetWidth / 2;
+ var centerY = element.offsetTop + element.offsetHeight / 2;
+ eventSender.mouseMoveTo(centerX, centerY);
+}
+
+function dragFilesOntoInput(input, files) {
+ eventSender.beginDragWithFiles(files);
+ moveMouseToCenterOfElement(input);
+ eventSender.mouseUp();
+}
+
+function startTest()
+{
+ dragFilesOntoInput(document.forms[0].querySelector("[type=file]"), ['file-input-reset-validation.html']);
+ document.forms[0].querySelector("[type=reset]").click();
+ document.forms[0].querySelector("[type=submit]").click();
+}
+
+if (window.eventSender) {
+ window.jsTestIsAsync = true;
+ 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