| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "chrome/browser/media/router/create_presentation_connection_request.h" | 7 #include "chrome/browser/media/router/create_presentation_connection_request.h" |
| 8 #include "chrome/browser/media/router/media_router_dialog_controller.h" | 8 #include "chrome/browser/media/router/media_router_dialog_controller.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/features.h" | 10 #include "chrome/common/features.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 new TestMediaRouterDialogController(web_contents())); | 55 new TestMediaRouterDialogController(web_contents())); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TearDown() override { | 58 void TearDown() override { |
| 59 dialog_controller_.reset(); | 59 dialog_controller_.reset(); |
| 60 web_contents_delegate_.reset(); | 60 web_contents_delegate_.reset(); |
| 61 ChromeRenderViewHostTestHarness::TearDown(); | 61 ChromeRenderViewHostTestHarness::TearDown(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void RequestSuccess(const content::PresentationSessionInfo&, | 64 void RequestSuccess(const content::PresentationSessionInfo&, |
| 65 const MediaRoute::Id&) {} | 65 const MediaRoute&) {} |
| 66 void RequestError(const content::PresentationError& error) {} | 66 void RequestError(const content::PresentationError& error) {} |
| 67 | 67 |
| 68 std::unique_ptr<CreatePresentationConnectionRequest> GetRequest() { | 68 std::unique_ptr<CreatePresentationConnectionRequest> GetRequest() { |
| 69 return base::MakeUnique<CreatePresentationConnectionRequest>( | 69 return base::MakeUnique<CreatePresentationConnectionRequest>( |
| 70 RenderFrameHostId(1, 2), GURL("http://example.com"), | 70 RenderFrameHostId(1, 2), GURL("http://example.com"), |
| 71 GURL("http://google.com"), | 71 GURL("http://google.com"), |
| 72 base::Bind(&MediaRouterDialogControllerTest::RequestSuccess, | 72 base::Bind(&MediaRouterDialogControllerTest::RequestSuccess, |
| 73 base::Unretained(this)), | 73 base::Unretained(this)), |
| 74 base::Bind(&MediaRouterDialogControllerTest::RequestError, | 74 base::Bind(&MediaRouterDialogControllerTest::RequestError, |
| 75 base::Unretained(this))); | 75 base::Unretained(this))); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 EXPECT_TRUE(dialog_controller_->IsShowingMediaRouterDialog()); | 114 EXPECT_TRUE(dialog_controller_->IsShowingMediaRouterDialog()); |
| 115 | 115 |
| 116 // If a dialog is already shown, ShowMediaRouterDialogForPresentation() should | 116 // If a dialog is already shown, ShowMediaRouterDialogForPresentation() should |
| 117 // return false. | 117 // return false. |
| 118 EXPECT_CALL(*web_contents_delegate_, ActivateContents(web_contents())); | 118 EXPECT_CALL(*web_contents_delegate_, ActivateContents(web_contents())); |
| 119 EXPECT_FALSE( | 119 EXPECT_FALSE( |
| 120 dialog_controller_->ShowMediaRouterDialogForPresentation(GetRequest())); | 120 dialog_controller_->ShowMediaRouterDialogForPresentation(GetRequest())); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace media_router | 123 } // namespace media_router |
| OLD | NEW |