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

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

Issue 1971893002: [MediaRouter] Update JoinRoute behavior to allow non-local routes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 7ddf759a5cac6c679a5e9c6546437769521c5ee3..7cad040d6cb2d1d3b1bde42dd3162f9e2a953769 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
@@ -383,17 +383,17 @@ TEST_F(MediaRouterMojoImplTest, OffTheRecordRoutesTerminatedOnProfileShutdown) {
TEST_F(MediaRouterMojoImplTest, JoinRoute) {
MediaSource media_source(kSource);
-
MediaRoute expected_route(kRouteId, media_source, kSinkId, "", false, "",
false);
interfaces::MediaRoutePtr route = CreateMojoRoute();
// Make sure the MR has received an update with the route, so it knows there
- // is a local route to join.
+ // is a route to join.
mojo::Array<interfaces::MediaRoutePtr> mojo_routes(1);
mojo_routes[0] = route->Clone();
router()->OnRoutesUpdated(std::move(mojo_routes), mojo::String(),
mojo::Array<mojo::String>());
+ EXPECT_TRUE(router()->HasJoinableRoute());
// Use a lambda function as an invocation target here to work around
// a limitation with GMock::Invoke that prevents it from using move-only types
@@ -442,11 +442,12 @@ TEST_F(MediaRouterMojoImplTest, JoinRouteNotFoundFails) {
TEST_F(MediaRouterMojoImplTest, JoinRouteTimedOutFails) {
// Make sure the MR has received an update with the route, so it knows there
- // is a local route to join.
+ // is a route to join.
mojo::Array<interfaces::MediaRoutePtr> mojo_routes(1);
mojo_routes[0] = CreateMojoRoute();
router()->OnRoutesUpdated(std::move(mojo_routes), mojo::String(),
mojo::Array<mojo::String>());
+ EXPECT_TRUE(router()->HasJoinableRoute());
EXPECT_CALL(
mock_media_route_provider_,
@@ -479,11 +480,12 @@ TEST_F(MediaRouterMojoImplTest, JoinRouteOffTheRecordMismatchFails) {
interfaces::MediaRoutePtr route = CreateMojoRoute();
// Make sure the MR has received an update with the route, so it knows there
- // is a local route to join.
+ // is a route to join.
mojo::Array<interfaces::MediaRoutePtr> mojo_routes(1);
mojo_routes[0] = route->Clone();
router()->OnRoutesUpdated(std::move(mojo_routes), mojo::String(),
mojo::Array<mojo::String>());
+ EXPECT_TRUE(router()->HasJoinableRoute());
// Use a lambda function as an invocation target here to work around
// a limitation with GMock::Invoke that prevents it from using move-only types

Powered by Google App Engine
This is Rietveld 408576698