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

Side by Side Diff: media/webm/webm_content_encodings_client_unittest.cc

Issue 11471006: Log MediaSource parsing errors to the MediaLog so they can appear in chrome:media-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « media/webm/webm_content_encodings_client.cc ('k') | media/webm/webm_stream_parser.h » ('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 (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
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
OLDNEW
« no previous file with comments | « media/webm/webm_content_encodings_client.cc ('k') | media/webm/webm_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698