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

Unified Diff: LayoutTests/fast/files/file-constructor.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/files/file-constructor.html
diff --git a/LayoutTests/fast/files/file-constructor.html b/LayoutTests/fast/files/file-constructor.html
index f615864f75e496d559deab8828f0874b669cf0b7..91b5cf8a307a15c7d2bcf03c6459b76dcce9cb5d 100644
--- a/LayoutTests/fast/files/file-constructor.html
+++ b/LayoutTests/fast/files/file-constructor.html
@@ -87,6 +87,20 @@ 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.
+shouldBeNow("(new File([], 'world.html')).lastModified", 20000);
+shouldBeNow("(new File([], 'world.html', {})).lastModified", 20000);
+shouldBeNow("(new File([], 'world.html', {type: 'text/plain'})).lastModified", 20000);
+// 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");
« no previous file with comments | « LayoutTests/fast/files/blob-constructor-expected.txt ('k') | LayoutTests/fast/files/file-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698