Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2914)

Unified Diff: chrome/browser/ui/views/desktop_media_picker_views_unittest.cc

Issue 1313843003: Enable keyboard navigation for Desktopcapture window selection dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove a unit test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/desktop_media_picker_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/desktop_media_picker_views_unittest.cc
diff --git a/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc b/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc
index d43e36c9b598a9e4c2ff9002c9014a709d4b480c..a5003a225485b523af6cfd48119e2495034c825f 100644
--- a/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc
+++ b/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc
@@ -87,6 +87,38 @@ TEST_F(DesktopMediaPickerViewsTest, DoneCallbackCalledOnOkButtonPressed) {
base::RunLoop().RunUntilIdle();
}
+// Verifies that a MediaSourceView is selected with mouse left click and
+// original selected MediaSourceView gets unselected.
+TEST_F(DesktopMediaPickerViewsTest, SelectMediaSourceViewOnSingleClick) {
+ media_list_->AddSource(0);
+ media_list_->AddSource(1);
+
+ DesktopMediaSourceView* source_view_0 =
+ GetPickerDialogView()->GetMediaSourceViewForTesting(0);
+
+ DesktopMediaSourceView* source_view_1 =
+ GetPickerDialogView()->GetMediaSourceViewForTesting(1);
+
+ // Both media source views are not selected initially.
+ EXPECT_FALSE(source_view_0->is_selected());
+ EXPECT_FALSE(source_view_1->is_selected());
+
+ // Source view 0 is selected with mouse click.
+ ui::MouseEvent press(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0);
+
+ GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnMousePressed(press);
+
+ EXPECT_TRUE(source_view_0->is_selected());
+ EXPECT_FALSE(source_view_1->is_selected());
+
+ // Source view 1 is selected and source view 0 is unselected with mouse click.
+ GetPickerDialogView()->GetMediaSourceViewForTesting(1)->OnMousePressed(press);
+
+ EXPECT_FALSE(source_view_0->is_selected());
+ EXPECT_TRUE(source_view_1->is_selected());
+}
+
TEST_F(DesktopMediaPickerViewsTest, DoneCallbackCalledOnDoubleClick) {
const int kFakeId = 222;
EXPECT_CALL(*this,
@@ -185,4 +217,9 @@ TEST_F(DesktopMediaPickerViewsTest, OkButtonDisabledWhenNoSelection) {
GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
}
+// Verifies that the MediaListView get the initial focus.
+TEST_F(DesktopMediaPickerViewsTest, ListViewHasInitialFocus) {
+ EXPECT_TRUE(GetPickerDialogView()->GetMediaListViewForTesting()->HasFocus());
+}
+
} // namespace views
« no previous file with comments | « chrome/browser/ui/views/desktop_media_picker_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698