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