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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/forms/the-input-element/datetime-local.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Form input type=datetime-local</title>
4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
5 <link rel=help href="https://html.spec.whatwg.org/multipage/multipage/common-mic rosyntaxes.html#local-dates-and-times">
6 <link rel=help href="https://html.spec.whatwg.org/multipage/multipage/states-of- the-type-attribute.html#local-date-and-time-state-(type=datetime-local)">
7 <script src="../../../../../../resources/testharness.js"></script>
8 <script src="../../../../../../resources/testharnessreport.js"></script>
9 <div id="log"></div>
10 <script>
11 var datetimeLocal = [
12 {value: "", expected: "", testname: "empty value"},
13 {value: "2014-01-01T11:11:11.111", expected: "2014-01-01T11:11:11.111", test name: "datetime-local input value set to 2014-01-01T11:11:11.111 without min/max "},
14 {value: "2014-01-01 11:11:11.111", expected: "2014-01-01T11:11:11.111", test name: "datetime-local input value set to 2014-01-01 11:11:11.111 without min/max "},
15 {value: "2014-01-01 11:11", expected: "2014-01-01T11:11", testname: "datetim e-local input value set to 2014-01-01 11:11 without min/max"},
16 {value: "2014-01-01 00:00:00.000", expected: "2014-01-01T00:00", testname: " datetime-local input value set to 2014-01-01 00:00:00.000 without min/max"},
17 {value: "2014-01-0 11:11", expected: "", testname: "datetime-local input val ue set to 2014-01-0 11:11 without min/max"},
18 {value: "2014-01-01 11:1", expected: "", testname: "datetime-local input val ue set to 2014-01-01 11:1 without min/max"},
19 {value: "2014-01-01 11:12", attributes: { min: "2014-01-01 11:11" }, expecte d: "2014-01-01T11:12", testname: "Value >= min attribute"},
20 {value: "2014-01-01 11:10", attributes: { min: "2014-01-01 11:11" }, expecte d: "2014-01-01T11:11", testname: "Value < min attribute"},
21 {value: "2014-01-01 11:10", attributes: { max: "2014-01-01 11:11" }, expecte d: "2014-01-01T11:10", testname: "Value <= max attribute"},
22 {value: "2014-01-01 11:12", attributes: { max: "2014-01-01 11:11" }, expecte d: "2014-01-01T11:11", testname: "Value > max attribute"}
23 ];
24 for (var i = 0; i < datetimeLocal.length; i++) {
25 var w = datetimeLocal[i];
26 test(function() {
27 var input = document.createElement("input");
28 input.type = "datetime-local";
29 input.value = w.value;
30 for(var attr in w.attributes) {
31 input[attr] = w.attributes[attr];
32 }
33 assert_equals(input.value, w.expected);
34 }, w.testname);
35 }
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698