OLD | NEW |
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 <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/macros.h" |
10 #include "media/base/media_log.h" | 11 #include "media/base/media_log.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
12 | 13 |
13 // Helper macros to reduce boilerplate when verifying media log entries. | 14 // Helper macros to reduce boilerplate when verifying media log entries. |
14 // |outer| is the std::string searched for substring |sub|. | 15 // |outer| is the std::string searched for substring |sub|. |
15 #define CONTAINS_STRING(outer, sub) (std::string::npos != (outer).find(sub)) | 16 #define CONTAINS_STRING(outer, sub) (std::string::npos != (outer).find(sub)) |
16 | 17 |
17 // "media_log_" is expected to be a scoped_refptr<MockMediaLog>, optionally a | 18 // "media_log_" is expected to be a scoped_refptr<MockMediaLog>, optionally a |
18 // StrictMock, in scope of the usage of this macro. | 19 // StrictMock, in scope of the usage of this macro. |
19 #define EXPECT_MEDIA_LOG(x) EXPECT_CALL(*media_log_, DoAddEventLogString((x))) | 20 #define EXPECT_MEDIA_LOG(x) EXPECT_CALL(*media_log_, DoAddEventLogString((x))) |
(...skipping 16 matching lines...) Expand all Loading... |
36 protected: | 37 protected: |
37 virtual ~MockMediaLog(); | 38 virtual ~MockMediaLog(); |
38 | 39 |
39 private: | 40 private: |
40 DISALLOW_COPY_AND_ASSIGN(MockMediaLog); | 41 DISALLOW_COPY_AND_ASSIGN(MockMediaLog); |
41 }; | 42 }; |
42 | 43 |
43 } // namespace media | 44 } // namespace media |
44 | 45 |
45 #endif // MEDIA_BASE_MOCK_MEDIA_LOG_H_ | 46 #endif // MEDIA_BASE_MOCK_MEDIA_LOG_H_ |
OLD | NEW |