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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 base::Bind(&MediaRouterDialogControllerTest::RequestSuccess, | 75 base::Bind(&MediaRouterDialogControllerTest::RequestSuccess, |
76 base::Unretained(this)), | 76 base::Unretained(this)), |
77 base::Bind(&MediaRouterDialogControllerTest::RequestError, | 77 base::Bind(&MediaRouterDialogControllerTest::RequestError, |
78 base::Unretained(this)))); | 78 base::Unretained(this)))); |
79 } | 79 } |
80 | 80 |
81 std::unique_ptr<TestMediaRouterDialogController> dialog_controller_; | 81 std::unique_ptr<TestMediaRouterDialogController> dialog_controller_; |
82 std::unique_ptr<MockWebContentsDelegate> web_contents_delegate_; | 82 std::unique_ptr<MockWebContentsDelegate> web_contents_delegate_; |
83 }; | 83 }; |
84 | 84 |
85 #if BUILDFLAG(ANDROID_JAVA_UI) | 85 #if defined(OS_ANDROID) |
86 // The non-Android implementation is tested in | 86 // The non-Android implementation is tested in |
87 // MediaRouterDialogControllerImplTest. | 87 // MediaRouterDialogControllerImplTest. |
88 TEST_F(MediaRouterDialogControllerTest, CreateForWebContents) { | 88 TEST_F(MediaRouterDialogControllerTest, CreateForWebContents) { |
89 MediaRouterDialogController* dialog_controller = | 89 MediaRouterDialogController* dialog_controller = |
90 MediaRouterDialogController::GetOrCreateForWebContents(web_contents()); | 90 MediaRouterDialogController::GetOrCreateForWebContents(web_contents()); |
91 ASSERT_NE(dialog_controller, nullptr); | 91 ASSERT_NE(dialog_controller, nullptr); |
92 } | 92 } |
93 #endif | 93 #endif |
94 | 94 |
95 TEST_F(MediaRouterDialogControllerTest, ShowAndHideDialog) { | 95 TEST_F(MediaRouterDialogControllerTest, ShowAndHideDialog) { |
(...skipping 21 matching lines...) Expand all Loading... |
117 EXPECT_TRUE(dialog_controller_->IsShowingMediaRouterDialog()); | 117 EXPECT_TRUE(dialog_controller_->IsShowingMediaRouterDialog()); |
118 | 118 |
119 // If a dialog is already shown, ShowMediaRouterDialogForPresentation() should | 119 // If a dialog is already shown, ShowMediaRouterDialogForPresentation() should |
120 // return false. | 120 // return false. |
121 EXPECT_CALL(*web_contents_delegate_, ActivateContents(web_contents())); | 121 EXPECT_CALL(*web_contents_delegate_, ActivateContents(web_contents())); |
122 EXPECT_FALSE( | 122 EXPECT_FALSE( |
123 dialog_controller_->ShowMediaRouterDialogForPresentation(GetRequest())); | 123 dialog_controller_->ShowMediaRouterDialogForPresentation(GetRequest())); |
124 } | 124 } |
125 | 125 |
126 } // namespace media_router | 126 } // namespace media_router |
OLD | NEW |