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

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

Issue 2386633003: [Media Router] Convert MediaRouter to use GURL for presentation URLs. (Closed)
Patch Set: Update media_router_e2e_browsertest Created 4 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_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 4b634ad17e47540e8e5b563c237dde19a648968a..526464a16765c5c2ca5970db4997af654b2b5ca1 100644
--- a/chrome/browser/media/router/create_presentation_connection_request_unittest.cc
+++ b/chrome/browser/media/router/create_presentation_connection_request_unittest.cc
@@ -23,9 +23,13 @@ const char kRouteId[] =
class CreatePresentationConnectionRequestTest : public ::testing::Test {
public:
CreatePresentationConnectionRequestTest()
- : cb_invoked_(false), render_frame_host_id_(1, 2) {}
+ : cb_invoked_(false),
+ render_frame_host_id_(1, 2),
+ presentation_url_(kPresentationUrl) {}
imcheng 2016/10/07 00:38:36 presentation_urls_(kPresentationUrl, 1) or prese
mark a. foltz 2016/10/07 23:14:10 Done.
~CreatePresentationConnectionRequestTest() override {}
+ void SetUp() override { presentation_urls_.push_back(presentation_url_); }
+
void OnSuccess(const content::PresentationSessionInfo& expected_info,
const content::PresentationSessionInfo& actual_info,
const MediaRoute::Id& route_id) {
@@ -52,6 +56,8 @@ class CreatePresentationConnectionRequestTest : public ::testing::Test {
bool cb_invoked_;
const RenderFrameHostId render_frame_host_id_;
+ GURL presentation_url_;
+ std::vector<GURL> presentation_urls_;
};
// Test that the object's getters match the constructor parameters.
@@ -59,24 +65,24 @@ TEST_F(CreatePresentationConnectionRequestTest, Getters) {
content::PresentationError error(content::PRESENTATION_ERROR_UNKNOWN,
"Unknown error.");
CreatePresentationConnectionRequest request(
- render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
+ render_frame_host_id_, presentation_url_, GURL(kFrameUrl),
base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess,
base::Unretained(this)),
base::Bind(&CreatePresentationConnectionRequestTest::OnError,
base::Unretained(this), error));
PresentationRequest presentation_request(render_frame_host_id_,
- {kPresentationUrl}, GURL(kFrameUrl));
+ presentation_urls_, 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(CreatePresentationConnectionRequestTest, SuccessCallback) {
- content::PresentationSessionInfo session_info(kPresentationUrl,
+ content::PresentationSessionInfo session_info(presentation_url_,
kPresentationId);
CreatePresentationConnectionRequest request(
- render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
+ render_frame_host_id_, presentation_url_, GURL(kFrameUrl),
base::Bind(&CreatePresentationConnectionRequestTest::OnSuccess,
base::Unretained(this), session_info),
base::Bind(&CreatePresentationConnectionRequestTest::FailOnError,
@@ -90,7 +96,7 @@ TEST_F(CreatePresentationConnectionRequestTest, ErrorCallback) {
content::PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED,
"This is an error message");
CreatePresentationConnectionRequest request(
- render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
+ render_frame_host_id_, presentation_url_, GURL(kFrameUrl),
base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess,
base::Unretained(this)),
base::Bind(&CreatePresentationConnectionRequestTest::OnError,

Powered by Google App Engine
This is Rietveld 408576698