diff options
Diffstat (limited to 'third_party/WebKit/LayoutTests')
5 files changed, 57 insertions, 3 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-empty-validation-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-empty-validation-expected.txt new file mode 100644 index 0000000..d4bb668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-empty-validation-expected.txt @@ -0,0 +1,12 @@ +ValidationMessageClient: main-message=Please select a file. sub-message= + +This tests that a file input cleared of its (required) value doesn't validate. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS invalid is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-empty-validation.html b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-empty-validation.html new file mode 100644 index 0000000..26c12a3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-empty-validation.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<script src="../../../resources/js-test.js"></script> +<form method="GET" onsubmit="finish(false)"> +<input type="file" oninvalid="finish(true)" required> +<input type="submit"> +</form> +<pre id="console"></pre> +<script> +description("This tests that a file input cleared of its (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-empty-validation.html']); + document.forms[0].querySelector("[type=file]").value = ""; + document.forms[0].querySelector("[type=submit]").click(); +} + +if (window.eventSender) { + window.jsTestIsAsync = true; + testRunner.dumpAsText(); + window.onload = startTest; +} +</script> diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-reset-validation.html b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-reset-validation.html index 6287054..1ba34e6 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-reset-validation.html +++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-reset-validation.html @@ -39,7 +39,6 @@ function startTest() if (window.eventSender) { window.jsTestIsAsync = true; testRunner.dumpAsText(); - testRunner.waitUntilDone(); window.onload = startTest; } </script> diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-setrangetext-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/file/file-setrangetext-expected.txt index 577f0a3..c9e7963 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/file/file-setrangetext-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-setrangetext-expected.txt @@ -6,7 +6,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE Running tests on input with attributes: {"type":"file"} -PASS element.value = '0123456789XYZ' threw exception InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programatically set to the empty string.. +PASS element.value = '0123456789XYZ' threw exception InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.. PASS element.setRangeText('ABC', 0, 0) threw exception InvalidStateError: Failed to execute 'setRangeText' on 'HTMLInputElement': The input element's type ('file') does not support selection.. PASS element.value is "" PASS successfullyParsed is true diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/input-file-value-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/file/input-file-value-expected.txt index 018226a..b21306d 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/file/input-file-value-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/file/input-file-value-expected.txt @@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE PASS file.value is "C:\\fakepath\\foo.txt" PASS file.files.length is 1 -PASS file.value = 'foo' threw exception InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programatically set to the empty string.. +PASS file.value = 'foo' threw exception InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.. PASS file.value is "C:\\fakepath\\foo.txt" PASS file.files.length is 1 PASS file.value is "" |