Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 20 matching lines...) Expand all Loading... | |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const char kPresentationUrl1[] = "http://foo.fakeurl.com/"; | 33 const char kPresentationUrl1[] = "http://foo.fakeurl.com/"; |
| 34 const char kPresentationUrl2[] = "http://bar.fakeurl.com/"; | 34 const char kPresentationUrl2[] = "http://bar.fakeurl.com/"; |
| 35 const char kFrameUrl[] = "http://anotherframeurl.fakeurl.com/"; | 35 const char kFrameUrl[] = "http://anotherframeurl.fakeurl.com/"; |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 namespace media_router { | 39 namespace media_router { |
| 40 | 40 |
| 41 class MockDelegateObserver | 41 class MockDelegateObserver |
|
mark a. foltz
2016/10/21 00:53:02
Please add a unit test for RegisterOffscreenPresen
zhaobin
2016/10/22 02:44:13
Done.
| |
| 42 : public content::PresentationServiceDelegate::Observer { | 42 : public content::PresentationServiceDelegateBase::Observer { |
| 43 public: | 43 public: |
| 44 MOCK_METHOD0(OnDelegateDestroyed, void()); | 44 MOCK_METHOD0(OnDelegateDestroyed, void()); |
| 45 MOCK_METHOD1(OnDefaultPresentationStarted, | 45 MOCK_METHOD1(OnDefaultPresentationStarted, |
| 46 void(const content::PresentationSessionInfo&)); | 46 void(const content::PresentationSessionInfo&)); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class MockDefaultPresentationRequestObserver | 49 class MockDefaultPresentationRequestObserver |
| 50 : public PresentationServiceDelegateImpl:: | 50 : public PresentationServiceDelegateImpl:: |
| 51 DefaultPresentationRequestObserver { | 51 DefaultPresentationRequestObserver { |
| 52 public: | 52 public: |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |
| OLD | NEW |