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