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/mp4/aac.h" | 5 #include "media/formats/mp4/aac.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
11 namespace mp4 { | 11 namespace mp4 { |
12 | 12 |
13 class AACTest : public testing::Test { | 13 class AACTest : public testing::Test { |
14 public: | 14 public: |
15 bool Parse(const std::vector<uint8>& data) { | 15 bool Parse(const std::vector<uint8>& data) { |
16 return aac_.Parse(data, LogCB()); | 16 return aac_.Parse(data, new MediaLog()); |
17 } | 17 } |
18 | 18 |
19 AAC aac_; | 19 AAC aac_; |
20 }; | 20 }; |
21 | 21 |
22 TEST_F(AACTest, BasicProfileTest) { | 22 TEST_F(AACTest, BasicProfileTest) { |
23 uint8 buffer[] = {0x12, 0x10}; | 23 uint8 buffer[] = {0x12, 0x10}; |
24 std::vector<uint8> data; | 24 std::vector<uint8> data; |
25 | 25 |
26 data.assign(buffer, buffer + sizeof(buffer)); | 26 data.assign(buffer, buffer + sizeof(buffer)); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 EXPECT_FALSE(Parse(data)); | 138 EXPECT_FALSE(Parse(data)); |
139 | 139 |
140 data[1] = 0x08; | 140 data[1] = 0x08; |
141 EXPECT_TRUE(Parse(data)); | 141 EXPECT_TRUE(Parse(data)); |
142 } | 142 } |
143 | 143 |
144 } // namespace mp4 | 144 } // namespace mp4 |
145 | 145 |
146 } // namespace media | 146 } // namespace media |
OLD | NEW |