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

Side by Side Diff: components/sync_sessions/revisit/bookmarks_page_revisit_observer_unittest.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/sync_sessions/revisit/bookmarks_page_revisit_observer.h" 5 #include "components/sync_sessions/revisit/bookmarks_page_revisit_observer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 33
34 private: 34 private:
35 const std::vector<const bookmarks::BookmarkNode*>& nodes_; 35 const std::vector<const bookmarks::BookmarkNode*>& nodes_;
36 }; 36 };
37 37
38 } // namespace 38 } // namespace
39 39
40 void RunObserver(const std::vector<const bookmarks::BookmarkNode*>& nodes) { 40 void RunObserver(const std::vector<const bookmarks::BookmarkNode*>& nodes) {
41 BookmarksPageRevisitObserver observer( 41 BookmarksPageRevisitObserver observer(
42 base::WrapUnique(new TestBookmarksByUrlProvider(nodes))); 42 base::MakeUnique<TestBookmarksByUrlProvider>(nodes));
43 observer.OnPageVisit(kExampleGurl, PageVisitObserver::kTransitionPage); 43 observer.OnPageVisit(kExampleGurl, PageVisitObserver::kTransitionPage);
44 } 44 }
45 45
46 void ExpectMiss(const std::vector<const bookmarks::BookmarkNode*>& nodes) { 46 void ExpectMiss(const std::vector<const bookmarks::BookmarkNode*>& nodes) {
47 base::HistogramTester histogram_tester; 47 base::HistogramTester histogram_tester;
48 RunObserver(nodes); 48 RunObserver(nodes);
49 histogram_tester.ExpectUniqueSample("Sync.PageRevisitBookmarksMissTransition", 49 histogram_tester.ExpectUniqueSample("Sync.PageRevisitBookmarksMissTransition",
50 PageVisitObserver::kTransitionPage, 1); 50 PageVisitObserver::kTransitionPage, 1);
51 histogram_tester.ExpectTotalCount("Sync.PageRevisitBookmarksDuration", 1); 51 histogram_tester.ExpectTotalCount("Sync.PageRevisitBookmarksDuration", 1);
52 } 52 }
(...skipping 23 matching lines...) Expand all
76 TEST(BookmarksPageRevisitObserver, MultipleMatchingBookmarks) { 76 TEST(BookmarksPageRevisitObserver, MultipleMatchingBookmarks) {
77 bookmarks::BookmarkNode node1(kExampleGurl); 77 bookmarks::BookmarkNode node1(kExampleGurl);
78 bookmarks::BookmarkNode node2(kExampleGurl); 78 bookmarks::BookmarkNode node2(kExampleGurl);
79 std::vector<const bookmarks::BookmarkNode*> nodes; 79 std::vector<const bookmarks::BookmarkNode*> nodes;
80 nodes.push_back(&node1); 80 nodes.push_back(&node1);
81 nodes.push_back(&node2); 81 nodes.push_back(&node2);
82 ExpectMatch(nodes); 82 ExpectMatch(nodes);
83 } 83 }
84 84
85 } // namespace sync_sessions 85 } // namespace sync_sessions
OLDNEW
« no previous file with comments | « components/sync_sessions/favicon_cache_unittest.cc ('k') | components/sync_sessions/revisit/page_revisit_broadcaster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698