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

Side by Side Diff: chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/media/router/media_source.h" 9 #include "chrome/browser/media/router/media_source.h"
10 #include "chrome/browser/media/router/media_source_helper.h" 10 #include "chrome/browser/media/router/media_source_helper.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 base::Bind(&MockCreatePresentationConnnectionCallbacks:: 387 base::Bind(&MockCreatePresentationConnnectionCallbacks::
388 OnCreateConnectionSuccess, 388 OnCreateConnectionSuccess,
389 base::Unretained(&mock_create_connection_callbacks)), 389 base::Unretained(&mock_create_connection_callbacks)),
390 base::Bind( 390 base::Bind(
391 &MockCreatePresentationConnnectionCallbacks::OnCreateConnectionError, 391 &MockCreatePresentationConnnectionCallbacks::OnCreateConnectionError,
392 base::Unretained(&mock_create_connection_callbacks))); 392 base::Unretained(&mock_create_connection_callbacks)));
393 393
394 EXPECT_CALL(mock_create_connection_callbacks, OnCreateConnectionSuccess(_)) 394 EXPECT_CALL(mock_create_connection_callbacks, OnCreateConnectionSuccess(_))
395 .Times(1); 395 .Times(1);
396 std::unique_ptr<RouteRequestResult> result = RouteRequestResult::FromSuccess( 396 std::unique_ptr<RouteRequestResult> result = RouteRequestResult::FromSuccess(
397 base::WrapUnique(new MediaRoute( 397 base::MakeUnique<MediaRoute>(
398 "routeId", MediaSourceForPresentationUrl(kPresentationUrl1), 398 "routeId", MediaSourceForPresentationUrl(kPresentationUrl1),
399 "mediaSinkId", "description", true, "", true)), 399 "mediaSinkId", "description", true, "", true),
400 kPresentationId); 400 kPresentationId);
401 for (const auto& route_response_callback : route_response_callbacks) 401 for (const auto& route_response_callback : route_response_callbacks)
402 route_response_callback.Run(*result); 402 route_response_callback.Run(*result);
403 403
404 MockPresentationConnectionStateChangedCallback mock_callback; 404 MockPresentationConnectionStateChangedCallback mock_callback;
405 content::PresentationConnectionStateChangedCallback callback = 405 content::PresentationConnectionStateChangedCallback callback =
406 base::Bind(&MockPresentationConnectionStateChangedCallback::Run, 406 base::Bind(&MockPresentationConnectionStateChangedCallback::Run,
407 base::Unretained(&mock_callback)); 407 base::Unretained(&mock_callback));
408 content::PresentationSessionInfo connection(kPresentationUrl1, 408 content::PresentationSessionInfo connection(kPresentationUrl1,
409 kPresentationId); 409 kPresentationId);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 int render_process_id = main_frame->GetProcess()->GetID(); 460 int render_process_id = main_frame->GetProcess()->GetID();
461 int render_frame_id = main_frame->GetRoutingID(); 461 int render_frame_id = main_frame->GetRoutingID();
462 462
463 EXPECT_CALL(router_, RegisterMediaSinksObserver(_)).WillOnce(Return(false)); 463 EXPECT_CALL(router_, RegisterMediaSinksObserver(_)).WillOnce(Return(false));
464 EXPECT_CALL(listener, OnScreenAvailabilityNotSupported()); 464 EXPECT_CALL(listener, OnScreenAvailabilityNotSupported());
465 EXPECT_FALSE(delegate_impl_->AddScreenAvailabilityListener( 465 EXPECT_FALSE(delegate_impl_->AddScreenAvailabilityListener(
466 render_process_id, render_frame_id, &listener)); 466 render_process_id, render_frame_id, &listener));
467 } 467 }
468 468
469 } // namespace media_router 469 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698