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 COMPONENTS_SYNC_JS_JS_TEST_UTIL_H_ |
6 #define SYNC_JS_JS_TEST_UTIL_H_ | 6 #define COMPONENTS_SYNC_JS_JS_TEST_UTIL_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "sync/internal_api/public/util/weak_handle.h" | 12 #include "components/sync/base/weak_handle.h" |
13 #include "sync/js/js_backend.h" | 13 #include "components/sync/js/js_backend.h" |
14 #include "sync/js/js_controller.h" | 14 #include "components/sync/js/js_controller.h" |
15 #include "sync/js/js_event_handler.h" | 15 #include "components/sync/js/js_event_handler.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 class ListValue; | 20 class ListValue; |
21 } | 21 } |
22 | 22 |
23 namespace syncer { | 23 namespace syncer { |
24 | 24 |
25 class JsEventDetails; | 25 class JsEventDetails; |
(...skipping 27 matching lines...) Expand all Loading... |
53 class MockJsController : public JsController, | 53 class MockJsController : public JsController, |
54 public base::SupportsWeakPtr<MockJsController> { | 54 public base::SupportsWeakPtr<MockJsController> { |
55 public: | 55 public: |
56 MockJsController(); | 56 MockJsController(); |
57 virtual ~MockJsController(); | 57 virtual ~MockJsController(); |
58 | 58 |
59 MOCK_METHOD1(AddJsEventHandler, void(JsEventHandler*)); | 59 MOCK_METHOD1(AddJsEventHandler, void(JsEventHandler*)); |
60 MOCK_METHOD1(RemoveJsEventHandler, void(JsEventHandler*)); | 60 MOCK_METHOD1(RemoveJsEventHandler, void(JsEventHandler*)); |
61 }; | 61 }; |
62 | 62 |
63 class MockJsEventHandler | 63 class MockJsEventHandler : public JsEventHandler, |
64 : public JsEventHandler, | 64 public base::SupportsWeakPtr<MockJsEventHandler> { |
65 public base::SupportsWeakPtr<MockJsEventHandler> { | |
66 public: | 65 public: |
67 MockJsEventHandler(); | 66 MockJsEventHandler(); |
68 virtual ~MockJsEventHandler(); | 67 virtual ~MockJsEventHandler(); |
69 | 68 |
70 WeakHandle<JsEventHandler> AsWeakHandle(); | 69 WeakHandle<JsEventHandler> AsWeakHandle(); |
71 | 70 |
72 MOCK_METHOD2(HandleJsEvent, | 71 MOCK_METHOD2(HandleJsEvent, |
73 void(const ::std::string&, const JsEventDetails&)); | 72 void(const ::std::string&, const JsEventDetails&)); |
74 }; | 73 }; |
75 | 74 |
76 } // namespace syncer | 75 } // namespace syncer |
77 | 76 |
78 #endif // SYNC_JS_JS_TEST_UTIL_H_ | 77 #endif // COMPONENTS_SYNC_JS_JS_TEST_UTIL_H_ |
OLD | NEW |