diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-date.js | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-date.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-date.js b/third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-date.js new file mode 100644 index 0000000000..26ab28529e --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-date.js @@ -0,0 +1,40 @@ +describe('Date', function () { + + describe('now', function () { + it('should be the current time', function () { + expect(Date.now() === new Date().getTime()).toBe(true); + }); + }); + + describe("parse", function () { + // TODO: Write the rest of the test. + + it('should support extended years', function () { + + expect(Date.parse('0001-01-01T00:00:00Z')).toBe(-62135596800000); + expect(Date.parse('+275760-09-13T00:00:00.000Z')).toBe(8.64e15); + expect(Date.parse('+033658-09-27T01:46:40.000Z')).toBe(1e15); + expect(Date.parse('-000001-01-01T00:00:00Z')).toBe(-62198755200000); + expect(Date.parse('+002009-12-15T00:00:00Z')).toBe(1260835200000); + + }); + + }); + + describe("toISOString", function () { + // TODO: write the rest of the test. + + it('should support extended years', function () { + expect(new Date(-62198755200000).toISOString().indexOf('-000001-01-01')).toBe(0); + expect(new Date(8.64e15).toISOString().indexOf('+275760-09-13')).toBe(0); + }); + }); + + describe("toJSON", function () { + it('should return the isoString when stringified', function () { + var date = new Date(); + expect(JSON.stringify(date.toISOString())).toBe(JSON.stringify(date)); + }) + }); + +});
\ No newline at end of file |