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

Side by Side Diff: chrome/browser/ui/views/desktop_media_picker_views_unittest.cc

Issue 565583005: Clean up GestureEventDetails constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alwasy set oldest_touch_id_ to -1 in the constructor Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/media/fake_desktop_media_list.h" 8 #include "chrome/browser/media/fake_desktop_media_list.h"
9 #include "chrome/browser/ui/views/desktop_media_picker_views.h" 9 #include "chrome/browser/ui/views/desktop_media_picker_views.h"
10 #include "components/web_modal/test_web_contents_modal_dialog_host.h" 10 #include "components/web_modal/test_web_contents_modal_dialog_host.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 base::RunLoop().RunUntilIdle(); 119 base::RunLoop().RunUntilIdle();
120 } 120 }
121 121
122 TEST_F(DesktopMediaPickerViewsTest, DoneCallbackCalledOnDoubleTap) { 122 TEST_F(DesktopMediaPickerViewsTest, DoneCallbackCalledOnDoubleTap) {
123 const int kFakeId = 222; 123 const int kFakeId = 222;
124 EXPECT_CALL(*this, 124 EXPECT_CALL(*this,
125 OnPickerDone(content::DesktopMediaID( 125 OnPickerDone(content::DesktopMediaID(
126 content::DesktopMediaID::TYPE_WINDOW, kFakeId))); 126 content::DesktopMediaID::TYPE_WINDOW, kFakeId)));
127 127
128 media_list_->AddSource(kFakeId); 128 media_list_->AddSource(kFakeId);
129 129 ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
130 ui::GestureEvent double_tap( 130 details.set_tap_count(2);
131 10, 131 ui::GestureEvent double_tap(10, 10, 0, base::TimeDelta(), details);
132 10,
133 0,
134 base::TimeDelta(),
135 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 2, 0));
136 132
137 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnGestureEvent( 133 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnGestureEvent(
138 &double_tap); 134 &double_tap);
139 base::RunLoop().RunUntilIdle(); 135 base::RunLoop().RunUntilIdle();
140 } 136 }
141 137
142 TEST_F(DesktopMediaPickerViewsTest, CancelButtonAlwaysEnabled) { 138 TEST_F(DesktopMediaPickerViewsTest, CancelButtonAlwaysEnabled) {
143 EXPECT_TRUE( 139 EXPECT_TRUE(
144 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); 140 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL));
145 } 141 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnFocus(); 193 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnFocus();
198 EXPECT_TRUE( 194 EXPECT_TRUE(
199 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); 195 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
200 196
201 media_list_->RemoveSource(0); 197 media_list_->RemoveSource(0);
202 EXPECT_FALSE( 198 EXPECT_FALSE(
203 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); 199 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
204 } 200 }
205 201
206 } // namespace views 202 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698