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

Unified Diff: LayoutTests/fast/dom/setCustomValidity-null-undefined.html

Issue 1220833002: Make the setCustomValidity() error argument not nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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/dom/setCustomValidity-null-undefined-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/setCustomValidity-null-undefined.html
diff --git a/LayoutTests/fast/dom/setCustomValidity-null-undefined.html b/LayoutTests/fast/dom/setCustomValidity-null-undefined.html
new file mode 100644
index 0000000000000000000000000000000000000000..636e324fe0651ecdb9fba0975eaee7f18b8a8ccf
--- /dev/null
+++ b/LayoutTests/fast/dom/setCustomValidity-null-undefined.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
philipj_slow 2015/07/10 08:49:45 You can omit <html>: https://www.chromium.org/blin
shiva.jm 2015/07/10 09:09:28 Done.
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+
+function test1(elementType) {
+test(function() {
philipj_slow 2015/07/10 08:49:45 Should be indented.
shiva.jm 2015/07/10 09:09:28 Done.
+ var element = document.createElement(elementType);
+ element.setCustomValidity('');
+ assert_equals(element.validationMessage, '');
+ element.setCustomValidity(null);
+ assert_equals(element.validationMessage, 'null');
+ element.setCustomValidity(undefined);
+ assert_equals(element.validationMessage, 'undefined');
+}, elementType + ' element test for setCustomValidity(), null and undefined arguments.');
+}
+
+function test2(elementType) {
+test(function() {
+ var element = document.createElement(elementType);
+ element.setCustomValidity('');
+ assert_equals(element.validationMessage, '');
+ element.setCustomValidity(null);
+ assert_equals(element.validationMessage, '');
+ element.setCustomValidity(undefined);
+ assert_equals(element.validationMessage, '');
+}, elementType + ' element test for setCustomValidity(), null and undefined arguments.');
+}
+
+test1('button');
+test1('input');
+test1('textarea');
+test1('select');
+
+test2('output');
+test2('fieldset');
+test2('object');
+test2('keygen');
+</script>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/setCustomValidity-null-undefined-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698