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

Unified Diff: chrome/test/media_router/media_router_e2e_browsertest.cc

Issue 1224093004: [Media Router] 2nd take on fix route response callback lifetime in UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test Created 5 years, 5 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
« no previous file with comments | « chrome/test/media_router/media_router_e2e_browsertest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/media_router/media_router_e2e_browsertest.cc
diff --git a/chrome/test/media_router/media_router_e2e_browsertest.cc b/chrome/test/media_router/media_router_e2e_browsertest.cc
index 24f6767e82510527e6107af32615a7c9b7390ec0..38f63c0fa0d8341aa6de7f842956bd71ff7de352 100644
--- a/chrome/test/media_router/media_router_e2e_browsertest.cc
+++ b/chrome/test/media_router/media_router_e2e_browsertest.cc
@@ -61,9 +61,9 @@ void MediaRouterE2EBrowserTest::TearDownOnMainThread() {
}
void MediaRouterE2EBrowserTest::OnRouteResponseReceived(
- scoped_ptr<MediaRoute> route,
+ const MediaRoute* route,
const std::string& error) {
- ASSERT_TRUE(route.get());
+ ASSERT_TRUE(route);
route_id_ = route->media_route_id();
}
@@ -85,10 +85,12 @@ void MediaRouterE2EBrowserTest::CreateMediaRoute(const MediaSource& source,
const MediaSink& sink = it->second;
// The callback will set route_id_ when invoked.
- media_router_->CreateRoute(
- source.id(), sink.id(), origin, tab_id,
+ std::vector<MediaRouteResponseCallback> route_response_callbacks;
+ route_response_callbacks.push_back(
base::Bind(&MediaRouterE2EBrowserTest::OnRouteResponseReceived,
base::Unretained(this)));
+ media_router_->CreateRoute(source.id(), sink.id(), origin, tab_id,
+ route_response_callbacks);
// Wait for the route request to be fulfilled (and route to be started).
ConditionalWait(base::TimeDelta::FromSeconds(30),
« no previous file with comments | « chrome/test/media_router/media_router_e2e_browsertest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698