diff options
author | costan@gmail.com <costan@gmail.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-11-20 13:28:52 +0000 |
---|---|---|
committer | costan@gmail.com <costan@gmail.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-11-20 13:28:52 +0000 |
commit | 04bb158eb4bacdf2f85702e9b259de7d5e1140b0 (patch) | |
tree | 533add1885e1683c5e90e8213219c1c9ff00761a /third_party/WebKit/LayoutTests/fast/files/file-constructor.html | |
parent | 5ac59525fa5375592f8339b0bdb4b62b6bb97b8f (diff) | |
download | chromium_src-04bb158eb4bacdf2f85702e9b259de7d5e1140b0.zip chromium_src-04bb158eb4bacdf2f85702e9b259de7d5e1140b0.tar.gz chromium_src-04bb158eb4bacdf2f85702e9b259de7d5e1140b0.tar.bz2 |
File constructor understands lastModified.
BUG=164933
Review URL: https://codereview.chromium.org/74213009
git-svn-id: svn://svn.chromium.org/blink/trunk@162362 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/files/file-constructor.html')
-rw-r--r-- | third_party/WebKit/LayoutTests/fast/files/file-constructor.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/files/file-constructor.html b/third_party/WebKit/LayoutTests/fast/files/file-constructor.html index f615864..5fe99e6 100644 --- a/third_party/WebKit/LayoutTests/fast/files/file-constructor.html +++ b/third_party/WebKit/LayoutTests/fast/files/file-constructor.html @@ -87,6 +87,23 @@ shouldBe("(new File([], 'world.html', {type:'text/html'})).type", "'text/html'") shouldBe("(new File([], 'world.html', {type:'text/html'})).size", "0"); shouldBe("(new File([], 'world.html', {type:'text/plain;charset=UTF-8'})).type", "'text/plain;charset=utf-8'"); +// Test that the lastModified is correctly added to the File. +var aDate = new Date(441532800000); +shouldBe("(new File([], 'world.html', {lastModified: 441532800000})).lastModified", "441532800000"); +// Unless specified, lastModified should default to now. +var startTime = Date.now(); +var fileTime = (new File([], 'world.html')).lastModified; +var endTime = Date.now(); +// FIXME: these checks will fail if time goes backwards, e.g. NTP updates. We should have a generic bullet-proof method for comparing against Date.now(). http://crbug.com/320686 +shouldBeTrue("startTime <= fileTime"); +shouldBeTrue("fileTime <= endTime"); +// Test that Date instances are implicitly converted to numbers. +shouldBe("(new File([], 'world.html', {lastModified: new Date(441532800000)})).lastModified", "441532800000"); + +// Test the deprecated attribute lastModifiedDate. +shouldBeTrue("(new File([], 'world.html', {lastModified: 441532800000})).lastModifiedDate instanceof Date"); +shouldBe("(new File([], 'world.html', {lastModified: 441532800000})).lastModifiedDate.valueOf()", "441532800000"); + // Test the number of expected arguments in the File constructor. shouldBe("window.File.length", "2"); |