OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/logging.h" | 5 #include "base/logging.h" |
6 #include "media/webm/tracks_builder.h" | 6 #include "media/webm/tracks_builder.h" |
7 #include "media/webm/webm_constants.h" | 7 #include "media/webm/webm_constants.h" |
8 #include "media/webm/webm_tracks_parser.h" | 8 #include "media/webm/webm_tracks_parser.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 using ::testing::InSequence; | 12 using ::testing::InSequence; |
13 using ::testing::Return; | 13 using ::testing::Return; |
14 using ::testing::_; | 14 using ::testing::_; |
15 | 15 |
16 namespace media { | 16 namespace media { |
17 | 17 |
18 static const int kTypeSubtitlesOrCaptions = 0x11; | |
19 static const int kTypeDescriptionsOrMetadata = 0x21; | |
20 | |
21 class WebMTracksParserTest : public testing::Test { | 18 class WebMTracksParserTest : public testing::Test { |
22 public: | 19 public: |
23 WebMTracksParserTest() {} | 20 WebMTracksParserTest() {} |
24 }; | 21 }; |
25 | 22 |
26 static void VerifyTextTrackInfo(const uint8* buffer, | 23 static void VerifyTextTrackInfo(const uint8* buffer, |
27 int buffer_size, | 24 int buffer_size, |
28 TextKind text_kind, | 25 TextKind text_kind, |
29 const std::string& name, | 26 const std::string& name, |
30 const std::string& language) { | 27 const std::string& language) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 parser.reset(new WebMTracksParser(LogCB(), false)); | 113 parser.reset(new WebMTracksParser(LogCB(), false)); |
117 | 114 |
118 result = parser->Parse(&buf[0], buf.size()); | 115 result = parser->Parse(&buf[0], buf.size()); |
119 EXPECT_GT(result, 0); | 116 EXPECT_GT(result, 0); |
120 | 117 |
121 EXPECT_EQ(parser->ignored_tracks().size(), 0u); | 118 EXPECT_EQ(parser->ignored_tracks().size(), 0u); |
122 EXPECT_EQ(parser->text_tracks().size(), 2u); | 119 EXPECT_EQ(parser->text_tracks().size(), 2u); |
123 } | 120 } |
124 | 121 |
125 } // namespace media | 122 } // namespace media |
OLD | NEW |