Skip to content

Commit

Permalink
Replace mock macros with unified MOCK_METHOD macro
Browse files Browse the repository at this point in the history
Bug: webrtc:11564
Change-Id: I6398b052ec85d2f739755723629bc5da98fb30e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176180
Reviewed-by: Karl Wiberg <[email protected]>
Commit-Queue: Danil Chapovalov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#31376}
  • Loading branch information
DanilChapovalov authored and Commit Bot committed May 28, 2020
1 parent 8edfe6e commit ed5d594
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions logging/rtc_event_log/mock/mock_rtc_event_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ namespace webrtc {
class MockRtcEventLog : public RtcEventLog {
public:
MockRtcEventLog();
~MockRtcEventLog();
~MockRtcEventLog() override;

virtual bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) {
return StartLoggingProxy(output.get(), output_period_ms);
}
MOCK_METHOD2(StartLoggingProxy, bool(RtcEventLogOutput*, int64_t));
MOCK_METHOD(bool,
StartLogging,
(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms),
(override));

MOCK_METHOD0(StopLogging, void());
MOCK_METHOD(void, StopLogging, (), (override));

virtual void Log(std::unique_ptr<RtcEvent> event) {
void Log(std::unique_ptr<RtcEvent> event) override {
return LogProxy(event.get());
}
MOCK_METHOD1(LogProxy, void(RtcEvent*));
MOCK_METHOD(void, LogProxy, (RtcEvent*));
};

} // namespace webrtc
Expand Down
7 changes: 4 additions & 3 deletions modules/desktop_capture/mock_desktop_capturer_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class MockDesktopCapturerCallback : public DesktopCapturer::Callback {
MockDesktopCapturerCallback();
~MockDesktopCapturerCallback() override;

MOCK_METHOD2(OnCaptureResultPtr,
void(DesktopCapturer::Result result,
std::unique_ptr<DesktopFrame>* frame));
MOCK_METHOD(void,
OnCaptureResultPtr,
(DesktopCapturer::Result result,
std::unique_ptr<DesktopFrame>* frame));
void OnCaptureResult(DesktopCapturer::Result result,
std::unique_ptr<DesktopFrame> frame) final;

Expand Down
6 changes: 3 additions & 3 deletions modules/utility/source/process_thread_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ static const int kEventWaitTimeout = 500;

class MockModule : public Module {
public:
MOCK_METHOD0(TimeUntilNextProcess, int64_t());
MOCK_METHOD0(Process, void());
MOCK_METHOD1(ProcessThreadAttached, void(ProcessThread*));
MOCK_METHOD(int64_t, TimeUntilNextProcess, (), (override));
MOCK_METHOD(void, Process, (), (override));
MOCK_METHOD(void, ProcessThreadAttached, (ProcessThread*), (override));
};

class RaiseEventTask : public QueuedTask {
Expand Down

0 comments on commit ed5d594

Please sign in to comment.