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

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

Issue 2737413003: [Presentation API] Remove references to presentation sessions. (Closed)
Patch Set: Update presentation service mock. Created 3 years, 9 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/presentation_service_delegate_impl_unittest.cc
diff --git a/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc b/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc
index e410d1688ebcb9e97d24c7b20de6ae1442064b26..951c29a7087ecbb2fa68550ec4f2dfe39bd429fd 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc
@@ -22,7 +22,7 @@
#include "content/public/browser/presentation_screen_availability_listener.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/presentation_session.h"
+#include "content/public/common/presentation_info.h"
#include "content/public/test/web_contents_tester.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -51,7 +51,7 @@ class MockDelegateObserver
public:
MOCK_METHOD0(OnDelegateDestroyed, void());
MOCK_METHOD1(OnDefaultPresentationStarted,
- void(const content::PresentationSessionInfo&));
+ void(const content::PresentationInfo&));
};
class MockDefaultPresentationRequestObserver
@@ -65,7 +65,7 @@ class MockDefaultPresentationRequestObserver
class MockCreatePresentationConnnectionCallbacks {
public:
MOCK_METHOD1(OnCreateConnectionSuccess,
- void(const content::PresentationSessionInfo& connection));
+ void(const content::PresentationInfo& connection));
MOCK_METHOD1(OnCreateConnectionError,
void(const content::PresentationError& error));
};
@@ -127,7 +127,7 @@ class PresentationServiceDelegateImplTest
}
MOCK_METHOD1(OnDefaultPresentationStarted,
- void(const content::PresentationSessionInfo& session_info));
+ void(const content::PresentationInfo& presentation_info));
protected:
virtual content::WebContents* GetWebContents() { return web_contents(); }
@@ -416,7 +416,7 @@ TEST_F(PresentationServiceDelegateImplTest, ListenForConnnectionStateChange) {
const std::string kPresentationId("pid");
presentation_urls_.push_back(GURL(kPresentationUrl3));
MockCreatePresentationConnnectionCallbacks mock_create_connection_callbacks;
- delegate_impl_->JoinSession(
+ delegate_impl_->ReconnectPresentation(
main_frame_process_id_, main_frame_routing_id_, presentation_urls_,
kPresentationId,
base::Bind(&MockCreatePresentationConnnectionCallbacks::
@@ -438,8 +438,7 @@ TEST_F(PresentationServiceDelegateImplTest, ListenForConnnectionStateChange) {
base::MockCallback<content::PresentationConnectionStateChangedCallback>
mock_callback;
auto callback = mock_callback.Get();
- content::PresentationSessionInfo connection(presentation_url1_,
- kPresentationId);
+ content::PresentationInfo connection(presentation_url1_, kPresentationId);
EXPECT_CALL(router_, OnAddPresentationConnectionStateChangedCallbackInvoked(
Equals(callback)));
delegate_impl_->ListenForConnectionStateChange(
@@ -492,20 +491,20 @@ TEST_F(PresentationServiceDelegateImplTest, ConnectToPresentation) {
int render_frame_id = main_frame->GetRoutingID();
std::string presentation_id = "presentation_id";
GURL presentation_url = GURL("http://www.example.com/presentation.html");
- content::PresentationSessionInfo session_info(presentation_url,
- presentation_id);
+ content::PresentationInfo presentation_info(presentation_url,
+ presentation_id);
- base::MockCallback<
- base::Callback<void(const content::PresentationSessionInfo&)>>
+ base::MockCallback<base::Callback<void(const content::PresentationInfo&)>>
mock_callback;
EXPECT_CALL(mock_callback, Run(_));
MediaRoute media_route(
- "route_id", MediaSourceForPresentationUrl(session_info.presentation_url),
+ "route_id",
+ MediaSourceForPresentationUrl(presentation_info.presentation_url),
"mediaSinkId", "", true, "", true);
media_route.set_offscreen_presentation(true);
- delegate_impl_->OnStartSessionSucceeded(render_process_id, render_frame_id,
- mock_callback.Get(), session_info,
- media_route);
+ delegate_impl_->OnStartPresentationSucceeded(
+ render_process_id, render_frame_id, mock_callback.Get(),
+ presentation_info, media_route);
OffscreenPresentationManagerFactory::GetInstanceForTest()->SetTestingFactory(
profile(), &BuildMockOffscreenPresentationManager);
@@ -520,9 +519,9 @@ TEST_F(PresentationServiceDelegateImplTest, ConnectToPresentation) {
content::PresentationConnectionPtr connection_ptr;
content::PresentationConnectionRequest connection_request;
- delegate_impl_->ConnectToPresentation(render_process_id, render_frame_id,
- session_info, std::move(connection_ptr),
- std::move(connection_request));
+ delegate_impl_->ConnectToPresentation(
+ render_process_id, render_frame_id, presentation_info,
+ std::move(connection_ptr), std::move(connection_request));
EXPECT_CALL(*mock_offscreen_manager,
UnregisterOffscreenPresentationController(
@@ -553,7 +552,7 @@ TEST_F(PresentationServiceDelegateImplTest, AutoJoinRequest) {
// Auto-join requests should be rejected.
EXPECT_CALL(mock_create_connection_callbacks, OnCreateConnectionError(_));
EXPECT_CALL(router_, JoinRoute(_, kPresentationId, _, _, _, _, _)).Times(0);
- delegate_impl_->JoinSession(
+ delegate_impl_->ReconnectPresentation(
main_frame_process_id_, main_frame_routing_id_, presentation_urls_,
kPresentationId,
base::Bind(&MockCreatePresentationConnnectionCallbacks::
@@ -572,7 +571,7 @@ TEST_F(PresentationServiceDelegateImplTest, AutoJoinRequest) {
// Auto-join requests should now go through.
EXPECT_CALL(router_, JoinRoute(_, kPresentationId, _, _, _, _, _)).Times(1);
- delegate_impl_->JoinSession(
+ delegate_impl_->ReconnectPresentation(
main_frame_process_id_, main_frame_routing_id_, presentation_urls_,
kPresentationId,
base::Bind(&MockCreatePresentationConnnectionCallbacks::
@@ -610,7 +609,7 @@ TEST_F(PresentationServiceDelegateImplIncognitoTest, AutoJoinRequest) {
// Auto-join requests should be rejected.
EXPECT_CALL(mock_create_connection_callbacks, OnCreateConnectionError(_));
EXPECT_CALL(router_, JoinRoute(_, kPresentationId, _, _, _, _, _)).Times(0);
- delegate_impl_->JoinSession(
+ delegate_impl_->ReconnectPresentation(
main_frame_process_id_, main_frame_routing_id_, presentation_urls_,
kPresentationId,
base::Bind(&MockCreatePresentationConnnectionCallbacks::
@@ -629,7 +628,7 @@ TEST_F(PresentationServiceDelegateImplIncognitoTest, AutoJoinRequest) {
// Auto-join requests should now go through.
EXPECT_CALL(router_, JoinRoute(_, kPresentationId, _, _, _, _, _)).Times(1);
- delegate_impl_->JoinSession(
+ delegate_impl_->ReconnectPresentation(
main_frame_process_id_, main_frame_routing_id_, presentation_urls_,
kPresentationId,
base::Bind(&MockCreatePresentationConnnectionCallbacks::

Powered by Google App Engine
This is Rietveld 408576698