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

Side by Side Diff: chrome/browser/media/router/media_source_helper_unittest.cc

Issue 2547703002: [Media Router] Handle multiple Presentation URLs when creating routes (Closed)
Patch Set: rebase Created 4 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
OLDNEW
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
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 // false scheme
52 EXPECT_FALSE(CanConnectToMediaSource(
53 MediaSource(GURL("http://google.com/cast#__castAppId__=233637DE"))));
54 // false domain
55 EXPECT_FALSE(CanConnectToMediaSource(
56 MediaSource(GURL("https://google2.com/cast#__castAppId__=233637DE"))));
57 // empty path
58 EXPECT_FALSE(
59 CanConnectToMediaSource(MediaSource(GURL("https://www.google.com"))));
60 // false path
61 EXPECT_FALSE(CanConnectToMediaSource(
62 MediaSource(GURL("https://www.google.com/path"))));
63
64 EXPECT_FALSE(CanConnectToMediaSource(MediaSource(GURL(""))));
65 }
66
48 } // namespace media_router 67 } // namespace media_router
49 68
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_source_helper.cc ('k') | chrome/browser/media/router/media_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698