OLD | NEW |
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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "sync/js/js_arg_list.h" | 9 #include "sync/js/js_arg_list.h" |
10 #include "sync/js/js_event_details.h" | 10 #include "sync/js/js_event_details.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(HasDetailsMatcher); | 81 DISALLOW_COPY_AND_ASSIGN(HasDetailsMatcher); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace | 84 } // namespace |
85 | 85 |
86 ::testing::Matcher<const JsArgList&> HasArgs(const JsArgList& expected_args) { | 86 ::testing::Matcher<const JsArgList&> HasArgs(const JsArgList& expected_args) { |
87 return ::testing::MakeMatcher(new HasArgsMatcher(expected_args)); | 87 return ::testing::MakeMatcher(new HasArgsMatcher(expected_args)); |
88 } | 88 } |
89 | 89 |
90 ::testing::Matcher<const JsArgList&> HasArgsAsList( | |
91 const base::ListValue& expected_args) { | |
92 scoped_ptr<base::ListValue> expected_args_copy(expected_args.DeepCopy()); | |
93 return HasArgs(JsArgList(expected_args_copy.get())); | |
94 } | |
95 | |
96 ::testing::Matcher<const JsEventDetails&> HasDetails( | 90 ::testing::Matcher<const JsEventDetails&> HasDetails( |
97 const JsEventDetails& expected_details) { | 91 const JsEventDetails& expected_details) { |
98 return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details)); | 92 return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details)); |
99 } | 93 } |
100 | 94 |
101 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( | 95 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( |
102 const base::DictionaryValue& expected_details) { | 96 const base::DictionaryValue& expected_details) { |
103 scoped_ptr<base::DictionaryValue> expected_details_copy( | 97 scoped_ptr<base::DictionaryValue> expected_details_copy( |
104 expected_details.DeepCopy()); | 98 expected_details.DeepCopy()); |
105 return HasDetails(JsEventDetails(expected_details_copy.get())); | 99 return HasDetails(JsEventDetails(expected_details_copy.get())); |
(...skipping 22 matching lines...) Expand all Loading... |
128 MockJsReplyHandler::MockJsReplyHandler() {} | 122 MockJsReplyHandler::MockJsReplyHandler() {} |
129 | 123 |
130 MockJsReplyHandler::~MockJsReplyHandler() {} | 124 MockJsReplyHandler::~MockJsReplyHandler() {} |
131 | 125 |
132 WeakHandle<JsReplyHandler> MockJsReplyHandler::AsWeakHandle() { | 126 WeakHandle<JsReplyHandler> MockJsReplyHandler::AsWeakHandle() { |
133 return MakeWeakHandle(AsWeakPtr()); | 127 return MakeWeakHandle(AsWeakPtr()); |
134 } | 128 } |
135 | 129 |
136 } // namespace syncer | 130 } // namespace syncer |
137 | 131 |
OLD | NEW |