| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/views/desktop_media_picker_views_deprecated.h" | 5 #include "chrome/browser/ui/views/desktop_media_picker_views_deprecated.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 TEST_F(DesktopMediaPickerViewsDeprecatedTest, DoneCallbackCalledOnDoubleTap) { | 147 TEST_F(DesktopMediaPickerViewsDeprecatedTest, DoneCallbackCalledOnDoubleTap) { |
| 148 const int kFakeId = 222; | 148 const int kFakeId = 222; |
| 149 EXPECT_CALL(*this, OnPickerDone(content::DesktopMediaID( | 149 EXPECT_CALL(*this, OnPickerDone(content::DesktopMediaID( |
| 150 content::DesktopMediaID::TYPE_WINDOW, kFakeId))); | 150 content::DesktopMediaID::TYPE_WINDOW, kFakeId))); |
| 151 | 151 |
| 152 window_list_->AddSource(kFakeId); | 152 window_list_->AddSource(kFakeId); |
| 153 ui::GestureEventDetails details(ui::ET_GESTURE_TAP); | 153 ui::GestureEventDetails details(ui::ET_GESTURE_TAP); |
| 154 details.set_tap_count(2); | 154 details.set_tap_count(2); |
| 155 ui::GestureEvent double_tap(10, 10, 0, base::TimeDelta(), details); | 155 ui::GestureEvent double_tap(10, 10, 0, base::TimeTicks(), details); |
| 156 | 156 |
| 157 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnGestureEvent( | 157 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnGestureEvent( |
| 158 &double_tap); | 158 &double_tap); |
| 159 base::RunLoop().RunUntilIdle(); | 159 base::RunLoop().RunUntilIdle(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 TEST_F(DesktopMediaPickerViewsDeprecatedTest, CancelButtonAlwaysEnabled) { | 162 TEST_F(DesktopMediaPickerViewsDeprecatedTest, CancelButtonAlwaysEnabled) { |
| 163 EXPECT_TRUE( | 163 EXPECT_TRUE( |
| 164 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); | 164 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); |
| 165 } | 165 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 EXPECT_FALSE( | 222 EXPECT_FALSE( |
| 223 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 223 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
| 224 } | 224 } |
| 225 | 225 |
| 226 // Verifies that the MediaListView get the initial focus. | 226 // Verifies that the MediaListView get the initial focus. |
| 227 TEST_F(DesktopMediaPickerViewsDeprecatedTest, ListViewHasInitialFocus) { | 227 TEST_F(DesktopMediaPickerViewsDeprecatedTest, ListViewHasInitialFocus) { |
| 228 EXPECT_TRUE(GetPickerDialogView()->GetMediaListViewForTesting()->HasFocus()); | 228 EXPECT_TRUE(GetPickerDialogView()->GetMediaListViewForTesting()->HasFocus()); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace deprecated | 231 } // namespace deprecated |
| OLD | NEW |