| Index: chrome/browser/media/router/create_presentation_session_request_unittest.cc
|
| diff --git a/chrome/browser/media/router/create_presentation_session_request_unittest.cc b/chrome/browser/media/router/create_presentation_session_request_unittest.cc
|
| index 98614c678d521895d4ccb2e20c2153ba17faa93f..a996d20886878d78b75b990668088cd029b0cbfc 100644
|
| --- a/chrome/browser/media/router/create_presentation_session_request_unittest.cc
|
| +++ b/chrome/browser/media/router/create_presentation_session_request_unittest.cc
|
| @@ -13,6 +13,7 @@ namespace media_router {
|
| namespace {
|
|
|
| const char kPresentationUrl[] = "http://foo.com";
|
| +const char kFrameUrl[] = "http://frameUrl";
|
| const char kPresentationId[] = "presentationId";
|
| const char kRouteId[] =
|
| "urn:x-org.chromium:media:route:presentationId/cast-sink1/http://foo.com";
|
| @@ -21,7 +22,8 @@ const char kRouteId[] =
|
|
|
| class CreatePresentationSessionRequestTest : public ::testing::Test {
|
| public:
|
| - CreatePresentationSessionRequestTest() : cb_invoked_(false) {}
|
| + CreatePresentationSessionRequestTest()
|
| + : cb_invoked_(false), render_frame_host_id_(1, 2) {}
|
| ~CreatePresentationSessionRequestTest() override {}
|
|
|
| void OnSuccess(const content::PresentationSessionInfo& expected_info,
|
| @@ -49,32 +51,32 @@ class CreatePresentationSessionRequestTest : public ::testing::Test {
|
| }
|
|
|
| bool cb_invoked_;
|
| + const RenderFrameHostId render_frame_host_id_;
|
| };
|
|
|
| // Test that the object's getters match the constructor parameters.
|
| TEST_F(CreatePresentationSessionRequestTest, Getters) {
|
| - GURL frame_url("http://frameUrl");
|
| content::PresentationError error(content::PRESENTATION_ERROR_UNKNOWN,
|
| "Unknown error.");
|
| CreatePresentationSessionRequest request(
|
| - kPresentationUrl, frame_url,
|
| + render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
|
| base::Bind(&CreatePresentationSessionRequestTest::FailOnSuccess,
|
| base::Unretained(this)),
|
| base::Bind(&CreatePresentationSessionRequestTest::OnError,
|
| base::Unretained(this), error));
|
| - EXPECT_EQ(frame_url, request.frame_url());
|
| - EXPECT_EQ(kPresentationUrl,
|
| - PresentationUrlFromMediaSource(request.media_source()));
|
| +
|
| + PresentationRequest presentation_request(render_frame_host_id_,
|
| + kPresentationUrl, GURL(kFrameUrl));
|
| + EXPECT_TRUE(request.presentation_request().Equals(presentation_request));
|
| // Since we didn't explicitly call Invoke*, the error callback will be
|
| // invoked when |request| is destroyed.
|
| }
|
|
|
| TEST_F(CreatePresentationSessionRequestTest, SuccessCallback) {
|
| - GURL frame_url("http://frameUrl");
|
| content::PresentationSessionInfo session_info(kPresentationUrl,
|
| kPresentationId);
|
| CreatePresentationSessionRequest request(
|
| - kPresentationUrl, frame_url,
|
| + render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
|
| base::Bind(&CreatePresentationSessionRequestTest::OnSuccess,
|
| base::Unretained(this), session_info),
|
| base::Bind(&CreatePresentationSessionRequestTest::FailOnError,
|
| @@ -84,14 +86,11 @@ TEST_F(CreatePresentationSessionRequestTest, SuccessCallback) {
|
| }
|
|
|
| TEST_F(CreatePresentationSessionRequestTest, ErrorCallback) {
|
| - GURL frame_url("http://frameUrl");
|
| - content::PresentationSessionInfo session_info(kPresentationUrl,
|
| - kPresentationId);
|
| content::PresentationError error(
|
| content::PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED,
|
| "This is an error message");
|
| CreatePresentationSessionRequest request(
|
| - kPresentationUrl, frame_url,
|
| + render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
|
| base::Bind(&CreatePresentationSessionRequestTest::FailOnSuccess,
|
| base::Unretained(this)),
|
| base::Bind(&CreatePresentationSessionRequestTest::OnError,
|
|
|