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

Unified Diff: media/formats/webm/webm_tracks_parser_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/formats/webm/webm_tracks_parser.cc ('k') | media/formats/webm/webm_video_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_tracks_parser_unittest.cc
diff --git a/media/formats/webm/webm_tracks_parser_unittest.cc b/media/formats/webm/webm_tracks_parser_unittest.cc
index 1f3e08dc1e461ec8b1b973d21856a43b15ec6caf..2cdb2316ce1d1aa55ac7f61a52789522a0c1346a 100644
--- a/media/formats/webm/webm_tracks_parser_unittest.cc
+++ b/media/formats/webm/webm_tracks_parser_unittest.cc
@@ -30,7 +30,7 @@ static const double kDefaultTimecodeScaleInUs = 1000.0; // 1 ms resolution
class WebMTracksParserTest : public testing::Test {
public:
- WebMTracksParserTest() : media_log_(new StrictMock<MockMediaLog>()) {}
+ WebMTracksParserTest() {}
protected:
void VerifyTextTrackInfo(const uint8_t* buffer,
@@ -39,7 +39,7 @@ class WebMTracksParserTest : public testing::Test {
const std::string& name,
const std::string& language) {
std::unique_ptr<WebMTracksParser> parser(
- new WebMTracksParser(media_log_, false));
+ new WebMTracksParser(&media_log_, false));
int result = parser->Parse(buffer, buffer_size);
EXPECT_GT(result, 0);
@@ -58,7 +58,7 @@ class WebMTracksParserTest : public testing::Test {
EXPECT_TRUE(config.language() == language);
}
- scoped_refptr<StrictMock<MockMediaLog>> media_log_;
+ StrictMock<MockMediaLog> media_log_;
};
TEST_F(WebMTracksParserTest, SubtitleNoNameNoLang) {
@@ -110,7 +110,7 @@ TEST_F(WebMTracksParserTest, IgnoringTextTracks) {
const std::vector<uint8_t> buf = tb.Finish();
std::unique_ptr<WebMTracksParser> parser(
- new WebMTracksParser(media_log_, true));
+ new WebMTracksParser(&media_log_, true));
EXPECT_MEDIA_LOG(HasSubstr("Ignoring text track 1"));
EXPECT_MEDIA_LOG(HasSubstr("Ignoring text track 2"));
@@ -126,7 +126,7 @@ TEST_F(WebMTracksParserTest, IgnoringTextTracks) {
EXPECT_TRUE(ignored_tracks.find(2) != ignored_tracks.end());
// Test again w/o ignoring the test tracks.
- parser.reset(new WebMTracksParser(media_log_, false));
+ parser.reset(new WebMTracksParser(&media_log_, false));
result = parser->Parse(&buf[0], buf.size());
EXPECT_GT(result, 0);
@@ -147,7 +147,7 @@ TEST_F(WebMTracksParserTest, AudioVideoDefaultDurationUnset) {
const std::vector<uint8_t> buf = tb.Finish();
std::unique_ptr<WebMTracksParser> parser(
- new WebMTracksParser(media_log_, true));
+ new WebMTracksParser(&media_log_, true));
int result = parser->Parse(&buf[0], buf.size());
EXPECT_LE(0, result);
EXPECT_EQ(static_cast<int>(buf.size()), result);
@@ -177,7 +177,7 @@ TEST_F(WebMTracksParserTest, AudioVideoDefaultDurationSet) {
const std::vector<uint8_t> buf = tb.Finish();
std::unique_ptr<WebMTracksParser> parser(
- new WebMTracksParser(media_log_, true));
+ new WebMTracksParser(&media_log_, true));
int result = parser->Parse(&buf[0], buf.size());
EXPECT_LE(0, result);
EXPECT_EQ(static_cast<int>(buf.size()), result);
@@ -200,7 +200,7 @@ TEST_F(WebMTracksParserTest, InvalidZeroDefaultDurationSet) {
const std::vector<uint8_t> buf = tb.Finish();
std::unique_ptr<WebMTracksParser> parser(
- new WebMTracksParser(media_log_, true));
+ new WebMTracksParser(&media_log_, true));
EXPECT_MEDIA_LOG(HasSubstr("Illegal 0ns audio TrackEntry DefaultDuration"));
@@ -215,7 +215,7 @@ TEST_F(WebMTracksParserTest, HighTrackUID) {
const std::vector<uint8_t> buf = tb.Finish();
std::unique_ptr<WebMTracksParser> parser(
- new WebMTracksParser(media_log_, true));
+ new WebMTracksParser(&media_log_, true));
EXPECT_GT(parser->Parse(&buf[0], buf.size()),0);
}
« no previous file with comments | « media/formats/webm/webm_tracks_parser.cc ('k') | media/formats/webm/webm_video_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698