Chromium Code Reviews| Index: chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc |
| diff --git a/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc b/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc |
| index 37901954dbe52fba22845e9e77c781fca45806b0..c74786576a55f57633f3b835fa392ec3726dff77 100644 |
| --- a/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc |
| +++ b/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc |
| @@ -86,6 +86,7 @@ class PresentationServiceDelegateImplTest |
| &PresentationServiceDelegateImplTest::OnDefaultPresentationStarted, |
| base::Unretained(this)); |
| std::string presentation_url1("http://foo.fakeUrl"); |
|
mark a. foltz
2016/03/03 22:58:36
Similar comment about URLs/origins in tests.
matt.boetger
2016/03/04 00:22:11
Done.
|
| + std::string origin_url1("http://foo.fakeUrl"); |
| delegate_impl_->SetDefaultPresentationUrl(render_process_id, routing_id, |
| presentation_url1, callback); |
| @@ -101,11 +102,13 @@ class PresentationServiceDelegateImplTest |
| // Should not trigger callback since request doesn't match. |
| std::string presentation_url2("http://bar.fakeUrl"); |
| + std::string origin_url2("http://bar.fakeUrl"); |
| PresentationRequest different_request( |
| RenderFrameHostId(100, 200), presentation_url2, |
| GURL("http://anotherFrameUrl.fakeUrl")); |
| MediaRoute* media_route = new MediaRoute( |
| - "differentRouteId", MediaSourceForPresentationUrl(presentation_url2), |
| + "differentRouteId", MediaSourceForPresentationUrl(presentation_url2, |
| + origin_url2), |
| "mediaSinkId", "", true, "", true); |
| media_route->set_off_the_record(off_the_record); |
| result = RouteRequestResult::FromSuccess(make_scoped_ptr(media_route), |
| @@ -116,7 +119,8 @@ class PresentationServiceDelegateImplTest |
| // Should trigger callback since request matches. |
| EXPECT_CALL(*this, OnDefaultPresentationStarted(_)).Times(1); |
| MediaRoute* media_route2 = new MediaRoute( |
| - "routeId", MediaSourceForPresentationUrl(presentation_url1), |
| + "routeId", MediaSourceForPresentationUrl(presentation_url1, |
| + origin_url1), |
| "mediaSinkId", "", true, "", true); |
| media_route2->set_off_the_record(off_the_record); |
| result = RouteRequestResult::FromSuccess(make_scoped_ptr(media_route2), |
| @@ -158,9 +162,13 @@ class PresentationServiceDelegateImplIncognitoTest |
| TEST_F(PresentationServiceDelegateImplTest, AddScreenAvailabilityListener) { |
| std::string presentation_url1("http://url1.fakeUrl"); |
| + std::string origin_url1("http://url1.fakeUrl"); |
| std::string presentation_url2("http://url2.fakeUrl"); |
| - MediaSource source1 = MediaSourceForPresentationUrl(presentation_url1); |
| - MediaSource source2 = MediaSourceForPresentationUrl(presentation_url2); |
| + std::string origin_url2("http://url2.fakeUrl"); |
| + MediaSource source1 = MediaSourceForPresentationUrl(presentation_url1, |
| + origin_url1); |
| + MediaSource source2 = MediaSourceForPresentationUrl(presentation_url2, |
| + origin_url2); |
| MockScreenAvailabilityListener listener1(presentation_url1); |
| MockScreenAvailabilityListener listener2(presentation_url2); |
| int render_process_id = 10; |
| @@ -196,9 +204,13 @@ TEST_F(PresentationServiceDelegateImplTest, AddMultipleListenersToFrame) { |
| ON_CALL(router_, RegisterMediaSinksObserver(_)).WillByDefault(Return(true)); |
| std::string presentation_url1("http://url1.com"); |
| + std::string origin_url1("http://url1.com"); |
| std::string presentation_url2("http://url2.com"); |
| - MediaSource source1 = MediaSourceForPresentationUrl(presentation_url1); |
| - MediaSource source2 = MediaSourceForPresentationUrl(presentation_url2); |
| + std::string origin_url2("http://url2.com"); |
| + MediaSource source1 = MediaSourceForPresentationUrl(presentation_url1, |
| + origin_url1); |
| + MediaSource source2 = MediaSourceForPresentationUrl(presentation_url2, |
| + origin_url2); |
| MockScreenAvailabilityListener listener1(presentation_url1); |
| MockScreenAvailabilityListener listener2(presentation_url2); |
| int render_process_id = 10; |
| @@ -229,7 +241,8 @@ TEST_F(PresentationServiceDelegateImplTest, AddMultipleListenersToFrame) { |
| TEST_F(PresentationServiceDelegateImplTest, AddSameListenerTwice) { |
| std::string presentation_url1("http://url1.fakeUrl"); |
| - MediaSource source1(MediaSourceForPresentationUrl(presentation_url1)); |
| + MediaSource source1(MediaSourceForPresentationUrl(presentation_url1, |
| + presentation_url1)); |
| MockScreenAvailabilityListener listener1(presentation_url1); |
| int render_process_id = 1; |
| int render_frame_id = 0; |
| @@ -370,6 +383,7 @@ TEST_F(PresentationServiceDelegateImplTest, ListenForConnnectionStateChange) { |
| .WillOnce(SaveArg<4>(&route_response_callbacks)); |
| const std::string kPresentationUrl("http://url1.fakeUrl"); |
| + const std::string kOriginUrl("http://url1.fakeUrl"); |
| const std::string kPresentationId("pid"); |
| MockCreatePresentationConnnectionCallbacks mock_create_connection_callbacks; |
| delegate_impl_->JoinSession( |
| @@ -385,7 +399,8 @@ TEST_F(PresentationServiceDelegateImplTest, ListenForConnnectionStateChange) { |
| .Times(1); |
| scoped_ptr<RouteRequestResult> result = RouteRequestResult::FromSuccess( |
| make_scoped_ptr(new MediaRoute( |
| - "routeId", MediaSourceForPresentationUrl(kPresentationUrl), |
| + "routeId", MediaSourceForPresentationUrl(kPresentationUrl, |
| + kOriginUrl), |
| "mediaSinkId", "description", true, "", true)), |
| kPresentationId); |
| for (const auto& route_response_callback : route_response_callbacks) |
| @@ -408,7 +423,9 @@ TEST_F(PresentationServiceDelegateImplTest, Reset) { |
| .WillRepeatedly(Return(true)); |
| std::string presentation_url1("http://url1.fakeUrl"); |
| - MediaSource source = MediaSourceForPresentationUrl(presentation_url1); |
| + std::string origin_url1("http://url1.fakeUrl"); |
| + MediaSource source = MediaSourceForPresentationUrl(presentation_url1, |
| + origin_url1); |
| MockScreenAvailabilityListener listener1(presentation_url1); |
| int render_process_id = 1; |
| int render_frame_id = 0; |