Chromium Code Reviews| Index: chrome/browser/media/router/create_presentation_connection_request_unittest.cc |
| diff --git a/chrome/browser/media/router/create_presentation_connection_request_unittest.cc b/chrome/browser/media/router/create_presentation_connection_request_unittest.cc |
| index 6d9fdf30f68072ea62a98b81c97f2cf7154b5aad..901b0f9641e240a2d39cee93204647c16f6245a3 100644 |
| --- a/chrome/browser/media/router/create_presentation_connection_request_unittest.cc |
| +++ b/chrome/browser/media/router/create_presentation_connection_request_unittest.cc |
| @@ -12,11 +12,13 @@ namespace media_router { |
| namespace { |
| -const char kPresentationUrl[] = "http://foo.com"; |
| +const char kPresentationUrl1[] = "http://www.example.com/presentation.html"; |
|
mark a. foltz
2016/12/05 22:21:13
Nit: Can you convert these to use constexpr while
zhaobin
2016/12/06 20:06:36
Done.
|
| +const char kPresentationUrl2[] = "http://www.example.net/alternate.html"; |
| const char kFrameUrl[] = "http://google.com"; |
| const char kPresentationId[] = "presentationId"; |
| const char kRouteId[] = |
| - "urn:x-org.chromium:media:route:presentationId/cast-sink1/http://foo.com"; |
| + "urn:x-org.chromium:media:route:presentationId/cast-sink1/" |
| + "http://www.example.com/presentation.html"; |
| } // namespace |
| @@ -25,8 +27,8 @@ class CreatePresentationConnectionRequestTest : public ::testing::Test { |
| CreatePresentationConnectionRequestTest() |
| : cb_invoked_(false), |
| render_frame_host_id_(1, 2), |
| - presentation_url_(kPresentationUrl), |
| - presentation_urls_({presentation_url_}) {} |
| + presentation_url_(kPresentationUrl1), |
| + presentation_urls_({presentation_url_, GURL(kPresentationUrl2)}) {} |
| ~CreatePresentationConnectionRequestTest() override {} |
| @@ -36,6 +38,7 @@ class CreatePresentationConnectionRequestTest : public ::testing::Test { |
| cb_invoked_ = true; |
| EXPECT_EQ(expected_info.presentation_url, actual_info.presentation_url); |
| EXPECT_EQ(expected_info.presentation_id, actual_info.presentation_id); |
| + EXPECT_EQ(route.media_route_id(), kRouteId); |
| } |
| void OnError(const content::PresentationError& expected_error, |
| @@ -65,7 +68,7 @@ TEST_F(CreatePresentationConnectionRequestTest, Getters) { |
| content::PresentationError error(content::PRESENTATION_ERROR_UNKNOWN, |
| "Unknown error."); |
| CreatePresentationConnectionRequest request( |
| - render_frame_host_id_, presentation_url_, GURL(kFrameUrl), |
| + render_frame_host_id_, presentation_urls_, GURL(kFrameUrl), |
| base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess, |
| base::Unretained(this)), |
| base::Bind(&CreatePresentationConnectionRequestTest::OnError, |
| @@ -82,14 +85,14 @@ TEST_F(CreatePresentationConnectionRequestTest, SuccessCallback) { |
| content::PresentationSessionInfo session_info(presentation_url_, |
| kPresentationId); |
| CreatePresentationConnectionRequest request( |
| - render_frame_host_id_, presentation_url_, GURL(kFrameUrl), |
| + render_frame_host_id_, {presentation_url_}, GURL(kFrameUrl), |
| base::Bind(&CreatePresentationConnectionRequestTest::OnSuccess, |
| base::Unretained(this), session_info), |
| base::Bind(&CreatePresentationConnectionRequestTest::FailOnError, |
| base::Unretained(this))); |
| MediaRoute route(kRouteId, MediaSourceForTab(1), "sinkId", "Description", |
| false, "", false); |
| - request.InvokeSuccessCallback(kPresentationId, route); |
| + request.InvokeSuccessCallback(kPresentationId, presentation_url_, route); |
| EXPECT_TRUE(cb_invoked_); |
| } |
| @@ -98,7 +101,7 @@ TEST_F(CreatePresentationConnectionRequestTest, ErrorCallback) { |
| content::PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED, |
| "This is an error message"); |
| CreatePresentationConnectionRequest request( |
| - render_frame_host_id_, presentation_url_, GURL(kFrameUrl), |
| + render_frame_host_id_, presentation_urls_, GURL(kFrameUrl), |
| base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess, |
| base::Unretained(this)), |
| base::Bind(&CreatePresentationConnectionRequestTest::OnError, |