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

Side by Side Diff: sync/js/js_test_util.cc

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/js/js_test_util.h" 5 #include "sync/js/js_test_util.h"
6 6
7 #include <memory>
8
7 #include "base/macros.h" 9 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "sync/js/js_event_details.h" 10 #include "sync/js/js_event_details.h"
10 11
11 namespace syncer { 12 namespace syncer {
12 13
13 void PrintTo(const JsEventDetails& details, ::std::ostream* os) { 14 void PrintTo(const JsEventDetails& details, ::std::ostream* os) {
14 *os << details.ToString(); 15 *os << details.ToString();
15 } 16 }
16 17
17 namespace { 18 namespace {
18 19
(...skipping 29 matching lines...) Expand all
48 49
49 } // namespace 50 } // namespace
50 51
51 ::testing::Matcher<const JsEventDetails&> HasDetails( 52 ::testing::Matcher<const JsEventDetails&> HasDetails(
52 const JsEventDetails& expected_details) { 53 const JsEventDetails& expected_details) {
53 return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details)); 54 return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details));
54 } 55 }
55 56
56 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( 57 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary(
57 const base::DictionaryValue& expected_details) { 58 const base::DictionaryValue& expected_details) {
58 scoped_ptr<base::DictionaryValue> expected_details_copy( 59 std::unique_ptr<base::DictionaryValue> expected_details_copy(
59 expected_details.DeepCopy()); 60 expected_details.DeepCopy());
60 return HasDetails(JsEventDetails(expected_details_copy.get())); 61 return HasDetails(JsEventDetails(expected_details_copy.get()));
61 } 62 }
62 63
63 MockJsBackend::MockJsBackend() {} 64 MockJsBackend::MockJsBackend() {}
64 65
65 MockJsBackend::~MockJsBackend() {} 66 MockJsBackend::~MockJsBackend() {}
66 67
67 WeakHandle<JsBackend> MockJsBackend::AsWeakHandle() { 68 WeakHandle<JsBackend> MockJsBackend::AsWeakHandle() {
68 return MakeWeakHandle(AsWeakPtr()); 69 return MakeWeakHandle(AsWeakPtr());
69 } 70 }
70 71
71 MockJsController::MockJsController() {} 72 MockJsController::MockJsController() {}
72 73
73 MockJsController::~MockJsController() {} 74 MockJsController::~MockJsController() {}
74 75
75 MockJsEventHandler::MockJsEventHandler() {} 76 MockJsEventHandler::MockJsEventHandler() {}
76 77
77 WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() { 78 WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() {
78 return MakeWeakHandle(AsWeakPtr()); 79 return MakeWeakHandle(AsWeakPtr());
79 } 80 }
80 81
81 MockJsEventHandler::~MockJsEventHandler() {} 82 MockJsEventHandler::~MockJsEventHandler() {}
82 83
83 } // namespace syncer 84 } // namespace syncer
84 85
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698