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

Side by Side Diff: ui/aura/window_targeter_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
« no previous file with comments | « ui/aura/test/event_generator.cc ('k') | ui/aura/window_unittest.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/aura/window_targeter.h" 5 #include "ui/aura/window_targeter.h"
6 6
7 #include "ui/aura/test/aura_test_base.h" 7 #include "ui/aura/test/aura_test_base.h"
8 #include "ui/aura/test/test_event_handler.h" 8 #include "ui/aura/test/test_event_handler.h"
9 #include "ui/aura/test/test_window_delegate.h" 9 #include "ui/aura/test/test_window_delegate.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 19 matching lines...) Expand all
30 two->SetBounds(gfx::Rect(501, 0, 500, 1000)); 30 two->SetBounds(gfx::Rect(501, 0, 500, 1000));
31 31
32 root_window()->Show(); 32 root_window()->Show();
33 33
34 test::TestEventHandler handler; 34 test::TestEventHandler handler;
35 one->AddPreTargetHandler(&handler); 35 one->AddPreTargetHandler(&handler);
36 36
37 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, 37 ui::MouseEvent press(ui::ET_MOUSE_PRESSED,
38 gfx::Point(20, 20), 38 gfx::Point(20, 20),
39 gfx::Point(20, 20), 39 gfx::Point(20, 20),
40 ui::EF_NONE,
40 ui::EF_NONE); 41 ui::EF_NONE);
41 root_window()->GetDispatcher()->AsRootWindowHostDelegate()-> 42 root_window()->GetDispatcher()->AsRootWindowHostDelegate()->
42 OnHostMouseEvent(&press); 43 OnHostMouseEvent(&press);
43 EXPECT_EQ(1, handler.num_mouse_events()); 44 EXPECT_EQ(1, handler.num_mouse_events());
44 45
45 handler.Reset(); 46 handler.Reset();
46 ui::EventDispatchDetails details = 47 ui::EventDispatchDetails details =
47 root_window()->GetDispatcher()->OnEventFromSource(&press); 48 root_window()->GetDispatcher()->OnEventFromSource(&press);
48 EXPECT_FALSE(details.dispatcher_destroyed); 49 EXPECT_FALSE(details.dispatcher_destroyed);
49 EXPECT_EQ(1, handler.num_mouse_events()); 50 EXPECT_EQ(1, handler.num_mouse_events());
50 51
51 one->RemovePreTargetHandler(&handler); 52 one->RemovePreTargetHandler(&handler);
52 } 53 }
53 54
54 } // namespace aura 55 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/event_generator.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698