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