OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" |
5 #include "media/webm/webm_constants.h" | 6 #include "media/webm/webm_constants.h" |
6 #include "media/webm/webm_content_encodings_client.h" | 7 #include "media/webm/webm_content_encodings_client.h" |
7 #include "media/webm/webm_parser.h" | 8 #include "media/webm/webm_parser.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 | 10 |
10 namespace media { | 11 namespace media { |
11 | 12 |
12 class WebMContentEncodingsClientTest : public testing::Test { | 13 class WebMContentEncodingsClientTest : public testing::Test { |
13 public: | 14 public: |
14 WebMContentEncodingsClientTest() | 15 WebMContentEncodingsClientTest() |
15 : parser_(kWebMIdContentEncodings, &client_) {} | 16 : client_(LogCB()), |
| 17 parser_(kWebMIdContentEncodings, &client_) {} |
16 | 18 |
17 void ParseAndExpectToFail(const uint8* buf, int size) { | 19 void ParseAndExpectToFail(const uint8* buf, int size) { |
18 int result = parser_.Parse(buf, size); | 20 int result = parser_.Parse(buf, size); |
19 EXPECT_EQ(-1, result); | 21 EXPECT_EQ(-1, result); |
20 } | 22 } |
21 | 23 |
22 protected: | 24 protected: |
23 WebMContentEncodingsClient client_; | 25 WebMContentEncodingsClient client_; |
24 WebMListParser parser_; | 26 WebMListParser parser_; |
25 }; | 27 }; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 0x50, 0x35, 0x8F, // ContentEncryption (size = 15) | 229 0x50, 0x35, 0x8F, // ContentEncryption (size = 15) |
228 0x47, 0xE1, 0x81, 0xEE, // ContentEncAlgo (size = 1), invalid | 230 0x47, 0xE1, 0x81, 0xEE, // ContentEncAlgo (size = 1), invalid |
229 0x47, 0xE2, 0x88, // ContentEncKeyID (size = 8) | 231 0x47, 0xE2, 0x88, // ContentEncKeyID (size = 8) |
230 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, | 232 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, |
231 }; | 233 }; |
232 int size = sizeof(kContentEncodings); | 234 int size = sizeof(kContentEncodings); |
233 ParseAndExpectToFail(kContentEncodings, size); | 235 ParseAndExpectToFail(kContentEncodings, size); |
234 } | 236 } |
235 | 237 |
236 } // namespace media | 238 } // namespace media |
OLD | NEW |