Index: LayoutTests/imported/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-customError.html |
diff --git a/LayoutTests/imported/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-customError.html b/LayoutTests/imported/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-customError.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..230d6d5a632fdbfbd20cfb74fe345f929f7408d9 |
--- /dev/null |
+++ b/LayoutTests/imported/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-customError.html |
@@ -0,0 +1,48 @@ |
+<!DOCTYPE html> |
+<meta charset="utf-8"> |
+<title>The constraint validation API Test: element.validity.customError</title> |
+<link rel="author" title="Intel" href="http://www.intel.com/"> |
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-customerror"> |
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-constraint-validation-api"> |
+<script src="../../../../../../resources/testharness.js"></script> |
+<script src="../../../../../../resources/testharnessreport.js"></script> |
+<script src="support/validator.js"></script> |
+<div id="log"></div> |
+<script> |
+var testElements = [ |
+ { |
+ tag: "input", |
+ types: [], |
+ testData: [ |
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"}, |
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false if the custom validity error message is empty"} |
+ ] |
+ }, |
+ { |
+ tag: "button", |
+ types: [], |
+ testData: [ |
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"}, |
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false if the custom validity error message is empty"} |
+ ] |
+ }, |
+ { |
+ tag: "select", |
+ types: [], |
+ testData: [ |
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"}, |
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false i the custom validity error message is empty"} |
+ ] |
+ }, |
+ { |
+ tag: "textarea", |
+ types: [], |
+ testData: [ |
+ {conditions: {message: "My custom error"}, expected: true, name: "[target] The validity.customError must be true if the custom validity error message is not empty"}, |
+ {conditions: {message: ""}, expected: false, name: "[target] The validity.customError must be false if the custom validity error message is empty"} |
+ ] |
+ } |
+ ] |
+ |
+ validator.run_test(testElements, "customError"); |
+</script> |