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

Side by Side Diff: LayoutTests/fast/harness/should-be-now.html

Issue 80983002: File constructor understands lastModified. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added isolate to v8::Date::New to avoid deprecation warning. Created 7 years 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script> 4 <script>
5 description('Test shouldBeNow() in js-test.js'); 5 description('Test shouldBeNow() in js-test.js');
6 6
7 shouldBeNow("Date.now()"); 7 shouldBeNow("Date.now()");
8 shouldBeNow("new Date()"); 8 shouldBeNow("new Date()");
9 9
10 debug("Testing type checking with a string. This should fail."); 10 debug("Testing type checking with a string. This should fail.");
(...skipping 13 matching lines...) Expand all
24 debug("Testing past dates. This should fail."); 24 debug("Testing past dates. This should fail.");
25 stubDateNow(60000, function() { 25 stubDateNow(60000, function() {
26 shouldBeNow("50000"); 26 shouldBeNow("50000");
27 }); 27 });
28 28
29 debug("Testing future dates. This should fail."); 29 debug("Testing future dates. This should fail.");
30 stubDateNow(60000, function() { 30 stubDateNow(60000, function() {
31 shouldBeNow("70000"); 31 shouldBeNow("70000");
32 }); 32 });
33 33
34 debug("Testing a slightly past date with the implicit delta. This should pass.") ;
35 stubDateNow(60000, function() {
36 shouldBeNow("59990");
37 });
38
39 debug("Testing a slightly future date with the implicit delta. This should pass. ");
40 stubDateNow(60000, function() {
41 shouldBeNow("60010");
42 });
43
44 debug("Testing a past date with a large delta. This should pass.");
45 stubDateNow(60000, function() {
46 shouldBeNow("50000", 10000);
47 });
48
49 debug("Testing a future date with a large delta. This should pass.");
50 stubDateNow(60000, function() {
51 shouldBeNow("70000", 10000);
52 });
53
34 debug("Simulating a defective clock that always goes backwards. The test below s hould fail."); 54 debug("Simulating a defective clock that always goes backwards. The test below s hould fail.");
35 var badClock = Date.now(); 55 var badClock = Date.now();
36 var realDateNow = Date.now; 56 var realDateNow = Date.now;
37 Date.now = function() { return --badClock; } 57 Date.now = function() { return --badClock; }
38 shouldBeNow("new Date()"); 58 shouldBeNow("new Date()");
39 Date.now = realDateNow; 59 Date.now = realDateNow;
40 </script> 60 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/files/file-constructor-expected.txt ('k') | LayoutTests/fast/harness/should-be-now-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698