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

Side by Side Diff: components/bookmarks/browser/bookmark_node_data_unittest.cc

Issue 2179813003: Allow OSExchangeData::Provider to be overridden at run time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac + win Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698