Changeset 176601 in webkit
- Timestamp:
- Dec 1, 2014, 1:14:35 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r176592 r176601 1 2014-12-01 Alexey Proskuryakov <ap@apple.com> 2 3 Several JavaScriptCore date tests are flaky, because they expect time to be frozen during execution 4 https://bugs.webkit.org/show_bug.cgi?id=139138 5 6 Reviewed by Mark Lam. 7 8 Merged a fix by Bob Clary. 9 10 * tests/mozilla/ecma/Date/15.9.1.1-1.js: 11 * tests/mozilla/ecma/Date/15.9.1.1-2.js: 12 * tests/mozilla/ecma/Date/15.9.2.1.js: 13 * tests/mozilla/ecma/Date/15.9.2.2-1.js: 14 * tests/mozilla/ecma/Date/15.9.2.2-2.js: 15 * tests/mozilla/ecma/Date/15.9.2.2-3.js: 16 * tests/mozilla/ecma/Date/15.9.2.2-4.js: 17 * tests/mozilla/ecma/Date/15.9.2.2-5.js: 18 * tests/mozilla/ecma/Date/15.9.2.2-6.js: 19 1 20 2014-11-17 Oliver Hunt <oliver@apple.com> 2 21 -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.1.1-1.js
r11995 r176601 46 46 47 47 function test() { 48 writeHeaderToLog("15. 8.1.1 Time Range");48 writeHeaderToLog("15.9.1.1 Time Range"); 49 49 50 50 for ( M_SECS = 0, CURRENT_YEAR = 1970; -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.1.1-2.js
r11995 r176601 40 40 function test() { 41 41 42 writeHeaderToLog("15. 8.1.1 Time Range");42 writeHeaderToLog("15.9.1.1 Time Range"); 43 43 44 44 for ( M_SECS = 0, CURRENT_YEAR = 1970; -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.1.js
r11995 r176601 37 37 var TITLE = "Date Constructor used as a function"; 38 38 var TYPEOF = "string"; 39 var TOLERANCE = 1000;40 39 41 40 writeHeaderToLog("15.9.2.1 The Date Constructor Called as a Function: " + … … 53 52 var TODAY = new Date(); 54 53 54 // allow up to 1 second difference due to possibility 55 // the date may change by 1 second in between calls to Date 56 57 var d1; 58 var d2; 59 55 60 // Dates around 1970 56 61 57 array[item++] = new TestCase( SECTION, "Date(1970,0,1,0,0,0,0)", (new Date()).toString(), Date(1970,0,1,0,0,0,0) ); 58 array[item++] = new TestCase( SECTION, "Date(1969,11,31,15,59,59,999)", (new Date()).toString(), Date(1969,11,31,15,59,59,999)) 59 array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0,0)) 60 array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,0,1)) 62 d1 = new Date(); 63 d2 = Date.parse(Date(1970,0,1,0,0,0,0)); 64 array[item++] = new TestCase(SECTION, "Date(1970,0,1,0,0,0,0)", true, d2 - d1 <= 1000); 65 66 d1 = new Date(); 67 d2 = Date.parse(Date(1969,11,31,15,59,59,999)); 68 array[item++] = new TestCase(SECTION, "Date(1969,11,31,15,59,59,999)", true, d2 - d1 <= 1000); 69 70 d1 = new Date(); 71 d2 = Date.parse(Date(1969,11,31,16,0,0,0)); 72 array[item++] = new TestCase(SECTION, "Date(1969,11,31,16,0,0,0)", true, d2 - d1 <= 1000); 73 74 d1 = new Date(); 75 d2 = Date.parse(Date(1969,11,31,16,0,0,1)); 76 array[item++] = new TestCase(SECTION, "Date(1969,11,31,16,0,0,1)", true, d2 - d1 <= 1000); 61 77 62 78 // Dates around 2000 63 array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59,999)", (new Date()).toString(), Date(1999,11,15,59,59,999)); 64 array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0,0)); 65 array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59,999)", (new Date()).toString(), Date(1999,11,31,23,59,59,999) ); 66 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0,0) ); 67 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,0,1) ); 79 d1 = new Date(); 80 d2 = Date.parse(Date(1999,11,15,59,59,999)); 81 array[item++] = new TestCase(SECTION, "Date(1999,11,15,59,59,999)", true, d2 - d1 <= 1000); 82 83 d1 = new Date(); 84 d2 = Date.parse(Date(1999,11,16,0,0,0,0)); 85 array[item++] = new TestCase(SECTION, "Date(1999,11,16,0,0,0,0)", true, d2 - d1 <= 1000); 86 87 d1 = new Date(); 88 d2 = Date.parse(Date(1999,11,31,23,59,59,999)); 89 array[item++] = new TestCase(SECTION, "Date(1999,11,31,23,59,59,999)", true, d2 - d1 <= 1000); 90 91 d1 = new Date(); 92 d2 = Date.parse(Date(2000,0,0,0,0,0,0)); 93 array[item++] = new TestCase(SECTION, "Date(2000,0,1,0,0,0,0)", true, d2 - d1 <= 1000); 94 95 d1 = new Date(); 96 d2 = Date.parse(Date(2000,0,0,0,0,0,1)); 97 array[item++] = new TestCase(SECTION, "Date(2000,0,1,0,0,0,1)", true, d2 - d1 <= 1000); 68 98 69 99 // Dates around 1900 70 100 71 array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59,999)", (new Date()).toString(), Date(1899,11,31,23,59,59,999)); 72 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0,0) ); 73 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,0,1) ); 74 array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0,0)); 101 d1 = new Date(); 102 d2 = Date.parse(Date(1899,11,31,23,59,59,999)); 103 array[item++] = new TestCase(SECTION, "Date(1899,11,31,23,59,59,999)", true, d2 - d1 <= 1000); 104 105 d1 = new Date(); 106 d2 = Date.parse(Date(1900,0,1,0,0,0,0)); 107 array[item++] = new TestCase(SECTION, "Date(1900,0,1,0,0,0,0)", true, d2 - d1 <= 1000); 108 109 d1 = new Date(); 110 d2 = Date.parse(Date(1900,0,1,0,0,0,1)); 111 array[item++] = new TestCase(SECTION, "Date(1900,0,1,0,0,0,1)", true, d2 - d1 <= 1000); 112 113 d1 = new Date(); 114 d2 = Date.parse(Date(1899,11,31,16,0,0,0,0)); 115 array[item++] = new TestCase(SECTION, "Date(1899,11,31,16,0,0,0,0)", true, d2 - d1 <= 1000); 75 116 76 117 // Dates around feb 29, 2000 77 118 78 array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0,0)); 79 array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59,999)", (new Date()).toString(), Date( 2000,1,28,23,59,59,999)); 80 array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0,0)); 119 d1 = new Date(); 120 d2 = Date.parse(Date(2000,1,29,0,0,0,0)); 121 array[item++] = new TestCase(SECTION, "Date(2000,1,29,0,0,0,0)", true, d2 - d1 <= 1000); 122 123 d1 = new Date(); 124 d2 = Date.parse(Date(2000,1,28,23,59,59,999)); 125 array[item++] = new TestCase(SECTION, "Date(2000,1,28,23,59,59,999)", true, d2 - d1 <= 1000); 126 127 d1 = new Date(); 128 d2 = Date.parse(Date(2000,1,27,16,0,0,0)); 129 array[item++] = new TestCase(SECTION, "Date(2000,1,27,16,0,0,0)", true, d2 - d1 <= 1000); 81 130 82 131 // Dates around jan 1, 2005 83 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59,999)", (new Date()).toString(), Date(2004,11,31,23,59,59,999)); 84 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0,0) ); 85 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,0,1) ); 86 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0,0)); 132 d1 = new Date(); 133 d2 = Date.parse(Date(2004,11,31,23,59,59,999)); 134 array[item++] = new TestCase(SECTION, "Date(2004,11,31,23,59,59,999)", true, d2 - d1 <= 1000); 135 136 d1 = new Date(); 137 d2 = Date.parse(Date(2005,0,1,0,0,0,0)); 138 array[item++] = new TestCase(SECTION, "Date(2005,0,1,0,0,0,0)", true, d2 - d1 <= 1000); 139 140 d1 = new Date(); 141 d2 = Date.parse(Date(2005,0,1,0,0,0,1)); 142 array[item++] = new TestCase(SECTION, "Date(2005,0,1,0,0,0,1)", true, d2 - d1 <= 1000); 143 144 d1 = new Date(); 145 d2 = Date.parse(Date(2004,11,31,16,0,0,0,0)); 146 array[item++] = new TestCase(SECTION, "Date(2004,11,31,16,0,0,0,0)", true, d2 - d1 <= 1000); 87 147 88 148 // Dates around jan 1, 2032 89 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59,999)", (new Date()).toString(), Date(2031,11,31,23,59,59,999)); 90 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0,0) ); 91 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,0,1) ); 92 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0,0)); 149 d1 = new Date(); 150 d2 = Date.parse(Date(2031,11,31,23,59,59,999)); 151 array[item++] = new TestCase(SECTION, "Date(2031,11,31,23,59,59,999)", true, d2 - d1 <= 1000); 152 153 d1 = new Date(); 154 d2 = Date.parse(Date(2032,0,1,0,0,0,0)); 155 array[item++] = new TestCase(SECTION, "Date(2032,0,1,0,0,0,0)", true, d2 - d1 <= 1000); 156 157 d1 = new Date(); 158 d2 = Date.parse(Date(2032,0,1,0,0,0,1)); 159 array[item++] = new TestCase(SECTION, "Date(2032,0,1,0,0,0,1)", true, d2 - d1 <= 1000); 160 161 d1 = new Date(); 162 d2 = Date.parse(Date(2031,11,31,16,0,0,0,0)); 163 array[item++] = new TestCase(SECTION, "Date(2031,11,31,16,0,0,0,0)", true, d2 - d1 <= 1000); 93 164 94 165 return ( array ); -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-1.js
r11995 r176601 36 36 startTest(); 37 37 var SECTION = "15.9.2.2"; 38 var TOLERANCE = 100;39 38 var TITLE = "The Date Constructor Called as a Function"; 40 39 … … 50 49 var item = 0; 51 50 51 // allow up to 1 second difference due to possibility 52 // the date may change by 1 second in between calls to Date 53 54 var d1; 55 var d2; 56 52 57 // Dates around 1970 53 58 54 array[item++] = new TestCase( SECTION, "Date(1970,0,1,0,0,0)", (new Date()).toString(), Date(1970,0,1,0,0,0) ); 55 array[item++] = new TestCase( SECTION, "Date(1969,11,31,15,59,59)", (new Date()).toString(), Date(1969,11,31,15,59,59)) 56 array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0)) 57 array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,1)) 58 /* 59 // Dates around 2000 60 array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", (new Date()).toString(), Date(1999,11,15,59,59)); 61 array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0)); 62 array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(), Date(1999,11,31,23,59,59) ); 63 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) ); 64 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) ); 59 d1 = new Date(); 60 d2 = Date.parse(Date(1970,0,1,0,0,0)); 61 array[item++] = new TestCase(SECTION, "Date(1970,0,1,0,0,0)", true, d2 - d1 <= 1000); 65 62 66 // Dates around 1900 63 d1 = new Date(); 64 d2 = Date.parse(Date(1969,11,31,15,59,59)); 65 array[item++] = new TestCase(SECTION, "Date(1969,11,31,15,59,59)", true, d2 - d1 <= 1000); 67 66 68 array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59)); 69 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) ); 70 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) ); 71 array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0)); 67 d1 = new Date(); 68 d2 = Date.parse(Date(1969,11,31,16,0,0)); 69 array[item++] = new TestCase(SECTION, "Date(1969,11,31,16,0,0)", true, d2 - d1 <= 1000); 72 70 73 // Dates around feb 29, 2000 71 d1 = new Date(); 72 d2 = Date.parse(Date(1969,11,31,16,0,1)); 73 array[item++] = new TestCase(SECTION, "Date(1969,11,31,16,0,1)", true, d2 - d1 <= 1000); 74 74 75 array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));76 array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));77 array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));78 79 // Dates around jan 1, 200580 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));81 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );82 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );83 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));84 85 // Dates around jan 1, 203286 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));87 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );88 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );89 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));90 */91 75 return ( array ); 92 76 } -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-2.js
r11995 r176601 36 36 startTest(); 37 37 var SECTION = "15.9.2.2"; 38 var TOLERANCE = 100;39 38 var TITLE = "The Date Constructor Called as a Function"; 40 39 … … 50 49 var item = 0; 51 50 51 // allow up to 1 second difference due to possibility 52 // the date may change by 1 second in between calls to Date 53 54 var d1; 55 var d2; 56 52 57 // Dates around 2000 53 array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", (new Date()).toString(), Date(1999,11,15,59,59)); 54 array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0)); 55 array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(), Date(1999,11,31,23,59,59) ); 56 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) ); 57 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) ); 58 d1 = new Date(); 59 d2 = Date.parse(Date(1999,11,15,59,59)); 60 array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", true, d2 - d1 <= 1000); 58 61 59 /* 60 // Dates around 1900 62 d1 = new Date(); 63 d2 = Date.parse(Date(1999,11,16,0,0,0)); 64 array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", true, d2 - d1 <= 1000); 61 65 62 array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59)); 63 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) ); 64 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) ); 65 array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0)); 66 d1 = new Date(); 67 d2 = Date.parse(Date(1999,11,31,23,59,59)); 68 array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", true, d2 - d1 <= 1000); 66 69 67 // Dates around feb 29, 2000 70 d1 = new Date(); 71 d2 = Date.parse(Date(2000,0,1,0,0,0)); 72 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", true, d2 - d1 <= 1000); 68 73 69 array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));70 array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));71 array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));74 d1 = new Date(); 75 d2 = Date.parse(Date(2000,0,1,0,0,1)); 76 array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", true, d2 - d1 <= 1000) 72 77 73 // Dates around jan 1, 200574 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));75 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );76 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );77 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));78 79 // Dates around jan 1, 203280 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));81 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );82 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );83 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));84 */85 78 return ( array ); 86 79 } -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-3.js
r11995 r176601 36 36 startTest(); 37 37 var SECTION = "15.9.2.2"; 38 var TOLERANCE = 100;39 38 var TITLE = "The Date Constructor Called as a Function"; 40 39 … … 50 49 var item = 0; 51 50 51 // allow up to 1 second difference due to possibility 52 // the date may change by 1 second in between calls to Date 53 54 var d1; 55 var d2; 56 52 57 // Dates around 1900 53 58 54 array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59)); 55 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) ); 56 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) ); 57 array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0)); 59 d1 = new Date(); 60 d2 = Date.parse(Date(1899,11,31,23,59,59)); 61 array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", true, d2 - d1 <= 1000); 58 62 59 /* 60 // Dates around feb 29, 2000 63 d1 = new Date(); 64 d2 = Date.parse(Date(1900,0,1,0,0,0)); 65 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", true, d2 - d1 <= 1000); 61 66 62 array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));63 array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));64 array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));67 d1 = new Date(); 68 d2 = Date.parse(Date(1900,0,1,0,0,1) ); 69 array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", true, d2 - d1 <= 1000); 65 70 66 // Dates around jan 1, 2005 67 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59)); 68 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) ); 69 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) ); 70 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0)); 71 d1 = new Date(); 72 d2 = Date.parse(Date(1899,11,31,16,0,0,0)); 73 array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", true, d2 - d1 <= 1000); 71 74 72 // Dates around jan 1, 203273 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));74 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );75 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );76 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));77 */78 75 return ( array ); 79 76 } -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-4.js
r11995 r176601 36 36 startTest(); 37 37 var SECTION = "15.9.2.2"; 38 var TOLERANCE = 100;39 38 var TITLE = "The Date Constructor Called as a Function"; 40 39 … … 50 49 var item = 0; 51 50 51 // allow up to 1 second difference due to possibility 52 // the date may change by 1 second in between calls to Date 53 54 var d1; 55 var d2; 56 52 57 // Dates around feb 29, 2000 53 58 54 array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));55 array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));56 array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));59 d1 = new Date(); 60 d2 = Date.parse(Date(2000,1,29,0,0,0)); 61 array[item++] = new TestCase(SECTION, "Date(2000,1,29,0,0,0)", true, d2 - d1 <= 1000); 57 62 58 /* 59 // Dates around jan 1, 2005 60 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59)); 61 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) ); 62 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) ); 63 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0)); 63 d1 = new Date(); 64 d2 = Date.parse(Date(2000,1,28,23,59,59)); 65 array[item++] = new TestCase(SECTION, "Date(2000,1,28,23,59,59)", true, d2 - d1 <= 1000); 64 66 65 // Dates around jan 1, 2032 66 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59)); 67 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) ); 68 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) ); 69 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0)); 70 */ 67 d1 = new Date(); 68 d2 = Date.parse(Date(2000,1,27,16,0,0)); 69 array[item++] = new TestCase(SECTION, "Date(2000,1,27,16,0,0)", true, d2 - d1 <= 1000); 70 71 71 return ( array ); 72 72 } -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-5.js
r11995 r176601 36 36 startTest(); 37 37 var SECTION = "15.9.2.2"; 38 var TOLERANCE = 100;39 38 var TITLE = "The Date Constructor Called as a Function"; 40 39 … … 50 49 var item = 0; 51 50 51 // allow up to 1 second difference due to possibility 52 // the date may change by 1 second in between calls to Date 53 54 var d1; 55 var d2; 56 52 57 // Dates around jan 1, 2005 53 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59)); 54 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) ); 55 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) ); 56 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0)); 57 /* 58 // Dates around jan 1, 2032 59 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59)); 60 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) ); 61 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) ); 62 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0)); 63 */ 58 59 d1 = new Date(); 60 d2 = Date.parse(Date(2004,11,31,23,59,59)); 61 array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", true, d2 - d1 <= 1000); 62 63 d1 = new Date(); 64 d2 = Date.parse(Date(2005,0,1,0,0,0) ); 65 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", true, d2 - d1 <= 1000); 66 67 d1 = new Date(); 68 d2 = Date.parse(Date(2005,0,1,0,0,1) ); 69 array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", true, d2 - d1 <= 1000); 70 71 d1 = new Date(); 72 d2 = Date.parse(Date(2004,11,31,16,0,0,0)); 73 array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", true, d2 - d1 <= 1000); 74 64 75 return ( array ); 65 76 } -
trunk/Source/JavaScriptCore/tests/mozilla/ecma/Date/15.9.2.2-6.js
r11995 r176601 36 36 startTest(); 37 37 var SECTION = "15.9.2.2"; 38 var TOLERANCE = 100;39 38 var TITLE = "The Date Constructor Called as a Function"; 40 39 … … 50 49 var item = 0; 51 50 51 // allow up to 1 second difference due to possibility 52 // the date may change by 1 second in between calls to Date 53 54 var d1; 55 var d2; 56 52 57 // Dates around jan 1, 2032 53 array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59)); 54 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) ); 55 array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) ); 56 array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0)); 58 d1 = new Date(); 59 d2 = Date.parse(Date(2031,11,31,23,59,59)); 60 array[item++] = new TestCase(SECTION, "Date(2031,11,31,23,59,59)", true, d2 - d1 <= 1000); 61 62 d1 = new Date(); 63 d2 = Date.parse(Date(2032,0,1,0,0,0)); 64 array[item++] = new TestCase(SECTION, "Date(2032,0,1,0,0,0)", true, d2 - d1 <= 1000); 65 66 d1 = new Date(); 67 d2 = Date.parse(Date(2032,0,1,0,0,1)); 68 array[item++] = new TestCase(SECTION, "Date(2032,0,1,0,0,1)", true, d2 - d1 <= 1000); 69 70 d1 = new Date(); 71 d2 = Date.parse(Date(2031,11,31,16,0,0,0)); 72 array[item++] = new TestCase(SECTION, "Date(2031,11,31,16,0,0,0)", true, d2 - d1 <= 1000); 57 73 58 74 return ( array );
Note:
See TracChangeset
for help on using the changeset viewer.