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 "core/clipboard/DataObject.h" | 5 #include "core/clipboard/DataObject.h" |
6 | 6 |
7 #include "core/clipboard/DataObjectItem.h" | 7 #include "core/clipboard/DataObjectItem.h" |
8 #include "platform/testing/UnitTestHelpers.h" | 8 #include "platform/testing/UnitTestHelpers.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 m_dataObject->addFilename(filePath, String()); | 29 m_dataObject->addFilename(filePath, String()); |
30 EXPECT_EQ(1U, m_dataObject->length()); | 30 EXPECT_EQ(1U, m_dataObject->length()); |
31 | 31 |
32 DataObjectItem* item = m_dataObject->item(0); | 32 DataObjectItem* item = m_dataObject->item(0); |
33 EXPECT_EQ(DataObjectItem::FileKind, item->kind()); | 33 EXPECT_EQ(DataObjectItem::FileKind, item->kind()); |
34 | 34 |
35 Blob* blob = item->getAsFile(); | 35 Blob* blob = item->getAsFile(); |
36 ASSERT_TRUE(blob->isFile()); | 36 ASSERT_TRUE(blob->isFile()); |
37 File* file = toFile(blob); | 37 File* file = toFile(blob); |
38 EXPECT_TRUE(file->hasBackingFile()); | 38 EXPECT_TRUE(file->hasBackingFile()); |
39 EXPECT_EQ(File::IsUserVisible, file->userVisibility()); | 39 EXPECT_EQ(File::IsUserVisible, file->getUserVisibility()); |
40 EXPECT_EQ(filePath, file->path()); | 40 EXPECT_EQ(filePath, file->path()); |
41 } | 41 } |
42 | 42 |
43 TEST_F(DataObjectTest, addItemWithFilenameAndTitle) | 43 TEST_F(DataObjectTest, addItemWithFilenameAndTitle) |
44 { | 44 { |
45 String filePath = testing::blinkRootDir(); | 45 String filePath = testing::blinkRootDir(); |
46 filePath.append("/Source/core/clipboard/DataObjectTest.cpp"); | 46 filePath.append("/Source/core/clipboard/DataObjectTest.cpp"); |
47 | 47 |
48 m_dataObject->addFilename(filePath, "name.cpp"); | 48 m_dataObject->addFilename(filePath, "name.cpp"); |
49 EXPECT_EQ(1U, m_dataObject->length()); | 49 EXPECT_EQ(1U, m_dataObject->length()); |
50 | 50 |
51 DataObjectItem* item = m_dataObject->item(0); | 51 DataObjectItem* item = m_dataObject->item(0); |
52 EXPECT_EQ(DataObjectItem::FileKind, item->kind()); | 52 EXPECT_EQ(DataObjectItem::FileKind, item->kind()); |
53 | 53 |
54 Blob* blob = item->getAsFile(); | 54 Blob* blob = item->getAsFile(); |
55 ASSERT_TRUE(blob->isFile()); | 55 ASSERT_TRUE(blob->isFile()); |
56 File* file = toFile(blob); | 56 File* file = toFile(blob); |
57 EXPECT_TRUE(file->hasBackingFile()); | 57 EXPECT_TRUE(file->hasBackingFile()); |
58 EXPECT_EQ(File::IsUserVisible, file->userVisibility()); | 58 EXPECT_EQ(File::IsUserVisible, file->getUserVisibility()); |
59 EXPECT_EQ(filePath, file->path()); | 59 EXPECT_EQ(filePath, file->path()); |
60 EXPECT_EQ("name.cpp", file->name()); | 60 EXPECT_EQ("name.cpp", file->name()); |
61 } | 61 } |
62 | 62 |
63 } // namespace blink | 63 } // namespace blink |
OLD | NEW |