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 #ifndef SYNC_JS_JS_TEST_UTIL_H_ | 5 #ifndef SYNC_JS_JS_TEST_UTIL_H_ |
6 #define SYNC_JS_JS_TEST_UTIL_H_ | 6 #define SYNC_JS_JS_TEST_UTIL_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Defined for googletest. Equivalent to "*os << args.ToString()". | 29 // Defined for googletest. Equivalent to "*os << args.ToString()". |
30 void PrintTo(const JsArgList& args, ::std::ostream* os); | 30 void PrintTo(const JsArgList& args, ::std::ostream* os); |
31 void PrintTo(const JsEventDetails& details, ::std::ostream* os); | 31 void PrintTo(const JsEventDetails& details, ::std::ostream* os); |
32 | 32 |
33 // A gmock matcher for JsArgList. Use like: | 33 // A gmock matcher for JsArgList. Use like: |
34 // | 34 // |
35 // EXPECT_CALL(mock, HandleJsReply("foo", HasArgs(expected_args))); | 35 // EXPECT_CALL(mock, HandleJsReply("foo", HasArgs(expected_args))); |
36 ::testing::Matcher<const JsArgList&> HasArgs(const JsArgList& expected_args); | 36 ::testing::Matcher<const JsArgList&> HasArgs(const JsArgList& expected_args); |
37 | 37 |
38 // Like HasArgs() but takes a ListValue instead. | |
39 ::testing::Matcher<const JsArgList&> HasArgsAsList( | |
40 const base::ListValue& expected_args); | |
41 | |
42 // A gmock matcher for JsEventDetails. Use like: | 38 // A gmock matcher for JsEventDetails. Use like: |
43 // | 39 // |
44 // EXPECT_CALL(mock, HandleJsEvent("foo", HasArgs(expected_details))); | 40 // EXPECT_CALL(mock, HandleJsEvent("foo", HasArgs(expected_details))); |
45 ::testing::Matcher<const JsEventDetails&> HasDetails( | 41 ::testing::Matcher<const JsEventDetails&> HasDetails( |
46 const JsEventDetails& expected_details); | 42 const JsEventDetails& expected_details); |
47 | 43 |
48 // Like HasDetails() but takes a DictionaryValue instead. | 44 // Like HasDetails() but takes a DictionaryValue instead. |
49 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( | 45 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( |
50 const base::DictionaryValue& expected_details); | 46 const base::DictionaryValue& expected_details); |
51 | 47 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 95 |
100 WeakHandle<JsReplyHandler> AsWeakHandle(); | 96 WeakHandle<JsReplyHandler> AsWeakHandle(); |
101 | 97 |
102 MOCK_METHOD2(HandleJsReply, | 98 MOCK_METHOD2(HandleJsReply, |
103 void(const ::std::string&, const JsArgList&)); | 99 void(const ::std::string&, const JsArgList&)); |
104 }; | 100 }; |
105 | 101 |
106 } // namespace syncer | 102 } // namespace syncer |
107 | 103 |
108 #endif // SYNC_JS_JS_TEST_UTIL_H_ | 104 #endif // SYNC_JS_JS_TEST_UTIL_H_ |
OLD | NEW |