OLD | NEW |
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/adts_stream_parser.h" | 5 #include "media/formats/mpeg/adts_stream_parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "media/formats/common/stream_parser_test_base.h" | 10 #include "media/formats/common/stream_parser_test_base.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 class ADTSStreamParserTest : public StreamParserTestBase, public testing::Test { | 15 class ADTSStreamParserTest : public StreamParserTestBase, public testing::Test { |
16 public: | 16 public: |
17 ADTSStreamParserTest() | 17 ADTSStreamParserTest() |
18 : StreamParserTestBase(base::WrapUnique(new ADTSStreamParser())) {} | 18 : StreamParserTestBase(base::MakeUnique<ADTSStreamParser>()) {} |
19 }; | 19 }; |
20 | 20 |
21 // Test parsing with small prime sized chunks to smoke out "power of | 21 // Test parsing with small prime sized chunks to smoke out "power of |
22 // 2" field size assumptions. | 22 // 2" field size assumptions. |
23 TEST_F(ADTSStreamParserTest, UnalignedAppend) { | 23 TEST_F(ADTSStreamParserTest, UnalignedAppend) { |
24 const std::string expected = | 24 const std::string expected = |
25 "NewSegment" | 25 "NewSegment" |
26 "{ 0K }" | 26 "{ 0K }" |
27 "{ 0K }" | 27 "{ 0K }" |
28 "{ 0K }" | 28 "{ 0K }" |
(...skipping 23 matching lines...) Expand all Loading... |
52 "{ 0K 23K 46K 69K 92K }" | 52 "{ 0K 23K 46K 69K 92K }" |
53 "{ 0K 23K 46K 69K 92K }" | 53 "{ 0K 23K 46K 69K 92K }" |
54 "EndOfSegment" | 54 "EndOfSegment" |
55 "NewSegment" | 55 "NewSegment" |
56 "{ 0K }" | 56 "{ 0K }" |
57 "EndOfSegment"; | 57 "EndOfSegment"; |
58 EXPECT_EQ(expected, ParseFile("sfx.adts", 512)); | 58 EXPECT_EQ(expected, ParseFile("sfx.adts", 512)); |
59 } | 59 } |
60 | 60 |
61 } // namespace media | 61 } // namespace media |
OLD | NEW |