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

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

Issue 2471883002: [Presentation API] (1st) (1-UA) Add is_offscreen_presentation attribute to MediaRouter (Closed)
Patch Set: resolve code review comments from Mark Created 4 years, 1 month 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 "mediaSinkId", "description", true, "", true), 404 "mediaSinkId", "description", true, "", true),
405 kPresentationId); 405 kPresentationId);
406 for (const auto& route_response_callback : route_response_callbacks) 406 for (const auto& route_response_callback : route_response_callbacks)
407 route_response_callback.Run(*result); 407 route_response_callback.Run(*result);
408 408
409 MockPresentationConnectionStateChangedCallback mock_callback; 409 MockPresentationConnectionStateChangedCallback mock_callback;
410 content::PresentationConnectionStateChangedCallback callback = 410 content::PresentationConnectionStateChangedCallback callback =
411 base::Bind(&MockPresentationConnectionStateChangedCallback::Run, 411 base::Bind(&MockPresentationConnectionStateChangedCallback::Run,
412 base::Unretained(&mock_callback)); 412 base::Unretained(&mock_callback));
413 content::PresentationSessionInfo connection(presentation_url1_, 413 content::PresentationSessionInfo connection(presentation_url1_,
414 kPresentationId); 414 kPresentationId, false);
415 EXPECT_CALL(router_, OnAddPresentationConnectionStateChangedCallbackInvoked( 415 EXPECT_CALL(router_, OnAddPresentationConnectionStateChangedCallbackInvoked(
416 Equals(callback))); 416 Equals(callback)));
417 delegate_impl_->ListenForConnectionStateChange(render_process_id, routing_id, 417 delegate_impl_->ListenForConnectionStateChange(render_process_id, routing_id,
418 connection, callback); 418 connection, callback);
419 } 419 }
420 420
421 TEST_F(PresentationServiceDelegateImplTest, Reset) { 421 TEST_F(PresentationServiceDelegateImplTest, Reset) {
422 EXPECT_CALL(router_, RegisterMediaSinksObserver(_)) 422 EXPECT_CALL(router_, RegisterMediaSinksObserver(_))
423 .WillRepeatedly(Return(true)); 423 .WillRepeatedly(Return(true));
424 424
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 int render_process_id = main_frame->GetProcess()->GetID(); 465 int render_process_id = main_frame->GetProcess()->GetID();
466 int render_frame_id = main_frame->GetRoutingID(); 466 int render_frame_id = main_frame->GetRoutingID();
467 467
468 EXPECT_CALL(router_, RegisterMediaSinksObserver(_)).WillOnce(Return(false)); 468 EXPECT_CALL(router_, RegisterMediaSinksObserver(_)).WillOnce(Return(false));
469 EXPECT_CALL(listener, OnScreenAvailabilityNotSupported()); 469 EXPECT_CALL(listener, OnScreenAvailabilityNotSupported());
470 EXPECT_FALSE(delegate_impl_->AddScreenAvailabilityListener( 470 EXPECT_FALSE(delegate_impl_->AddScreenAvailabilityListener(
471 render_process_id, render_frame_id, &listener)); 471 render_process_id, render_frame_id, &listener));
472 } 472 }
473 473
474 } // namespace media_router 474 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698