| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_ | 11 #ifndef WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_ |
| 12 #define WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_ | 12 #define WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/base/location.h" |
| 16 #include "webrtc/modules/utility/include/process_thread.h" | 17 #include "webrtc/modules/utility/include/process_thread.h" |
| 17 | |
| 18 #include "webrtc/test/gmock.h" | 18 #include "webrtc/test/gmock.h" |
| 19 | 19 |
| 20 namespace webrtc { | 20 namespace webrtc { |
| 21 | 21 |
| 22 class MockProcessThread : public ProcessThread { | 22 class MockProcessThread : public ProcessThread { |
| 23 public: | 23 public: |
| 24 // TODO(nisse): Valid overrides commented out, because the gmock | 24 // TODO(nisse): Valid overrides commented out, because the gmock |
| 25 // methods don't use any override declarations, and we want to avoid | 25 // methods don't use any override declarations, and we want to avoid |
| 26 // warnings from -Winconsistent-missing-override. See | 26 // warnings from -Winconsistent-missing-override. See |
| 27 // http://crbug.com/428099. | 27 // http://crbug.com/428099. |
| 28 MOCK_METHOD0(Start, void()); | 28 MOCK_METHOD0(Start, void()); |
| 29 MOCK_METHOD0(Stop, void()); | 29 MOCK_METHOD0(Stop, void()); |
| 30 MOCK_METHOD1(WakeUp, void(Module* module)); | 30 MOCK_METHOD1(WakeUp, void(Module* module)); |
| 31 MOCK_METHOD1(PostTask, void(rtc::QueuedTask* task)); | 31 MOCK_METHOD1(PostTask, void(rtc::QueuedTask* task)); |
| 32 MOCK_METHOD1(RegisterModule, void(Module* module)); | 32 MOCK_METHOD2(RegisterModule, void(Module* module, const rtc::Location&)); |
| 33 MOCK_METHOD1(DeRegisterModule, void(Module* module)); | 33 MOCK_METHOD1(DeRegisterModule, void(Module* module)); |
| 34 | 34 |
| 35 // MOCK_METHOD1 gets confused with mocking this method, so we work around it | 35 // MOCK_METHOD1 gets confused with mocking this method, so we work around it |
| 36 // by overriding the method from the interface and forwarding the call to a | 36 // by overriding the method from the interface and forwarding the call to a |
| 37 // mocked, simpler method. | 37 // mocked, simpler method. |
| 38 void PostTask(std::unique_ptr<rtc::QueuedTask> task) /*override*/ { | 38 void PostTask(std::unique_ptr<rtc::QueuedTask> task) /*override*/ { |
| 39 PostTask(task.get()); | 39 PostTask(task.get()); |
| 40 } | 40 } |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace webrtc | 43 } // namespace webrtc |
| 44 #endif // WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_ | 44 #endif // WEBRTC_MODULES_UTILITY_INCLUDE_MOCK_MOCK_PROCESS_THREAD_H_ |
| OLD | NEW |