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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "chrome/browser/media/router/create_presentation_connection_request.h" | 8 #include "chrome/browser/media/router/create_presentation_connection_request.h" |
9 #include "chrome/browser/media/router/media_router_dialog_controller.h" | 9 #include "chrome/browser/media/router/media_router_dialog_controller.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 dialog_controller_.reset( | 54 dialog_controller_.reset( |
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::PresentationInfo&, const MediaRoute&) {} |
65 const MediaRoute&) {} | |
66 void RequestError(const content::PresentationError& error) {} | 65 void RequestError(const content::PresentationError& error) {} |
67 | 66 |
68 std::unique_ptr<CreatePresentationConnectionRequest> GetRequest() { | 67 std::unique_ptr<CreatePresentationConnectionRequest> GetRequest() { |
69 return std::unique_ptr<CreatePresentationConnectionRequest>( | 68 return std::unique_ptr<CreatePresentationConnectionRequest>( |
70 new CreatePresentationConnectionRequest( | 69 new CreatePresentationConnectionRequest( |
71 RenderFrameHostId(1, 2), | 70 RenderFrameHostId(1, 2), |
72 {GURL("http://example.com"), GURL("http://example2.com")}, | 71 {GURL("http://example.com"), GURL("http://example2.com")}, |
73 url::Origin(GURL("http://google.com")), | 72 url::Origin(GURL("http://google.com")), |
74 base::Bind(&MediaRouterDialogControllerTest::RequestSuccess, | 73 base::Bind(&MediaRouterDialogControllerTest::RequestSuccess, |
75 base::Unretained(this)), | 74 base::Unretained(this)), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 EXPECT_TRUE(dialog_controller_->IsShowingMediaRouterDialog()); | 115 EXPECT_TRUE(dialog_controller_->IsShowingMediaRouterDialog()); |
117 | 116 |
118 // If a dialog is already shown, ShowMediaRouterDialogForPresentation() should | 117 // If a dialog is already shown, ShowMediaRouterDialogForPresentation() should |
119 // return false. | 118 // return false. |
120 EXPECT_CALL(*web_contents_delegate_, ActivateContents(web_contents())); | 119 EXPECT_CALL(*web_contents_delegate_, ActivateContents(web_contents())); |
121 EXPECT_FALSE( | 120 EXPECT_FALSE( |
122 dialog_controller_->ShowMediaRouterDialogForPresentation(GetRequest())); | 121 dialog_controller_->ShowMediaRouterDialogForPresentation(GetRequest())); |
123 } | 122 } |
124 | 123 |
125 } // namespace media_router | 124 } // namespace media_router |
OLD | NEW |