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

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

Issue 1406013003: [Presentation API / Media Router] Clean up default pres URL logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years, 2 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/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";
mark a. foltz 2015/11/04 02:07:24 Please use a fully qualified URL as test data. Ot
imcheng 2015/11/04 20:35:19 Done.
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,

Powered by Google App Engine
This is Rietveld 408576698