Chromium Code Reviews| Index: media/base/mock_media_log.h |
| diff --git a/media/base/mock_media_log.h b/media/base/mock_media_log.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a113e362b9ee060f94aa0dd73576cd783ba9bec9 |
| --- /dev/null |
| +++ b/media/base/mock_media_log.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
|
xhwang
2015/08/11 07:04:36
nit: s/(c)//
See https://code.google.com/p/chrom
wolenetz
2015/08/11 15:54:40
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_BASE_MOCK_MEDIA_LOG_H_ |
| +#define MEDIA_BASE_MOCK_MEDIA_LOG_H_ |
| + |
| +#include "media/base/media_log.h" |
| +#include "testing/gmock/include/gmock/gmock.h" |
| + |
| +namespace media { |
| + |
| +class MockMediaLog : public MediaLog { |
| + public: |
| + MockMediaLog(); |
| + |
| + MOCK_METHOD1(DoAddEventLogString, void(std::string event)); |
|
xhwang
2015/08/11 07:04:36
nit: const std::string&
wolenetz
2015/08/11 15:54:40
Done.
|
| + |
| + // Trampoline method to workaround GMOCK problems with scoped_ptr<>. |
| + // Also simplifies tests to be able to string match on the log string |
| + // representation on the added event. |
| + void AddEvent(scoped_ptr<MediaLogEvent> event) override { |
| + DoAddEventLogString(MediaEventToLogString(*event)); |
| + } |
| + |
| + protected: |
| + virtual ~MockMediaLog(); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(MockMediaLog); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_MOCK_MEDIA_LOG_H_ |