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

Unified Diff: chrome/browser/media/router/media_source_helper_unittest.cc

Issue 1693963003: Pass origin to StartObservingMediaSinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marks Review Fixes with URL changes Created 4 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/media_source_helper_unittest.cc
diff --git a/chrome/browser/media/router/media_source_helper_unittest.cc b/chrome/browser/media/router/media_source_helper_unittest.cc
index e0fbaedafaa59fd5e9e85f44318f237a62243b22..7592d9a4a76cc6bd235a0b093411fd1ee1bf5eed 100644
--- a/chrome/browser/media/router/media_source_helper_unittest.cc
+++ b/chrome/browser/media/router/media_source_helper_unittest.cc
@@ -15,7 +15,9 @@ TEST(MediaSourcesTest, IsMirroringMediaSource) {
EXPECT_TRUE(IsMirroringMediaSource(MediaSourceForDesktop()));
EXPECT_FALSE(IsMirroringMediaSource(MediaSourceForCastApp("CastApp")));
EXPECT_FALSE(
- IsMirroringMediaSource(MediaSourceForPresentationUrl("http://url")));
+ IsMirroringMediaSource(
+ MediaSourceForPresentationUrl("http://url",
+ "http://url.origin.com")));
}
TEST(MediaSourcesTest, CreateMediaSource) {
@@ -26,7 +28,8 @@ TEST(MediaSourcesTest, CreateMediaSource) {
EXPECT_EQ("urn:x-com.google.cast:application:DEADBEEF",
MediaSourceForCastApp("DEADBEEF").id());
EXPECT_EQ("http://example.com/",
- MediaSourceForPresentationUrl("http://example.com/").id());
+ MediaSourceForPresentationUrl("http://example.com/",
+ "http://example.origin.com").id());
}
TEST(MediaSourcesTest, IsValidMediaSource) {
@@ -34,16 +37,21 @@ TEST(MediaSourcesTest, IsValidMediaSource) {
EXPECT_TRUE(IsValidMediaSource(MediaSourceForDesktop()));
EXPECT_TRUE(IsValidMediaSource(MediaSourceForCastApp("DEADBEEF")));
EXPECT_TRUE(
- IsValidMediaSource(MediaSourceForPresentationUrl("http://example.com/")));
+ IsValidMediaSource(
+ MediaSourceForPresentationUrl("http://example.com/",
+ "http://example.origin.com/")));
EXPECT_TRUE(IsValidMediaSource(
- MediaSourceForPresentationUrl("https://example.com/")));
+ MediaSourceForPresentationUrl("https://example.com/",
+ "http://example.origin.com/")));
// Disallowed scheme
EXPECT_FALSE(IsValidMediaSource(
- MediaSourceForPresentationUrl("file:///some/local/path")));
+ MediaSourceForPresentationUrl("file:///some/local/path",
+ "file:///some.notvalid.origin.com")));
// Not a URL
EXPECT_FALSE(
- IsValidMediaSource(MediaSourceForPresentationUrl("totally not a url")));
+ IsValidMediaSource(MediaSourceForPresentationUrl("totally not a url",
+ "nope")));
}
TEST(MediaSourcesTest, PresentationUrlFromMediaSource) {
@@ -51,7 +59,8 @@ TEST(MediaSourcesTest, PresentationUrlFromMediaSource) {
EXPECT_EQ("", PresentationUrlFromMediaSource(MediaSourceForDesktop()));
EXPECT_EQ("http://example.com/",
PresentationUrlFromMediaSource(
- MediaSourceForPresentationUrl("http://example.com/")));
+ MediaSourceForPresentationUrl("http://example.com/",
+ "http://example.origin.com")));
}
} // namespace media_router
« no previous file with comments | « chrome/browser/media/router/media_source_helper.cc ('k') | chrome/browser/media/router/mock_screen_availability_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698