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

Unified Diff: chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc

Issue 2837363002: [Media Router] Use DialMediaSinkService in MediaRouterMojoImpl (Closed)
Patch Set: resolve code review comments from Mark Created 3 years, 8 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/mojo/media_router_mojo_impl_unittest.cc
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc b/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc
index 2d18b4558b9cad21ef01775a4b5ee0ac0435ef0d..7a78f00c69df3a0c858c18d33b4f9a838bb58ced 100644
--- a/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc
+++ b/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc
@@ -184,12 +184,6 @@ class TestProcessManager : public extensions::ProcessManager {
DISALLOW_COPY_AND_ASSIGN(TestProcessManager);
};
-// Mockable class for awaiting RegisterMediaRouteProvider callbacks.
-class RegisterMediaRouteProviderHandler {
- public:
- MOCK_METHOD1(Invoke, void(const std::string& instance_id));
-};
-
TEST_F(MediaRouterMojoImplTest, CreateRoute) {
MediaSource media_source(kSource);
MediaRoute expected_route(kRouteId, media_source, kSinkId, "", false, "",
@@ -1411,7 +1405,8 @@ class MediaRouterMojoExtensionTest : public ::testing::Test {
DCHECK(process_manager_);
// Create MR and its proxy, so that it can be accessed through Mojo.
- media_router_.reset(new MediaRouterMojoImpl(process_manager_));
+ media_router_.reset(
+ new MediaRouterMojoImpl(process_manager_, profile_.get()));
ProcessEventLoop();
}
@@ -1496,7 +1491,7 @@ TEST_F(MediaRouterMojoExtensionTest, DeferredBindingAndSuspension) {
// itself via RegisterMediaRouteProvider().
// Now that the |media_router| and |mojo_media_router| are fully initialized,
// the queued DetachRoute() call should be executed.
- EXPECT_CALL(provide_handler_, Invoke(testing::Not("")))
+ EXPECT_CALL(provide_handler_, InvokeRaw(testing::Not(""), _))
.WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); }));
EXPECT_CALL(*process_manager_, IsEventPageSuspended(extension_->id()))
.WillOnce(Return(false));
@@ -1524,7 +1519,7 @@ TEST_F(MediaRouterMojoExtensionTest, DeferredBindingAndSuspension) {
base::RunLoop run_loop4, run_loop5;
// RegisterMediaRouteProvider() is called.
// The queued DetachRoute(kRouteId2) call should be executed.
- EXPECT_CALL(provide_handler_, Invoke(testing::Not("")))
+ EXPECT_CALL(provide_handler_, InvokeRaw(testing::Not(""), _))
.WillOnce(InvokeWithoutArgs([&run_loop4]() { run_loop4.Quit(); }));
EXPECT_CALL(*process_manager_, IsEventPageSuspended(extension_->id()))
.WillOnce(Return(false));
@@ -1634,7 +1629,7 @@ TEST_F(MediaRouterMojoExtensionTest, DropOldestPendingRequest) {
// The oldest request should have been dropped, so we don't expect to see
// DetachRoute(kRouteId) here.
BindMediaRouteProvider();
- EXPECT_CALL(provide_handler_, Invoke(testing::Not("")))
+ EXPECT_CALL(provide_handler_, InvokeRaw(testing::Not(""), _))
.WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); }));
EXPECT_CALL(*process_manager_, IsEventPageSuspended(extension_->id()));
EXPECT_CALL(mock_media_route_provider_, EnableMdnsDiscovery())
@@ -1731,10 +1726,8 @@ TEST_F(MediaRouterMojoExtensionTest, UpdateMediaSinksOnUserGesture) {
BindMediaRouteProvider();
base::RunLoop run_loop;
- EXPECT_CALL(provide_handler_, Invoke(testing::Not("")))
- .WillOnce(InvokeWithoutArgs([&run_loop]() {
- run_loop.Quit();
- }));
+ EXPECT_CALL(provide_handler_, InvokeRaw(testing::Not(""), _))
+ .WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); }));
EXPECT_CALL(*process_manager_, IsEventPageSuspended(extension_->id()))
#if defined(OS_WIN)
// Windows calls once for EnableMdnsDiscovery

Powered by Google App Engine
This is Rietveld 408576698