Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / forms / week / week-stepup-stepdown.html
index 430b829..a31939b 100644 (file)
@@ -1,16 +1,15 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../../../resources/js-test.js"></script>
 </head>
 <body>
 <p id="description"></p>
 <div id="console"></div>
 <script>
-description('Check stepUp() and stepDown() bahevior for type=week.');
+description('Check stepUp() and stepDown() behavior for type=week.');
 
 var input = document.createElement('input');
-var invalidStateErr = '"InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable."';
 
 function setInputAttributes(min, max, step, value) {
     input.min = min;
@@ -39,30 +38,30 @@ function stepDown(value, step, min, optionalStepCount) {
 
 input.type = 'week';
 debug('Invalid value');
-shouldThrow('stepUp("", null, null)', invalidStateErr);
-shouldThrow('stepDown("", null, null)', invalidStateErr);
+shouldBeEqualToString('stepUp("", null, null)', '1970-W02');
+shouldBeEqualToString('stepDown("", null, null)', '1970-W01');
 debug('Non-number arguments');
-shouldBe('stepUp("2010-W02", null, null, "0")', '"2010-W02"');
-shouldBe('stepDown("2010-W02", null, null, "0")', '"2010-W02"');
-shouldBe('stepUp("2010-W02", null, null, "foo")', '"2010-W02"');
-shouldBe('stepDown("2010-W02", null, null, "foo")', '"2010-W02"');
-shouldBe('stepUp("2010-W02", null, null, null)', '"2010-W02"');
-shouldBe('stepDown("2010-W02", null, null, null)', '"2010-W02"');
+shouldBeEqualToString('stepUp("2010-W02", null, null, "0")', '2010-W02');
+shouldBeEqualToString('stepDown("2010-W02", null, null, "0")', '2010-W02');
+shouldBeEqualToString('stepUp("2010-W02", null, null, "foo")', '2010-W02');
+shouldBeEqualToString('stepDown("2010-W02", null, null, "foo")', '2010-W02');
+shouldBeEqualToString('stepUp("2010-W02", null, null, null)', '2010-W02');
+shouldBeEqualToString('stepDown("2010-W02", null, null, null)', '2010-W02');
 debug('Normal cases');
-shouldBe('stepUp("2010-W02", null, null)', '"2010-W03"');
-shouldBe('stepDown("2010-W02", null, null)', '"2010-W01"');
-shouldBe('stepUp("2010-W02", null, null, 10)', '"2010-W12"');
-shouldBe('stepDown("2010-W02", null, null, 11)', '"2009-W44"');
-shouldBe('stepUp("1970-W01", "4", null, 2)', '"1970-W09"');
-shouldBe('stepDown("1970-W01", "4", null, 3)', '"1969-W41"');
+shouldBeEqualToString('stepUp("2010-W02", null, null)', '2010-W03');
+shouldBeEqualToString('stepDown("2010-W02", null, null)', '2010-W01');
+shouldBeEqualToString('stepUp("2010-W02", null, null, 10)', '2010-W12');
+shouldBeEqualToString('stepDown("2010-W02", null, null, 11)', '2009-W44');
+shouldBeEqualToString('stepUp("1970-W01", "4", null, 2)', '1970-W09');
+shouldBeEqualToString('stepDown("1970-W01", "4", null, 3)', '1969-W41');
 debug('Step=any');
-shouldThrow('stepUp("2010-W02", "any", null)', invalidStateErr);
-shouldThrow('stepDown("2010-W02", "any", null)', invalidStateErr);
+shouldThrow('stepUp("2010-W02", "any", null)');
+shouldThrow('stepDown("2010-W02", "any", null)');
 debug('Overflow/underflow');
-shouldThrow('stepUp("2010-W02", "3.40282346e+38", null)', invalidStateErr);
-shouldThrow('stepDown("2010-W02", "3.40282346e+38", null)', invalidStateErr);
-shouldThrow('stepUp("2010-W02", "1", "2010-W02")', invalidStateErr);
-shouldThrow('stepDown("2010-W02", "1", "2010-W02")', invalidStateErr);
+shouldBeEqualToString('stepUp("2010-W02", "3.40282346e+38", null)', '275760-W37');
+shouldBeEqualToString('stepDown("2010-W02", "3.40282346e+38", null)', '1970-W01');
+shouldBeEqualToString('stepUp("2010-W02", "1", "2010-W02")', '2010-W02');
+shouldBeEqualToString('stepDown("2010-W02", "1", "2010-W02")', '2010-W02');
 
 debug('');
 </script>