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

Side by Side Diff: media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc

Issue 2253943004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "media/formats/mpeg/mpeg1_audio_stream_parser.h" 5 #include "media/formats/mpeg/mpeg1_audio_stream_parser.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "media/base/test_data_util.h" 12 #include "media/base/test_data_util.h"
13 #include "media/formats/common/stream_parser_test_base.h" 13 #include "media/formats/common/stream_parser_test_base.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace media { 16 namespace media {
17 17
18 class MPEG1AudioStreamParserTest 18 class MPEG1AudioStreamParserTest
19 : public StreamParserTestBase, public testing::Test { 19 : public StreamParserTestBase, public testing::Test {
20 public: 20 public:
21 MPEG1AudioStreamParserTest() 21 MPEG1AudioStreamParserTest()
22 : StreamParserTestBase(base::WrapUnique(new MPEG1AudioStreamParser())) {} 22 : StreamParserTestBase(base::MakeUnique<MPEG1AudioStreamParser>()) {}
23 }; 23 };
24 24
25 // Test parsing with small prime sized chunks to smoke out "power of 25 // Test parsing with small prime sized chunks to smoke out "power of
26 // 2" field size assumptions. 26 // 2" field size assumptions.
27 TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend) { 27 TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend) {
28 const std::string expected = 28 const std::string expected =
29 "NewSegment" 29 "NewSegment"
30 "{ 0K }" 30 "{ 0K }"
31 "{ 0K }" 31 "{ 0K }"
32 "{ 0K }" 32 "{ 0K }"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 buffer_ptr += kXingRemainingSize; 91 buffer_ptr += kXingRemainingSize;
92 92
93 // Append the first real frame and ensure we get a segment. 93 // Append the first real frame and ensure we get a segment.
94 const int kFirstRealFrameSize = 182; 94 const int kFirstRealFrameSize = 182;
95 EXPECT_EQ("NewSegment{ 0K }EndOfSegment", 95 EXPECT_EQ("NewSegment{ 0K }EndOfSegment",
96 ParseData(buffer_ptr, kFirstRealFrameSize)); 96 ParseData(buffer_ptr, kFirstRealFrameSize));
97 EXPECT_TRUE(last_audio_config().IsValidConfig()); 97 EXPECT_TRUE(last_audio_config().IsValidConfig());
98 } 98 }
99 99
100 } // namespace media 100 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mpeg/adts_stream_parser_unittest.cc ('k') | media/gpu/vt_video_decode_accelerator_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698