| 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 6bcfc3823ccfa9f981b9156d5112a119784409c9..0b36fbf37c68f3344e939860b30b72fae71f94f4 100644
|
| --- a/media/formats/webm/webm_tracks_parser_unittest.cc
|
| +++ b/media/formats/webm/webm_tracks_parser_unittest.cc
|
| @@ -2,16 +2,19 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "media/formats/webm/webm_tracks_parser.h"
|
| +
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| +#include <memory>
|
| +
|
| #include "base/logging.h"
|
| #include "media/base/channel_layout.h"
|
| #include "media/base/mock_media_log.h"
|
| #include "media/base/timestamp_constants.h"
|
| #include "media/formats/webm/tracks_builder.h"
|
| #include "media/formats/webm/webm_constants.h"
|
| -#include "media/formats/webm/webm_tracks_parser.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -35,7 +38,7 @@ class WebMTracksParserTest : public testing::Test {
|
| TextKind text_kind,
|
| const std::string& name,
|
| const std::string& language) {
|
| - scoped_ptr<WebMTracksParser> parser(
|
| + std::unique_ptr<WebMTracksParser> parser(
|
| new WebMTracksParser(media_log_, false));
|
|
|
| int result = parser->Parse(buffer, buffer_size);
|
| @@ -106,7 +109,8 @@ TEST_F(WebMTracksParserTest, IgnoringTextTracks) {
|
| tb.AddTextTrack(2, 2, kWebMCodecSubtitles, "Commentary", "fre");
|
|
|
| const std::vector<uint8_t> buf = tb.Finish();
|
| - scoped_ptr<WebMTracksParser> parser(new WebMTracksParser(media_log_, true));
|
| + std::unique_ptr<WebMTracksParser> parser(
|
| + new WebMTracksParser(media_log_, true));
|
|
|
| EXPECT_MEDIA_LOG(HasSubstr("Ignoring text track 1"));
|
| EXPECT_MEDIA_LOG(HasSubstr("Ignoring text track 2"));
|
| @@ -142,7 +146,8 @@ TEST_F(WebMTracksParserTest, AudioVideoDefaultDurationUnset) {
|
| tb.AddVideoTrack(2, 2, "V_VP8", "video", "", -1, 320, 240);
|
| const std::vector<uint8_t> buf = tb.Finish();
|
|
|
| - scoped_ptr<WebMTracksParser> parser(new WebMTracksParser(media_log_, true));
|
| + std::unique_ptr<WebMTracksParser> parser(
|
| + 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);
|
| @@ -171,7 +176,8 @@ TEST_F(WebMTracksParserTest, AudioVideoDefaultDurationSet) {
|
| tb.AddVideoTrack(2, 2, "V_VP8", "video", "", 987654321, 320, 240);
|
| const std::vector<uint8_t> buf = tb.Finish();
|
|
|
| - scoped_ptr<WebMTracksParser> parser(new WebMTracksParser(media_log_, true));
|
| + std::unique_ptr<WebMTracksParser> parser(
|
| + 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);
|
| @@ -193,7 +199,8 @@ TEST_F(WebMTracksParserTest, InvalidZeroDefaultDurationSet) {
|
| tb.AddAudioTrack(1, 1, "A_VORBIS", "audio", "", 0, 2, 8000);
|
| const std::vector<uint8_t> buf = tb.Finish();
|
|
|
| - scoped_ptr<WebMTracksParser> parser(new WebMTracksParser(media_log_, true));
|
| + std::unique_ptr<WebMTracksParser> parser(
|
| + new WebMTracksParser(media_log_, true));
|
|
|
| EXPECT_MEDIA_LOG(HasSubstr("Illegal 0ns audio TrackEntry DefaultDuration"));
|
|
|
| @@ -207,7 +214,8 @@ TEST_F(WebMTracksParserTest, HighTrackUID) {
|
| tb.AddAudioTrack(1, 1ULL << 31, "A_VORBIS", "audio", "", 40, 2, 8000);
|
| const std::vector<uint8_t> buf = tb.Finish();
|
|
|
| - scoped_ptr<WebMTracksParser> parser(new WebMTracksParser(media_log_, true));
|
| + std::unique_ptr<WebMTracksParser> parser(
|
| + new WebMTracksParser(media_log_, true));
|
| EXPECT_GT(parser->Parse(&buf[0], buf.size()),0);
|
| }
|
|
|
|
|