OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "public/platform/WebDragData.h" | 6 #include "public/platform/WebDragData.h" |
7 | 7 |
8 #include "core/clipboard/DataObject.h" | 8 #include "core/clipboard/DataObject.h" |
9 #include "public/platform/WebVector.h" | 9 #include "public/platform/WebVector.h" |
10 #include <gtest/gtest.h> | 10 #include <gtest/gtest.h> |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 TEST(WebDragDataTest, items) | 14 TEST(WebDragDataTest, items) |
15 { | 15 { |
16 RefPtrWillBeRawPtr<DataObject> dataObject = DataObject::create(); | 16 DataObject* dataObject = DataObject::create(); |
17 | 17 |
18 // Native file. | 18 // Native file. |
19 dataObject->add(File::create("/native/path")); | 19 dataObject->add(File::create("/native/path")); |
20 | 20 |
21 // Blob file. | 21 // Blob file. |
22 const RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(); | 22 const RefPtr<BlobDataHandle> blobDataHandle = BlobDataHandle::create(); |
23 dataObject->add(File::create("name", 0.0, blobDataHandle)); | 23 dataObject->add(File::create("name", 0.0, blobDataHandle)); |
24 | 24 |
25 // User visible snapshot file. | 25 // User visible snapshot file. |
26 { | 26 { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 EXPECT_EQ(WebDragData::Item::StorageTypeFileSystemFile, items[4].storageType
); | 75 EXPECT_EQ(WebDragData::Item::StorageTypeFileSystemFile, items[4].storageType
); |
76 EXPECT_EQ("filesystem:http://example.com/isolated/hash/visible-non-native-fi
le", items[4].fileSystemURL); | 76 EXPECT_EQ("filesystem:http://example.com/isolated/hash/visible-non-native-fi
le", items[4].fileSystemURL); |
77 EXPECT_EQ(1234, items[4].fileSystemFileSize); | 77 EXPECT_EQ(1234, items[4].fileSystemFileSize); |
78 | 78 |
79 EXPECT_EQ(WebDragData::Item::StorageTypeFileSystemFile, items[5].storageType
); | 79 EXPECT_EQ(WebDragData::Item::StorageTypeFileSystemFile, items[5].storageType
); |
80 EXPECT_EQ("filesystem:http://example.com/isolated/hash/not-visible-non-nativ
e-file", items[5].fileSystemURL); | 80 EXPECT_EQ("filesystem:http://example.com/isolated/hash/not-visible-non-nativ
e-file", items[5].fileSystemURL); |
81 EXPECT_EQ(1234, items[5].fileSystemFileSize); | 81 EXPECT_EQ(1234, items[5].fileSystemFileSize); |
82 } | 82 } |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
OLD | NEW |