OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 &mouse_dragged_event); | 661 &mouse_dragged_event); |
662 dispatcher()->ReleasePointerMoves(); | 662 dispatcher()->ReleasePointerMoves(); |
663 dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( | 663 dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( |
664 &mouse_dragged_event2); | 664 &mouse_dragged_event2); |
665 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); | 665 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); |
666 filter->events().clear(); | 666 filter->events().clear(); |
667 RunAllPendingInMessageLoop(); | 667 RunAllPendingInMessageLoop(); |
668 EXPECT_TRUE(filter->events().empty()); | 668 EXPECT_TRUE(filter->events().empty()); |
669 } | 669 } |
670 | 670 |
671 TEST_F(RootWindowTest, TouchMovesHeld) { | 671 #if defined(OS_CHROMEOS) |
| 672 // This test may be flaky on Chromium OS valgrind bots: http://crbug.com/333644 |
| 673 #define MAYBE_TouchMovesHeld DISABLED_TouchMovesHeld |
| 674 #else |
| 675 #define MAYBE_TouchMovesHeld TouchMovesHeld |
| 676 #endif |
| 677 TEST_F(RootWindowTest, MAYBE_TouchMovesHeld) { |
672 EventFilterRecorder* filter = new EventFilterRecorder; | 678 EventFilterRecorder* filter = new EventFilterRecorder; |
673 root_window()->SetEventFilter(filter); // passes ownership | 679 root_window()->SetEventFilter(filter); // passes ownership |
674 | 680 |
675 test::TestWindowDelegate delegate; | 681 test::TestWindowDelegate delegate; |
676 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( | 682 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
677 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); | 683 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); |
678 | 684 |
679 // Starting the touch and throwing out the first few events, since the system | 685 // Starting the touch and throwing out the first few events, since the system |
680 // is going to generate synthetic mouse events that are not relevant to the | 686 // is going to generate synthetic mouse events that are not relevant to the |
681 // test. | 687 // test. |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 CHECK(!message_loop()->is_running()); | 1538 CHECK(!message_loop()->is_running()); |
1533 // Perform the test in a callback, so that it runs after the message-loop | 1539 // Perform the test in a callback, so that it runs after the message-loop |
1534 // starts. | 1540 // starts. |
1535 message_loop()->PostTask(FROM_HERE, | 1541 message_loop()->PostTask(FROM_HERE, |
1536 base::Bind(&RootWindowTestWithMessageLoop::RunTest, | 1542 base::Bind(&RootWindowTestWithMessageLoop::RunTest, |
1537 base::Unretained(this))); | 1543 base::Unretained(this))); |
1538 message_loop()->Run(); | 1544 message_loop()->Run(); |
1539 } | 1545 } |
1540 | 1546 |
1541 } // namespace aura | 1547 } // namespace aura |
OLD | NEW |