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

Side by Side Diff: ash/autoclick/autoclick_unittest.cc

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/autoclick/autoclick_controller.h" 5 #include "ash/autoclick/autoclick_controller.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "ash/test/ash_test_base.h" 7 #include "ash/test/ash_test_base.h"
8 #include "ui/aura/root_window.h" 8 #include "ui/aura/root_window.h"
9 #include "ui/aura/test/event_generator.h" 9 #include "ui/aura/test/event_generator.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 18 matching lines...) Expand all
29 return; 29 return;
30 // Filter out extraneous mouse events like mouse entered, exited, 30 // Filter out extraneous mouse events like mouse entered, exited,
31 // capture changed, etc. 31 // capture changed, etc.
32 ui::EventType type = event->type(); 32 ui::EventType type = event->type();
33 if (type == ui::ET_MOUSE_MOVED || type == ui::ET_MOUSE_PRESSED || 33 if (type == ui::ET_MOUSE_MOVED || type == ui::ET_MOUSE_PRESSED ||
34 type == ui::ET_MOUSE_RELEASED) { 34 type == ui::ET_MOUSE_RELEASED) {
35 events_.push_back(ui::MouseEvent( 35 events_.push_back(ui::MouseEvent(
36 event->type(), 36 event->type(),
37 event->location(), 37 event->location(),
38 event->root_location(), 38 event->root_location(),
39 event->flags())); 39 event->flags(),
40 event->changed_button_flags()));
40 // Stop event propagation so we don't click on random stuff that 41 // Stop event propagation so we don't click on random stuff that
41 // might break test assumptions. 42 // might break test assumptions.
42 event->StopPropagation(); 43 event->StopPropagation();
43 } 44 }
44 45
45 // If there is a possibility that we're in an infinite loop, we should 46 // If there is a possibility that we're in an infinite loop, we should
46 // exit early with a sensible error rather than letting the test time out. 47 // exit early with a sensible error rather than letting the test time out.
47 ASSERT_LT(events_.size(), 100u); 48 ASSERT_LT(events_.size(), 100u);
48 } 49 }
49 50
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // Test scroll events. 281 // Test scroll events.
281 GetEventGenerator().MoveMouseTo(200, 200); 282 GetEventGenerator().MoveMouseTo(200, 200);
282 GetEventGenerator().ScrollSequence( 283 GetEventGenerator().ScrollSequence(
283 gfx::Point(100, 100), base::TimeDelta::FromMilliseconds(200), 284 gfx::Point(100, 100), base::TimeDelta::FromMilliseconds(200),
284 0, 100, 3, 2); 285 0, 100, 3, 2);
285 events = WaitForMouseEvents(); 286 events = WaitForMouseEvents();
286 EXPECT_EQ(0u, events.size()); 287 EXPECT_EQ(0u, events.size());
287 } 288 }
288 289
289 } // namespace ash 290 } // namespace ash
OLDNEW
« no previous file with comments | « ash/autoclick/autoclick_controller.cc ('k') | ash/display/mouse_cursor_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698