| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/media/router/media_source.h" | 5 #include "chrome/browser/media/router/media_source.h" |
| 6 #include "chrome/browser/media/router/media_source_helper.h" | 6 #include "chrome/browser/media/router/media_source_helper.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "url/gurl.h" | 8 #include "url/gurl.h" |
| 9 | 9 |
| 10 namespace media_router { | 10 namespace media_router { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 MediaSourceForPresentationUrl(GURL(kPresentationUrl)))); | 38 MediaSourceForPresentationUrl(GURL(kPresentationUrl)))); |
| 39 | 39 |
| 40 // Disallowed scheme | 40 // Disallowed scheme |
| 41 EXPECT_FALSE(IsValidMediaSource( | 41 EXPECT_FALSE(IsValidMediaSource( |
| 42 MediaSourceForPresentationUrl(GURL("file:///some/local/path")))); | 42 MediaSourceForPresentationUrl(GURL("file:///some/local/path")))); |
| 43 // Not a URL | 43 // Not a URL |
| 44 EXPECT_FALSE(IsValidMediaSource( | 44 EXPECT_FALSE(IsValidMediaSource( |
| 45 MediaSourceForPresentationUrl(GURL("totally not a url")))); | 45 MediaSourceForPresentationUrl(GURL("totally not a url")))); |
| 46 } | 46 } |
| 47 | 47 |
| 48 TEST(MediaSourcesTest, CanConnectToMediaSource) { |
| 49 EXPECT_TRUE(CanConnectToMediaSource( |
| 50 MediaSource(GURL("https://google.com/cast#__castAppId__=233637DE")))); |
| 51 EXPECT_FALSE( |
| 52 CanConnectToMediaSource(MediaSource(GURL("https://www.google.com")))); |
| 53 EXPECT_FALSE(CanConnectToMediaSource(MediaSource(GURL("")))); |
| 54 } |
| 55 |
| 48 } // namespace media_router | 56 } // namespace media_router |
| 49 | 57 |
| OLD | NEW |