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

Unified Diff: media/blink/watch_time_reporter_unittest.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/watch_time_reporter.cc ('k') | media/blink/webaudiosourceprovider_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/watch_time_reporter_unittest.cc
diff --git a/media/blink/watch_time_reporter_unittest.cc b/media/blink/watch_time_reporter_unittest.cc
index 2aa2635a047d4a5e6e6f236b4663251115f6457a..7e075e36680c5f98d47374f799fea9828c64049e 100644
--- a/media/blink/watch_time_reporter_unittest.cc
+++ b/media/blink/watch_time_reporter_unittest.cc
@@ -20,7 +20,7 @@ constexpr gfx::Size kSizeJustRight = gfx::Size(201, 201);
#define EXPECT_WATCH_TIME(key, value) \
do { \
EXPECT_CALL( \
- *media_log_, \
+ media_log_, \
OnWatchTimeUpdate(has_video_ ? MediaLog::kWatchTimeAudioVideo##key \
: MediaLog::kWatchTimeAudio##key, \
value)) \
@@ -30,23 +30,21 @@ constexpr gfx::Size kSizeJustRight = gfx::Size(201, 201);
#define EXPECT_BACKGROUND_WATCH_TIME(key, value) \
do { \
DCHECK(has_video_); \
- EXPECT_CALL(*media_log_, \
+ EXPECT_CALL(media_log_, \
OnWatchTimeUpdate( \
MediaLog::kWatchTimeAudioVideoBackground##key, value)) \
.RetiresOnSaturation(); \
} while (0)
#define EXPECT_WATCH_TIME_FINALIZED() \
- EXPECT_CALL(*media_log_, OnWatchTimeFinalized()).RetiresOnSaturation();
+ EXPECT_CALL(media_log_, OnWatchTimeFinalized()).RetiresOnSaturation();
#define EXPECT_POWER_WATCH_TIME_FINALIZED() \
- EXPECT_CALL(*media_log_, OnPowerWatchTimeFinalized()).RetiresOnSaturation();
+ EXPECT_CALL(media_log_, OnPowerWatchTimeFinalized()).RetiresOnSaturation();
class WatchTimeReporterTest : public testing::TestWithParam<bool> {
public:
- WatchTimeReporterTest()
- : has_video_(GetParam()),
- media_log_(new testing::StrictMock<WatchTimeLogMonitor>()) {}
+ WatchTimeReporterTest() : has_video_(GetParam()) {}
~WatchTimeReporterTest() override {}
protected:
@@ -93,7 +91,7 @@ class WatchTimeReporterTest : public testing::TestWithParam<bool> {
EXPECT_WATCH_TIME_FINALIZED();
wtr_.reset(new WatchTimeReporter(
- has_audio, has_video_, is_mse, is_encrypted, false, media_log_,
+ has_audio, has_video_, is_mse, is_encrypted, false, &media_log_,
initial_video_size,
base::Bind(&WatchTimeReporterTest::GetCurrentMediaTime,
base::Unretained(this))));
@@ -263,8 +261,8 @@ class WatchTimeReporterTest : public testing::TestWithParam<bool> {
MOCK_METHOD0(GetCurrentMediaTime, base::TimeDelta());
const bool has_video_;
+ testing::StrictMock<WatchTimeLogMonitor> media_log_;
base::TestMessageLoop message_loop_;
- scoped_refptr<testing::StrictMock<WatchTimeLogMonitor>> media_log_;
std::unique_ptr<WatchTimeReporter> wtr_;
private:
« no previous file with comments | « media/blink/watch_time_reporter.cc ('k') | media/blink/webaudiosourceprovider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698