OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_number_conversions.h" | 5 #include "base/string_number_conversions.h" |
6 #include "media/filters/adaptive_demuxer.h" | 6 #include "media/filters/adaptive_demuxer.h" |
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 bool ParseAdaptiveUrl( | |
12 const std::string& url, int* audio_index, int* video_index, | |
13 std::vector<std::string>* urls); | |
14 | |
15 TEST(ParseAdaptiveUrlTest, BackwardsCompatible) { | 11 TEST(ParseAdaptiveUrlTest, BackwardsCompatible) { |
16 std::string manifest = "http://youtube.com/video.webm"; | 12 std::string manifest = "http://youtube.com/video.webm"; |
17 int audio_index; | 13 int audio_index; |
18 int video_index; | 14 int video_index; |
19 std::vector<std::string> urls; | 15 std::vector<std::string> urls; |
20 ASSERT_TRUE(ParseAdaptiveUrl(manifest, &audio_index, &video_index, &urls)); | 16 ASSERT_TRUE(ParseAdaptiveUrl(manifest, &audio_index, &video_index, &urls)); |
21 EXPECT_EQ(audio_index, 0); | 17 EXPECT_EQ(audio_index, 0); |
22 EXPECT_EQ(video_index, 0); | 18 EXPECT_EQ(video_index, 0); |
23 ASSERT_EQ(urls.size(), 1u); | 19 ASSERT_EQ(urls.size(), 1u); |
24 EXPECT_EQ(urls[0], manifest); | 20 EXPECT_EQ(urls[0], manifest); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 EXPECT_FALSE(ParseAdaptiveUrl( | 61 EXPECT_FALSE(ParseAdaptiveUrl( |
66 "x-adaptive:0:file.webm", &audio_index, &video_index, &urls)); | 62 "x-adaptive:0:file.webm", &audio_index, &video_index, &urls)); |
67 EXPECT_FALSE(ParseAdaptiveUrl( | 63 EXPECT_FALSE(ParseAdaptiveUrl( |
68 "x-adaptive::0:file.webm", &audio_index, &video_index, &urls)); | 64 "x-adaptive::0:file.webm", &audio_index, &video_index, &urls)); |
69 // Invalid index for URL list. | 65 // Invalid index for URL list. |
70 EXPECT_FALSE(ParseAdaptiveUrl( | 66 EXPECT_FALSE(ParseAdaptiveUrl( |
71 "x-adaptive:1:0:file.webm", &audio_index, &video_index, &urls)); | 67 "x-adaptive:1:0:file.webm", &audio_index, &video_index, &urls)); |
72 } | 68 } |
73 | 69 |
74 } // namespace media | 70 } // namespace media |
OLD | NEW |