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

Unified Diff: third_party/WebKit/Source/core/fileapi/FileTest.cpp

Issue 2717583003: [BlobStorage] Enforcing renderer constraints to prevent broken blobs (Closed)
Patch Set: added test Created 3 years, 9 months 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
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/File.cpp ('k') | third_party/WebKit/Source/platform/blob/BlobData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fileapi/FileTest.cpp
diff --git a/third_party/WebKit/Source/core/fileapi/FileTest.cpp b/third_party/WebKit/Source/core/fileapi/FileTest.cpp
index 7dabbb0f71053f0c8d4bfaeef83fcbeb25fc8355..bd8c1882ef9977404d317e3d09dba04587912c9c 100644
--- a/third_party/WebKit/Source/core/fileapi/FileTest.cpp
+++ b/third_party/WebKit/Source/core/fileapi/FileTest.cpp
@@ -4,6 +4,7 @@
#include "core/fileapi/File.h"
+#include "platform/FileMetadata.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -33,6 +34,17 @@ TEST(FileTest, fileSystemFileWithNativeSnapshot) {
EXPECT_TRUE(file->fileSystemURL().isEmpty());
}
+TEST(FileTest, fileSystemFileWithNativeSnapshotAndSize) {
+ FileMetadata metadata;
+ metadata.length = 1024ll;
+ metadata.platformPath = "/native/snapshot";
+ File* const file =
+ File::createForFileSystemFile("name", metadata, File::IsUserVisible);
+ EXPECT_TRUE(file->hasBackingFile());
+ EXPECT_EQ("/native/snapshot", file->path());
+ EXPECT_TRUE(file->fileSystemURL().isEmpty());
+}
+
TEST(FileTest, fileSystemFileWithoutNativeSnapshot) {
KURL url(ParsedURLStringTag(),
"filesystem:http://example.com/isolated/hash/non-native-file");
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/File.cpp ('k') | third_party/WebKit/Source/platform/blob/BlobData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698