Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: media/base/mock_media_log.h

Issue 1300943002: MSE: Verify MediaLog events created by existing WebM unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MEDIA_BASE_MOCK_MEDIA_LOG_H_ 5 #ifndef MEDIA_BASE_MOCK_MEDIA_LOG_H_
6 #define MEDIA_BASE_MOCK_MEDIA_LOG_H_ 6 #define MEDIA_BASE_MOCK_MEDIA_LOG_H_
7 7
8 #include "media/base/media_log.h" 8 #include "media/base/media_log.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 10
11 // Helper macro to reduce boilerplate when verifying media log entries.
12 // "media_log_" is expected to be a scoped_refptr<MockMediaLog>, optionally a
13 // StrictMock, in scope of the usage of this macro.
14 #define EXPECT_MEDIA_LOG_STRING(x) \
wolenetz 2015/08/18 21:13:48 I lifted this helper macro out of SourceBufferStre
15 EXPECT_CALL(*media_log_, DoAddEventLogString((x)))
16
11 namespace media { 17 namespace media {
12 18
13 class MockMediaLog : public MediaLog { 19 class MockMediaLog : public MediaLog {
14 public: 20 public:
15 MockMediaLog(); 21 MockMediaLog();
16 22
17 MOCK_METHOD1(DoAddEventLogString, void(const std::string& event)); 23 MOCK_METHOD1(DoAddEventLogString, void(const std::string& event));
18 24
19 // Trampoline method to workaround GMOCK problems with scoped_ptr<>. 25 // Trampoline method to workaround GMOCK problems with scoped_ptr<>.
20 // Also simplifies tests to be able to string match on the log string 26 // Also simplifies tests to be able to string match on the log string
21 // representation on the added event. 27 // representation on the added event.
22 void AddEvent(scoped_ptr<MediaLogEvent> event) override { 28 void AddEvent(scoped_ptr<MediaLogEvent> event) override {
23 DoAddEventLogString(MediaEventToLogString(*event)); 29 DoAddEventLogString(MediaEventToLogString(*event));
24 } 30 }
25 31
26 protected: 32 protected:
27 virtual ~MockMediaLog(); 33 virtual ~MockMediaLog();
28 34
29 private: 35 private:
30 DISALLOW_COPY_AND_ASSIGN(MockMediaLog); 36 DISALLOW_COPY_AND_ASSIGN(MockMediaLog);
31 }; 37 };
32 38
33 } // namespace media 39 } // namespace media
34 40
35 #endif // MEDIA_BASE_MOCK_MEDIA_LOG_H_ 41 #endif // MEDIA_BASE_MOCK_MEDIA_LOG_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/source_buffer_stream_unittest.cc » ('j') | media/formats/webm/webm_cluster_parser_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698