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

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

Issue 2705353002: Fix mpeg-1 layer2 parsing typo. (Closed)
Patch Set: Nuke comment. Created 3 years, 10 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
« no previous file with comments | « media/formats/mpeg/mpeg1_audio_stream_parser.cc ('k') | media/test/data/sfx.mp2 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 30 matching lines...) Expand all
41 "{ 0K }" 41 "{ 0K }"
42 "EndOfSegment" 42 "EndOfSegment"
43 "NewSegment" 43 "NewSegment"
44 "{ 0K }" 44 "{ 0K }"
45 "{ 0K }" 45 "{ 0K }"
46 "EndOfSegment"; 46 "EndOfSegment";
47 EXPECT_EQ(expected, ParseFile("sfx.mp3", 17)); 47 EXPECT_EQ(expected, ParseFile("sfx.mp3", 17));
48 EXPECT_GT(last_audio_config().codec_delay(), 0); 48 EXPECT_GT(last_audio_config().codec_delay(), 0);
49 } 49 }
50 50
51 TEST_F(MPEG1AudioStreamParserTest, UnalignedAppendMP2) {
52 const std::string expected =
53 "NewSegment"
54 "{ 0K }"
55 "{ 0K }"
56 "{ 0K }"
57 "{ 0K }"
58 "EndOfSegment"
59 "NewSegment"
60 "{ 0K }"
61 "{ 0K }"
62 "{ 0K }"
63 "{ 0K }"
64 "{ 0K }"
65 "{ 0K }"
66 "EndOfSegment";
67 EXPECT_EQ(expected, ParseFile("sfx.mp2", 17));
68 EXPECT_GT(last_audio_config().codec_delay(), 0);
69 }
70
51 // Test parsing with a larger piece size to verify that multiple buffers 71 // Test parsing with a larger piece size to verify that multiple buffers
52 // are passed to |new_buffer_cb_|. 72 // are passed to |new_buffer_cb_|.
53 TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend512) { 73 TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend512) {
54 const std::string expected = 74 const std::string expected =
55 "NewSegment" 75 "NewSegment"
56 "{ 0K 26K 52K 78K }" 76 "{ 0K 26K 52K 78K }"
57 "EndOfSegment" 77 "EndOfSegment"
58 "NewSegment" 78 "NewSegment"
59 "{ 0K 26K 52K }" 79 "{ 0K 26K 52K }"
60 "{ 0K 26K 52K 78K }" 80 "{ 0K 26K 52K 78K }"
(...skipping 30 matching lines...) Expand all
91 buffer_ptr += kXingRemainingSize; 111 buffer_ptr += kXingRemainingSize;
92 112
93 // Append the first real frame and ensure we get a segment. 113 // Append the first real frame and ensure we get a segment.
94 const int kFirstRealFrameSize = 182; 114 const int kFirstRealFrameSize = 182;
95 EXPECT_EQ("NewSegment{ 0K }EndOfSegment", 115 EXPECT_EQ("NewSegment{ 0K }EndOfSegment",
96 ParseData(buffer_ptr, kFirstRealFrameSize)); 116 ParseData(buffer_ptr, kFirstRealFrameSize));
97 EXPECT_TRUE(last_audio_config().IsValidConfig()); 117 EXPECT_TRUE(last_audio_config().IsValidConfig());
98 } 118 }
99 119
100 } // namespace media 120 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mpeg/mpeg1_audio_stream_parser.cc ('k') | media/test/data/sfx.mp2 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698