Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / forms / datetimelocal / datetimelocal-stepup-stepdown.html
index dad52e5..8e05254 100644 (file)
@@ -7,7 +7,7 @@
 <p id="description"></p>
 <div id="console"></div>
 <script>
-description('Check stepUp() and stepDown() bahevior for type=datetime-local.');
+description('Check stepUp() and stepDown() behavior for type=datetime-local.');
 
 var input = document.createElement('input');
 
@@ -38,30 +38,30 @@ function stepDown(value, step, min, optionalStepCount) {
 
 input.type = 'datetime-local';
 debug('Invalid value');
-shouldThrow('stepUp("", null, null)');
-shouldThrow('stepDown("", null, null)');
+shouldBeEqualToString('stepUp("", null, null)', '1970-01-01T00:01');
+shouldBeEqualToString('stepDown("", null, null)', '1969-12-31T23:59');
 debug('Non-number arguments');
-shouldBe('stepUp("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"');
-shouldBe('stepDown("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"');
-shouldBe('stepUp("2010-02-10T20:13", null, null, "foo")', '"2010-02-10T20:13"');
-shouldBe('stepDown("2010-02-10T20:13", null, null, "foo")', '"2010-02-10T20:13"');
-shouldBe('stepUp("2010-02-10T20:13", null, null, null)', '"2010-02-10T20:13"');
-shouldBe('stepDown("2010-02-10T20:13", null, null, null)', '"2010-02-10T20:13"');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", null, null, "0")', '2010-02-10T20:13');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", null, null, "0")', '2010-02-10T20:13');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", null, null, "foo")', '2010-02-10T20:13');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", null, null, "foo")', '2010-02-10T20:13');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", null, null, null)', '2010-02-10T20:13');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", null, null, null)', '2010-02-10T20:13');
 debug('Normal cases');
-shouldBe('stepUp("2010-02-10T20:13", null, null)', '"2010-02-10T20:14"');
-shouldBe('stepDown("2010-02-10T20:13", null, null)', '"2010-02-10T20:12"');
-shouldBe('stepUp("2010-02-10T20:13", null, null, 10)', '"2010-02-10T20:23"');
-shouldBe('stepDown("2010-02-10T20:13", null, null, 11)', '"2010-02-10T20:02"');
-shouldBe('stepUp("1970-01-01T20:13", "4", null, 2)', '"1970-01-01T20:13:08"');
-shouldBe('stepDown("1970-01-01T20:13", "4", null, 3)', '"1970-01-01T20:12:48"');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", null, null)', '2010-02-10T20:14');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", null, null)', '2010-02-10T20:12');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", null, null, 10)', '2010-02-10T20:23');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", null, null, 11)', '2010-02-10T20:02');
+shouldBeEqualToString('stepUp("1970-01-01T20:13", "4", null, 2)', '1970-01-01T20:13:08');
+shouldBeEqualToString('stepDown("1970-01-01T20:13", "4", null, 3)', '1970-01-01T20:12:48');
 debug('Step=any');
 shouldThrow('stepUp("2010-02-10T20:13", "any", null)');
 shouldThrow('stepDown("2010-02-10T20:13", "any", null)');
 debug('Overflow/underflow');
-shouldThrow('stepUp("2010-02-10T20:13", "3.40282346e+38", null)');
-shouldThrow('stepDown("2010-02-10T20:13", "3.40282346e+38", null)');
-shouldThrow('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")');
-shouldThrow('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', '275760-09-13T00:00:00');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', '1970-01-01T00:00:00');
+shouldBeEqualToString('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', '2010-02-10T20:13:00');
+shouldBeEqualToString('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', '2010-02-10T20:13:00');
 </script>
 </body>
 </html>