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

Side by Side Diff: chrome/browser/media/router/create_presentation_connection_request_unittest.cc

Issue 2264153002: [Presentation API] Add support for multiple URLs in PresentationRequest on Media Router UI side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify MediaRouterDialogControllerAndroid, format Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "chrome/browser/media/router/create_presentation_connection_request.h" 6 #include "chrome/browser/media/router/create_presentation_connection_request.h"
7 #include "chrome/browser/media/router/media_source_helper.h" 7 #include "chrome/browser/media/router/media_source_helper.h"
8 #include "content/public/browser/presentation_service_delegate.h" 8 #include "content/public/browser/presentation_service_delegate.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 content::PresentationError error(content::PRESENTATION_ERROR_UNKNOWN, 59 content::PresentationError error(content::PRESENTATION_ERROR_UNKNOWN,
60 "Unknown error."); 60 "Unknown error.");
61 CreatePresentationConnectionRequest request( 61 CreatePresentationConnectionRequest request(
62 render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl), 62 render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
63 base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess, 63 base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess,
64 base::Unretained(this)), 64 base::Unretained(this)),
65 base::Bind(&CreatePresentationConnectionRequestTest::OnError, 65 base::Bind(&CreatePresentationConnectionRequestTest::OnError,
66 base::Unretained(this), error)); 66 base::Unretained(this), error));
67 67
68 PresentationRequest presentation_request(render_frame_host_id_, 68 PresentationRequest presentation_request(render_frame_host_id_,
69 kPresentationUrl, GURL(kFrameUrl)); 69 {kPresentationUrl}, GURL(kFrameUrl));
70 EXPECT_TRUE(request.presentation_request().Equals(presentation_request)); 70 EXPECT_TRUE(request.presentation_request().Equals(presentation_request));
71 // Since we didn't explicitly call Invoke*, the error callback will be 71 // Since we didn't explicitly call Invoke*, the error callback will be
72 // invoked when |request| is destroyed. 72 // invoked when |request| is destroyed.
73 } 73 }
74 74
75 TEST_F(CreatePresentationConnectionRequestTest, SuccessCallback) { 75 TEST_F(CreatePresentationConnectionRequestTest, SuccessCallback) {
76 content::PresentationSessionInfo session_info(kPresentationUrl, 76 content::PresentationSessionInfo session_info(kPresentationUrl,
77 kPresentationId); 77 kPresentationId);
78 CreatePresentationConnectionRequest request( 78 CreatePresentationConnectionRequest request(
79 render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl), 79 render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
(...skipping 13 matching lines...) Expand all
93 render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl), 93 render_frame_host_id_, kPresentationUrl, GURL(kFrameUrl),
94 base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess, 94 base::Bind(&CreatePresentationConnectionRequestTest::FailOnSuccess,
95 base::Unretained(this)), 95 base::Unretained(this)),
96 base::Bind(&CreatePresentationConnectionRequestTest::OnError, 96 base::Bind(&CreatePresentationConnectionRequestTest::OnError,
97 base::Unretained(this), error)); 97 base::Unretained(this), error));
98 request.InvokeErrorCallback(error); 98 request.InvokeErrorCallback(error);
99 EXPECT_TRUE(cb_invoked_); 99 EXPECT_TRUE(cb_invoked_);
100 } 100 }
101 101
102 } // namespace media_router 102 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/create_presentation_connection_request.cc ('k') | chrome/browser/media/router/media_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698