| 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 "components/bookmarks/browser/bookmark_node_data.h" | 5 #include "components/bookmarks/browser/bookmark_node_data.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 base::ScopedTempDir profile_dir_; | 55 base::ScopedTempDir profile_dir_; |
| 56 std::unique_ptr<BookmarkModel> model_; | 56 std::unique_ptr<BookmarkModel> model_; |
| 57 std::unique_ptr<ui::PlatformEventSource> event_source_; | 57 std::unique_ptr<ui::PlatformEventSource> event_source_; |
| 58 base::MessageLoopForUI loop_; | 58 base::MessageLoopForUI loop_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(BookmarkNodeDataTest); | 60 DISALLOW_COPY_AND_ASSIGN(BookmarkNodeDataTest); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 namespace { | 63 namespace { |
| 64 | 64 |
| 65 ui::OSExchangeData::Provider* CloneProvider(const ui::OSExchangeData& data) { | 65 std::unique_ptr<ui::OSExchangeData::Provider> CloneProvider( |
| 66 const ui::OSExchangeData& data) { |
| 66 return data.provider().Clone(); | 67 return data.provider().Clone(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace | 70 } // namespace |
| 70 | 71 |
| 71 // Makes sure BookmarkNodeData is initially invalid. | 72 // Makes sure BookmarkNodeData is initially invalid. |
| 72 TEST_F(BookmarkNodeDataTest, InitialState) { | 73 TEST_F(BookmarkNodeDataTest, InitialState) { |
| 73 BookmarkNodeData data; | 74 BookmarkNodeData data; |
| 74 EXPECT_FALSE(data.is_valid()); | 75 EXPECT_FALSE(data.is_valid()); |
| 75 } | 76 } |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 ASSERT_EQ(1u, read_data.size()); | 399 ASSERT_EQ(1u, read_data.size()); |
| 399 | 400 |
| 400 // Verify that the read data contains the same meta info. | 401 // Verify that the read data contains the same meta info. |
| 401 BookmarkNode::MetaInfoMap meta_info_map = read_data.elements[0].meta_info_map; | 402 BookmarkNode::MetaInfoMap meta_info_map = read_data.elements[0].meta_info_map; |
| 402 EXPECT_EQ(2u, meta_info_map.size()); | 403 EXPECT_EQ(2u, meta_info_map.size()); |
| 403 EXPECT_EQ("somevalue", meta_info_map["somekey"]); | 404 EXPECT_EQ("somevalue", meta_info_map["somekey"]); |
| 404 EXPECT_EQ("someothervalue", meta_info_map["someotherkey"]); | 405 EXPECT_EQ("someothervalue", meta_info_map["someotherkey"]); |
| 405 } | 406 } |
| 406 | 407 |
| 407 } // namespace bookmarks | 408 } // namespace bookmarks |
| OLD | NEW |