Index: content/browser/presentation/presentation_service_impl_unittest.cc |
diff --git a/content/browser/presentation/presentation_service_impl_unittest.cc b/content/browser/presentation/presentation_service_impl_unittest.cc |
index f6dbd5d0e92ddeb05662ad107505ee2441102e82..e3b3462f5b75d9acde247993a905d48f39bad761 100644 |
--- a/content/browser/presentation/presentation_service_impl_unittest.cc |
+++ b/content/browser/presentation/presentation_service_impl_unittest.cc |
@@ -28,6 +28,7 @@ |
#include "testing/gmock/include/gmock/gmock.h" |
using ::testing::_; |
+using ::testing::ByRef; |
using ::testing::Eq; |
using ::testing::InvokeWithoutArgs; |
using ::testing::Mock; |
@@ -43,8 +44,27 @@ MATCHER_P(Equals, expected, "") { |
return expected.Equals(arg); |
} |
+// Matches std::vector<std::string> to mojo::Array<mojo::String>. |
+MATCHER_P(StringArrayEquals, expected, "") { |
+ // Unwrap reference passed by GMock. |
+ mojo::Array<mojo::String>& expected_array = expected; |
+ if (arg.size() != expected_array.size()) |
+ return false; |
+ |
+ if (expected_array.is_null()) |
+ return arg.empty(); |
+ |
+ for (size_t i = 0; i < expected_array.size(); ++i) { |
+ if (arg[i] != expected_array[i]) |
+ return false; |
+ } |
+ |
+ return true; |
+} |
+ |
const char *const kPresentationId = "presentationId"; |
-const char *const kPresentationUrl = "http://foo.com/index.html"; |
+const char* const kPresentationUrl1 = "http://foo.com/index.html"; |
+const char* const kPresentationUrl2 = "http://example.com/index.html"; |
bool ArePresentationSessionMessagesEqual( |
const blink::mojom::SessionMessage* expected, |
@@ -88,21 +108,21 @@ class MockPresentationServiceDelegate : public PresentationServiceDelegate { |
void( |
int render_process_id, |
int routing_id)); |
- MOCK_METHOD4(SetDefaultPresentationUrl, |
+ MOCK_METHOD4(SetDefaultPresentationUrls, |
void(int render_process_id, |
int routing_id, |
- const std::string& default_presentation_url, |
+ const std::vector<std::string>& default_presentation_urls, |
const PresentationSessionStartedCallback& callback)); |
MOCK_METHOD5(StartSession, |
void(int render_process_id, |
int render_frame_id, |
- const std::string& presentation_url, |
+ const std::vector<std::string>& presentation_urls, |
const PresentationSessionStartedCallback& success_cb, |
const PresentationSessionErrorCallback& error_cb)); |
MOCK_METHOD6(JoinSession, |
void(int render_process_id, |
int render_frame_id, |
- const std::string& presentation_url, |
+ const std::vector<std::string>& presentation_urls, |
const std::string& presentation_id, |
const PresentationSessionStartedCallback& success_cb, |
const PresentationSessionErrorCallback& error_cb)); |
@@ -273,9 +293,9 @@ class PresentationServiceImplTest : public RenderViewHostImplTestHarness { |
} |
void ExpectCleanState() { |
- EXPECT_TRUE(service_impl_->default_presentation_url_.empty()); |
+ EXPECT_TRUE(service_impl_->default_presentation_urls_.empty()); |
EXPECT_EQ( |
- service_impl_->screen_availability_listeners_.find(kPresentationUrl), |
+ service_impl_->screen_availability_listeners_.find(kPresentationUrl1), |
service_impl_->screen_availability_listeners_.end()); |
EXPECT_FALSE(service_impl_->on_session_messages_callback_.get()); |
} |
@@ -329,7 +349,7 @@ class PresentationServiceImplTest : public RenderViewHostImplTestHarness { |
blink::mojom::PresentationSessionInfoPtr session( |
blink::mojom::PresentationSessionInfo::New()); |
- session->url = kPresentationUrl; |
+ session->url = kPresentationUrl1; |
session->id = kPresentationId; |
PresentationSessionMessageCallback message_cb; |
@@ -377,15 +397,15 @@ class PresentationServiceImplTest : public RenderViewHostImplTestHarness { |
}; |
TEST_F(PresentationServiceImplTest, ListenForScreenAvailability) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, true); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, true); |
- SimulateScreenAvailabilityChangeAndWait(kPresentationUrl, true); |
- SimulateScreenAvailabilityChangeAndWait(kPresentationUrl, false); |
- SimulateScreenAvailabilityChangeAndWait(kPresentationUrl, true); |
+ SimulateScreenAvailabilityChangeAndWait(kPresentationUrl1, true); |
+ SimulateScreenAvailabilityChangeAndWait(kPresentationUrl1, false); |
+ SimulateScreenAvailabilityChangeAndWait(kPresentationUrl1, true); |
} |
TEST_F(PresentationServiceImplTest, Reset) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, true); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, true); |
ExpectReset(); |
service_impl_->Reset(); |
@@ -393,7 +413,7 @@ TEST_F(PresentationServiceImplTest, Reset) { |
} |
TEST_F(PresentationServiceImplTest, DidNavigateThisFrame) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, true); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, true); |
ExpectReset(); |
service_impl_->DidNavigateAnyFrame( |
@@ -404,7 +424,7 @@ TEST_F(PresentationServiceImplTest, DidNavigateThisFrame) { |
} |
TEST_F(PresentationServiceImplTest, DidNavigateOtherFrame) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, true); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, true); |
// TODO(imcheng): How to get a different RenderFrameHost? |
service_impl_->DidNavigateAnyFrame( |
@@ -414,11 +434,11 @@ TEST_F(PresentationServiceImplTest, DidNavigateOtherFrame) { |
// Availability is reported and callback is invoked since it was not |
// removed. |
- SimulateScreenAvailabilityChangeAndWait(kPresentationUrl, true); |
+ SimulateScreenAvailabilityChangeAndWait(kPresentationUrl1, true); |
} |
TEST_F(PresentationServiceImplTest, ThisRenderFrameDeleted) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, true); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, true); |
ExpectReset(); |
@@ -429,50 +449,57 @@ TEST_F(PresentationServiceImplTest, ThisRenderFrameDeleted) { |
} |
TEST_F(PresentationServiceImplTest, OtherRenderFrameDeleted) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, true); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, true); |
// TODO(imcheng): How to get a different RenderFrameHost? |
service_impl_->RenderFrameDeleted(nullptr); |
// Availability is reported and callback should be invoked since listener |
// has not been deleted. |
- SimulateScreenAvailabilityChangeAndWait(kPresentationUrl, true); |
+ SimulateScreenAvailabilityChangeAndWait(kPresentationUrl1, true); |
} |
TEST_F(PresentationServiceImplTest, DelegateFails) { |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, false); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, false); |
ASSERT_EQ( |
- service_impl_->screen_availability_listeners_.find(kPresentationUrl), |
+ service_impl_->screen_availability_listeners_.find(kPresentationUrl1), |
service_impl_->screen_availability_listeners_.end()); |
} |
-TEST_F(PresentationServiceImplTest, SetDefaultPresentationUrl) { |
- std::string url1("http://fooUrl"); |
- EXPECT_CALL(mock_delegate_, SetDefaultPresentationUrl(_, _, Eq(url1), _)) |
+TEST_F(PresentationServiceImplTest, SetDefaultPresentationUrls) { |
+ mojo::Array<mojo::String> urls(2); |
+ urls[0] = kPresentationUrl1; |
+ urls[1] = kPresentationUrl2; |
+ EXPECT_CALL(mock_delegate_, SetDefaultPresentationUrls( |
+ _, _, StringArrayEquals(ByRef(urls)), _)) |
.Times(1); |
- service_impl_->SetDefaultPresentationURL(url1); |
- EXPECT_EQ(url1, service_impl_->default_presentation_url_); |
- |
- std::string url2("http://barUrl"); |
- // Sets different DPU. |
+ service_impl_->SetDefaultPresentationUrls(urls.Clone()); |
+ |
+ std::string url3("http://barUrl"); |
+ // Sets different DPUs. |
+ mojo::Array<mojo::String> more_urls(3); |
+ more_urls[0] = kPresentationUrl1; |
+ more_urls[1] = kPresentationUrl2; |
+ more_urls[2] = url3; |
content::PresentationSessionStartedCallback callback; |
- EXPECT_CALL(mock_delegate_, SetDefaultPresentationUrl(_, _, Eq(url2), _)) |
+ EXPECT_CALL(mock_delegate_, SetDefaultPresentationUrls( |
+ _, _, StringArrayEquals(ByRef(more_urls)), _)) |
.WillOnce(SaveArg<3>(&callback)); |
- service_impl_->SetDefaultPresentationURL(url2); |
- EXPECT_EQ(url2, service_impl_->default_presentation_url_); |
+ service_impl_->SetDefaultPresentationUrls(more_urls.Clone()); |
blink::mojom::PresentationSessionInfo session_info; |
- session_info.url = url2; |
+ session_info.url = kPresentationUrl2; |
session_info.id = kPresentationId; |
base::RunLoop run_loop; |
EXPECT_CALL(mock_client_, OnDefaultSessionStarted(Equals(session_info))) |
.WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
- callback.Run(content::PresentationSessionInfo(url2, kPresentationId)); |
+ callback.Run( |
+ content::PresentationSessionInfo(kPresentationUrl2, kPresentationId)); |
run_loop.Run(); |
} |
TEST_F(PresentationServiceImplTest, ListenForConnectionStateChange) { |
- content::PresentationSessionInfo connection(kPresentationUrl, |
+ content::PresentationSessionInfo connection(kPresentationUrl1, |
kPresentationId); |
content::PresentationConnectionStateChangedCallback state_changed_cb; |
EXPECT_CALL(mock_delegate_, ListenForConnectionStateChange(_, _, _, _)) |
@@ -481,7 +508,7 @@ TEST_F(PresentationServiceImplTest, ListenForConnectionStateChange) { |
// Trigger state change. It should be propagated back up to |mock_client_|. |
blink::mojom::PresentationSessionInfo presentation_connection; |
- presentation_connection.url = kPresentationUrl; |
+ presentation_connection.url = kPresentationUrl1; |
presentation_connection.id = kPresentationId; |
{ |
base::RunLoop run_loop; |
@@ -497,7 +524,7 @@ TEST_F(PresentationServiceImplTest, ListenForConnectionStateChange) { |
} |
TEST_F(PresentationServiceImplTest, ListenForConnectionClose) { |
- content::PresentationSessionInfo connection(kPresentationUrl, |
+ content::PresentationSessionInfo connection(kPresentationUrl1, |
kPresentationId); |
content::PresentationConnectionStateChangedCallback state_changed_cb; |
EXPECT_CALL(mock_delegate_, ListenForConnectionStateChange(_, _, _, _)) |
@@ -507,7 +534,7 @@ TEST_F(PresentationServiceImplTest, ListenForConnectionClose) { |
// Trigger connection close. It should be propagated back up to |
// |mock_client_|. |
blink::mojom::PresentationSessionInfo presentation_connection; |
- presentation_connection.url = kPresentationUrl; |
+ presentation_connection.url = kPresentationUrl1; |
presentation_connection.id = kPresentationId; |
{ |
base::RunLoop run_loop; |
@@ -527,100 +554,105 @@ TEST_F(PresentationServiceImplTest, ListenForConnectionClose) { |
} |
} |
-TEST_F(PresentationServiceImplTest, SetSameDefaultPresentationUrl) { |
- EXPECT_CALL(mock_delegate_, |
- SetDefaultPresentationUrl(_, _, Eq(kPresentationUrl), _)) |
+TEST_F(PresentationServiceImplTest, SetSameDefaultPresentationUrls) { |
+ mojo::Array<mojo::String> urls(2); |
+ urls[0] = kPresentationUrl1; |
+ urls[1] = kPresentationUrl2; |
+ EXPECT_CALL(mock_delegate_, SetDefaultPresentationUrls( |
+ _, _, StringArrayEquals(ByRef(urls)), _)) |
.Times(1); |
- service_impl_->SetDefaultPresentationURL(kPresentationUrl); |
+ service_impl_->SetDefaultPresentationUrls(urls.Clone()); |
EXPECT_TRUE(Mock::VerifyAndClearExpectations(&mock_delegate_)); |
- EXPECT_EQ(kPresentationUrl, service_impl_->default_presentation_url_); |
- // Same URL as before; no-ops. |
- service_impl_->SetDefaultPresentationURL(kPresentationUrl); |
+ // Same URLs as before; no-ops. |
+ service_impl_->SetDefaultPresentationUrls(urls.Clone()); |
EXPECT_TRUE(Mock::VerifyAndClearExpectations(&mock_delegate_)); |
- EXPECT_EQ(kPresentationUrl, service_impl_->default_presentation_url_); |
} |
TEST_F(PresentationServiceImplTest, StartSessionSuccess) { |
+ mojo::Array<mojo::String> urls(2); |
+ urls[0] = kPresentationUrl1; |
+ urls[1] = kPresentationUrl2; |
service_ptr_->StartSession( |
- kPresentationUrl, |
- base::Bind( |
- &PresentationServiceImplTest::ExpectNewSessionCallbackSuccess, |
- base::Unretained(this))); |
+ urls.Clone(), |
+ base::Bind(&PresentationServiceImplTest::ExpectNewSessionCallbackSuccess, |
+ base::Unretained(this))); |
base::RunLoop run_loop; |
base::Callback<void(const PresentationSessionInfo&)> success_cb; |
- EXPECT_CALL(mock_delegate_, StartSession(_, _, Eq(kPresentationUrl), _, _)) |
- .WillOnce(DoAll( |
- InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
- SaveArg<3>(&success_cb))); |
+ EXPECT_CALL(mock_delegate_, |
+ StartSession(_, _, StringArrayEquals(ByRef(urls)), _, _)) |
+ .WillOnce(DoAll(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
+ SaveArg<3>(&success_cb))); |
run_loop.Run(); |
EXPECT_CALL(mock_delegate_, ListenForConnectionStateChange(_, _, _, _)) |
.Times(1); |
- success_cb.Run(PresentationSessionInfo(kPresentationUrl, kPresentationId)); |
+ success_cb.Run(PresentationSessionInfo(kPresentationUrl1, kPresentationId)); |
SaveQuitClosureAndRunLoop(); |
} |
TEST_F(PresentationServiceImplTest, StartSessionError) { |
+ mojo::Array<mojo::String> urls(2); |
+ urls[0] = kPresentationUrl1; |
+ urls[1] = kPresentationUrl2; |
service_ptr_->StartSession( |
- kPresentationUrl, |
- base::Bind( |
- &PresentationServiceImplTest::ExpectNewSessionCallbackError, |
- base::Unretained(this))); |
+ urls.Clone(), |
+ base::Bind(&PresentationServiceImplTest::ExpectNewSessionCallbackError, |
+ base::Unretained(this))); |
base::RunLoop run_loop; |
base::Callback<void(const PresentationError&)> error_cb; |
- EXPECT_CALL(mock_delegate_, StartSession(_, _, Eq(kPresentationUrl), _, _)) |
- .WillOnce(DoAll( |
- InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
- SaveArg<4>(&error_cb))); |
+ EXPECT_CALL(mock_delegate_, |
+ StartSession(_, _, StringArrayEquals(ByRef(urls)), _, _)) |
+ .WillOnce(DoAll(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
+ SaveArg<4>(&error_cb))); |
run_loop.Run(); |
error_cb.Run(PresentationError(PRESENTATION_ERROR_UNKNOWN, "Error message")); |
SaveQuitClosureAndRunLoop(); |
} |
TEST_F(PresentationServiceImplTest, JoinSessionSuccess) { |
+ mojo::Array<mojo::String> urls(2); |
+ urls[0] = kPresentationUrl1; |
+ urls[1] = kPresentationUrl2; |
service_ptr_->JoinSession( |
- kPresentationUrl, |
- kPresentationId, |
- base::Bind( |
- &PresentationServiceImplTest::ExpectNewSessionCallbackSuccess, |
- base::Unretained(this))); |
+ urls.Clone(), kPresentationId, |
+ base::Bind(&PresentationServiceImplTest::ExpectNewSessionCallbackSuccess, |
+ base::Unretained(this))); |
base::RunLoop run_loop; |
base::Callback<void(const PresentationSessionInfo&)> success_cb; |
- EXPECT_CALL(mock_delegate_, JoinSession( |
- _, _, Eq(kPresentationUrl), Eq(kPresentationId), _, _)) |
- .WillOnce(DoAll( |
- InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
- SaveArg<4>(&success_cb))); |
+ EXPECT_CALL(mock_delegate_, JoinSession(_, _, StringArrayEquals(ByRef(urls)), |
+ kPresentationId, _, _)) |
+ .WillOnce(DoAll(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
+ SaveArg<4>(&success_cb))); |
run_loop.Run(); |
EXPECT_CALL(mock_delegate_, ListenForConnectionStateChange(_, _, _, _)) |
.Times(1); |
- success_cb.Run(PresentationSessionInfo(kPresentationUrl, kPresentationId)); |
+ success_cb.Run(PresentationSessionInfo(kPresentationUrl1, kPresentationId)); |
SaveQuitClosureAndRunLoop(); |
} |
TEST_F(PresentationServiceImplTest, JoinSessionError) { |
+ mojo::Array<mojo::String> urls(2); |
+ urls[0] = kPresentationUrl1; |
+ urls[1] = kPresentationUrl2; |
service_ptr_->JoinSession( |
- kPresentationUrl, |
- kPresentationId, |
- base::Bind( |
- &PresentationServiceImplTest::ExpectNewSessionCallbackError, |
- base::Unretained(this))); |
+ urls.Clone(), kPresentationId, |
+ base::Bind(&PresentationServiceImplTest::ExpectNewSessionCallbackError, |
+ base::Unretained(this))); |
base::RunLoop run_loop; |
base::Callback<void(const PresentationError&)> error_cb; |
- EXPECT_CALL(mock_delegate_, JoinSession( |
- _, _, Eq(kPresentationUrl), Eq(kPresentationId), _, _)) |
- .WillOnce(DoAll( |
- InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
- SaveArg<5>(&error_cb))); |
+ EXPECT_CALL(mock_delegate_, JoinSession(_, _, StringArrayEquals(ByRef(urls)), |
+ kPresentationId, _, _)) |
+ .WillOnce(DoAll(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit), |
+ SaveArg<5>(&error_cb))); |
run_loop.Run(); |
error_cb.Run(PresentationError(PRESENTATION_ERROR_UNKNOWN, "Error message")); |
SaveQuitClosureAndRunLoop(); |
} |
TEST_F(PresentationServiceImplTest, CloseConnection) { |
- service_ptr_->CloseConnection(kPresentationUrl, kPresentationId); |
+ service_ptr_->CloseConnection(kPresentationUrl1, kPresentationId); |
base::RunLoop run_loop; |
EXPECT_CALL(mock_delegate_, CloseConnection(_, _, Eq(kPresentationId))) |
.WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
@@ -628,7 +660,7 @@ TEST_F(PresentationServiceImplTest, CloseConnection) { |
} |
TEST_F(PresentationServiceImplTest, Terminate) { |
- service_ptr_->Terminate(kPresentationUrl, kPresentationId); |
+ service_ptr_->Terminate(kPresentationUrl1, kPresentationId); |
base::RunLoop run_loop; |
EXPECT_CALL(mock_delegate_, Terminate(_, _, Eq(kPresentationId))) |
.WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
@@ -654,20 +686,22 @@ TEST_F(PresentationServiceImplTest, ListenForSessionMessagesWithEmptyMsg) { |
} |
TEST_F(PresentationServiceImplTest, StartSessionInProgress) { |
+ mojo::Array<mojo::String> urls(2); |
std::string presentation_url1("http://fooUrl"); |
std::string presentation_url2("http://barUrl"); |
- EXPECT_CALL(mock_delegate_, StartSession(_, _, Eq(presentation_url1), _, _)) |
+ urls[0] = presentation_url1; |
+ urls[1] = presentation_url2; |
+ EXPECT_CALL(mock_delegate_, |
+ StartSession(_, _, StringArrayEquals(ByRef(urls)), _, _)) |
.Times(1); |
- service_ptr_->StartSession(presentation_url1, |
- base::Bind(&DoNothing)); |
+ service_ptr_->StartSession(urls.Clone(), base::Bind(&DoNothing)); |
// This request should fail immediately, since there is already a StartSession |
// in progress. |
service_ptr_->StartSession( |
- presentation_url2, |
- base::Bind( |
- &PresentationServiceImplTest::ExpectNewSessionCallbackError, |
- base::Unretained(this))); |
+ urls.Clone(), |
+ base::Bind(&PresentationServiceImplTest::ExpectNewSessionCallbackError, |
+ base::Unretained(this))); |
SaveQuitClosureAndRunLoop(); |
} |
@@ -676,7 +710,7 @@ TEST_F(PresentationServiceImplTest, SendStringMessage) { |
blink::mojom::PresentationSessionInfoPtr session( |
blink::mojom::PresentationSessionInfo::New()); |
- session->url = kPresentationUrl; |
+ session->url = kPresentationUrl1; |
session->id = kPresentationId; |
blink::mojom::SessionMessagePtr message_request( |
blink::mojom::SessionMessage::New()); |
@@ -714,7 +748,7 @@ TEST_F(PresentationServiceImplTest, SendArrayBuffer) { |
blink::mojom::PresentationSessionInfoPtr session( |
blink::mojom::PresentationSessionInfo::New()); |
- session->url = kPresentationUrl; |
+ session->url = kPresentationUrl1; |
session->id = kPresentationId; |
blink::mojom::SessionMessagePtr message_request( |
blink::mojom::SessionMessage::New()); |
@@ -758,7 +792,7 @@ TEST_F(PresentationServiceImplTest, SendArrayBufferWithExceedingLimit) { |
blink::mojom::PresentationSessionInfoPtr session( |
blink::mojom::PresentationSessionInfo::New()); |
- session->url = kPresentationUrl; |
+ session->url = kPresentationUrl1; |
session->id = kPresentationId; |
blink::mojom::SessionMessagePtr message_request( |
blink::mojom::SessionMessage::New()); |
@@ -789,7 +823,7 @@ TEST_F(PresentationServiceImplTest, SendBlobData) { |
blink::mojom::PresentationSessionInfoPtr session( |
blink::mojom::PresentationSessionInfo::New()); |
- session->url = kPresentationUrl; |
+ session->url = kPresentationUrl1; |
session->id = kPresentationId; |
blink::mojom::SessionMessagePtr message_request( |
blink::mojom::SessionMessage::New()); |
@@ -829,20 +863,20 @@ TEST_F(PresentationServiceImplTest, MaxPendingJoinSessionRequests) { |
int i = 0; |
EXPECT_CALL(mock_delegate_, JoinSession(_, _, _, _, _, _)) |
.Times(num_requests); |
+ mojo::Array<mojo::String> urls(1); |
for (; i < num_requests; ++i) { |
- service_ptr_->JoinSession( |
- base::StringPrintf(presentation_url, i), |
- base::StringPrintf(presentation_id, i), |
- base::Bind(&DoNothing)); |
+ urls[0] = base::StringPrintf(presentation_url, i); |
+ service_ptr_->JoinSession(urls.Clone(), |
+ base::StringPrintf(presentation_id, i), |
+ base::Bind(&DoNothing)); |
} |
+ urls[0] = base::StringPrintf(presentation_url, i); |
// Exceeded maximum queue size, should invoke mojo callback with error. |
service_ptr_->JoinSession( |
- base::StringPrintf(presentation_url, i), |
- base::StringPrintf(presentation_id, i), |
- base::Bind( |
- &PresentationServiceImplTest::ExpectNewSessionCallbackError, |
- base::Unretained(this))); |
+ urls.Clone(), base::StringPrintf(presentation_id, i), |
+ base::Bind(&PresentationServiceImplTest::ExpectNewSessionCallbackError, |
+ base::Unretained(this))); |
SaveQuitClosureAndRunLoop(); |
} |
@@ -850,9 +884,9 @@ TEST_F(PresentationServiceImplTest, ScreenAvailabilityNotSupported) { |
mock_delegate_.set_screen_availability_listening_supported(false); |
base::RunLoop run_loop; |
EXPECT_CALL(mock_client_, |
- OnScreenAvailabilityNotSupported(Eq(kPresentationUrl))) |
+ OnScreenAvailabilityNotSupported(Eq(kPresentationUrl1))) |
.WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
- ListenForScreenAvailabilityAndWait(kPresentationUrl, false); |
+ ListenForScreenAvailabilityAndWait(kPresentationUrl1, false); |
run_loop.Run(); |
} |