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

Side by Side Diff: ui/events/test/event_generator.cc

Issue 2094193002: Deflake Mac views_unittest's MenuRunnerCocoaTest.RunMenuAndCancel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lint Created 4 years, 5 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
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_runner_cocoa_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/events/test/event_generator.h" 5 #include "ui/events/test/event_generator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 flags_(0), 154 flags_(0),
155 grab_(false), 155 grab_(false),
156 async_(false), 156 async_(false),
157 targeting_application_(false) { 157 targeting_application_(false) {
158 Init(NULL, NULL); 158 Init(NULL, NULL);
159 } 159 }
160 160
161 EventGenerator::~EventGenerator() { 161 EventGenerator::~EventGenerator() {
162 pending_events_.clear(); 162 pending_events_.clear();
163 delegate()->SetContext(NULL, NULL, NULL); 163 delegate()->SetContext(NULL, NULL, NULL);
164 ui::SetEventTickClockForTesting(nullptr);
164 } 165 }
165 166
166 void EventGenerator::PressLeftButton() { 167 void EventGenerator::PressLeftButton() {
167 PressButton(ui::EF_LEFT_MOUSE_BUTTON); 168 PressButton(ui::EF_LEFT_MOUSE_BUTTON);
168 } 169 }
169 170
170 void EventGenerator::ReleaseLeftButton() { 171 void EventGenerator::ReleaseLeftButton() {
171 ReleaseButton(ui::EF_LEFT_MOUSE_BUTTON); 172 ReleaseButton(ui::EF_LEFT_MOUSE_BUTTON);
172 } 173 }
173 174
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 return default_delegate; 729 return default_delegate;
729 } 730 }
730 731
731 EventGeneratorDelegate* EventGenerator::delegate() { 732 EventGeneratorDelegate* EventGenerator::delegate() {
732 return const_cast<EventGeneratorDelegate*>( 733 return const_cast<EventGeneratorDelegate*>(
733 const_cast<const EventGenerator*>(this)->delegate()); 734 const_cast<const EventGenerator*>(this)->delegate());
734 } 735 }
735 736
736 } // namespace test 737 } // namespace test
737 } // namespace ui 738 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_runner_cocoa_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698