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

Side by Side Diff: LayoutTests/fast/forms/time/time-stepup-stepdown.html

Issue 1340883002: Avoid stack overflow in InputType::applyStep(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description('Check stepUp() and stepDown() behavior for type=time.'); 10 description('Check stepUp() and stepDown() behavior for type=time.');
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 shouldBeEqualToString('stepUp("20:13", null, null)', '20:14'); 51 shouldBeEqualToString('stepUp("20:13", null, null)', '20:14');
52 shouldBeEqualToString('stepDown("20:13", null, null)', '20:12'); 52 shouldBeEqualToString('stepDown("20:13", null, null)', '20:12');
53 shouldBeEqualToString('stepUp("20:13", null, null, 10)', '20:23'); 53 shouldBeEqualToString('stepUp("20:13", null, null, 10)', '20:23');
54 shouldBeEqualToString('stepDown("20:13", null, null, 11)', '20:02'); 54 shouldBeEqualToString('stepDown("20:13", null, null, 11)', '20:02');
55 shouldBeEqualToString('stepUp("20:13", "4", null, 2)', '20:13:08'); 55 shouldBeEqualToString('stepUp("20:13", "4", null, 2)', '20:13:08');
56 shouldBeEqualToString('stepDown("20:13", "4", null, 3)', '20:12:48'); 56 shouldBeEqualToString('stepDown("20:13", "4", null, 3)', '20:12:48');
57 debug('Step=any'); 57 debug('Step=any');
58 shouldThrow('stepUp("20:13", "any", null)'); 58 shouldThrow('stepUp("20:13", "any", null)');
59 shouldThrow('stepDown("20:13", "any", null)'); 59 shouldThrow('stepDown("20:13", "any", null)');
60 debug('Overflow/underflow'); 60 debug('Overflow/underflow');
61 shouldBeEqualToString('stepUp("20:13", "3.40282346e+38", null)', '23:59:59.999') ; 61 shouldBeEqualToString('stepUp("20:13", "3.40282346e+38", null)', '20:13');
62 shouldBeEqualToString('stepDown("20:13", "3.40282346e+38", null)', '00:00:00'); 62 shouldBeEqualToString('stepDown("20:13", "3.40282346e+38", null)', '20:13');
63 shouldBeEqualToString('stepUp("20:13", "1", "20:13")', '20:13:00'); 63 shouldBeEqualToString('stepUp("20:13", "1", "20:13")', '20:13:00');
64 shouldBeEqualToString('stepDown("20:13", "1", "20:13")', '20:13:00'); 64 shouldBeEqualToString('stepDown("20:13", "1", "20:13")', '20:13:00');
65 shouldBeEqualToString('stepUp("23:59", null, null)', '23:59'); 65 shouldBeEqualToString('stepUp("23:59", null, null)', '23:59');
66 shouldBeEqualToString('stepDown("00:00", null, null)', '00:00'); 66 shouldBeEqualToString('stepDown("00:00", null, null)', '00:00');
67 67
68 debug(''); 68 debug('');
69 debug('Step-mismatched initial values');
70 // There are no step-match values in 00:00 - 23:59:59.999. stepUp()
71 // should do nothing.
72 shouldBeEqualToString('stepUp("20:13", "86400.000", null, 65536)', '20:13');
73 shouldBeEqualToString('stepUp("20:13", "86400.001", null, 65536)', '20:13');
74 shouldBeEqualToString('stepUp("20:13", "600", null, 1)', '20:20');
75 shouldBeEqualToString('stepUp("20:13", "600", null, 2)', '20:30');
76 shouldBeEqualToString('stepDown("20:13", "600", null, 1)', '20:10');
77 shouldBeEqualToString('stepDown("20:13", "600", null, 2)', '20:00');
78
79 debug('');
69 </script> 80 </script>
70 </body> 81 </body>
71 </html> 82 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698