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

Side by Side Diff: ui/chromeos/touch_exploration_controller_unittest.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 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 | « ui/chromeos/touch_exploration_controller.cc ('k') | ui/events/cocoa/events_mac.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/chromeos/touch_exploration_controller.h" 5 #include "ui/chromeos/touch_exploration_controller.h"
6 6
7 #include "base/test/simple_test_tick_clock.h" 7 #include "base/test/simple_test_tick_clock.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "ui/aura/client/cursor_client.h" 9 #include "ui/aura/client/cursor_client.h"
10 #include "ui/aura/test/aura_test_base.h" 10 #include "ui/aura/test/aura_test_base.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // TODO(mfomitchev): Need to investigate why we don't get mouse enter/exit 382 // TODO(mfomitchev): Need to investigate why we don't get mouse enter/exit
383 // events when running these tests as part of ui_unittests. We do get them when 383 // events when running these tests as part of ui_unittests. We do get them when
384 // the tests are run as part of ash unit tests. 384 // the tests are run as part of ash unit tests.
385 385
386 // If a swipe has been successfully completed, then six key events will be 386 // If a swipe has been successfully completed, then six key events will be
387 // dispatched that correspond to shift+search+direction 387 // dispatched that correspond to shift+search+direction
388 void AssertDirectionalNavigationEvents(const ScopedVector<ui::Event>& events, 388 void AssertDirectionalNavigationEvents(const ScopedVector<ui::Event>& events,
389 ui::KeyboardCode direction) { 389 ui::KeyboardCode direction) {
390 ASSERT_EQ(6U, events.size()); 390 ASSERT_EQ(6U, events.size());
391 ui::KeyEvent shift_pressed( 391 ui::KeyEvent shift_pressed(
392 ui::ET_KEY_PRESSED, ui::VKEY_SHIFT, ui::EF_SHIFT_DOWN, false); 392 ui::ET_KEY_PRESSED, ui::VKEY_SHIFT, ui::EF_SHIFT_DOWN);
393 ui::KeyEvent search_pressed( 393 ui::KeyEvent search_pressed(
394 ui::ET_KEY_PRESSED, ui::VKEY_LWIN, ui::EF_SHIFT_DOWN, false); 394 ui::ET_KEY_PRESSED, ui::VKEY_LWIN, ui::EF_SHIFT_DOWN);
395 ui::KeyEvent direction_pressed( 395 ui::KeyEvent direction_pressed(
396 ui::ET_KEY_PRESSED, direction, ui::EF_SHIFT_DOWN, false); 396 ui::ET_KEY_PRESSED, direction, ui::EF_SHIFT_DOWN);
397 ui::KeyEvent direction_released( 397 ui::KeyEvent direction_released(
398 ui::ET_KEY_RELEASED, direction, ui::EF_SHIFT_DOWN, false); 398 ui::ET_KEY_RELEASED, direction, ui::EF_SHIFT_DOWN);
399 ui::KeyEvent search_released( 399 ui::KeyEvent search_released(
400 ui::ET_KEY_RELEASED, VKEY_LWIN, ui::EF_SHIFT_DOWN, false); 400 ui::ET_KEY_RELEASED, VKEY_LWIN, ui::EF_SHIFT_DOWN);
401 ui::KeyEvent shift_released( 401 ui::KeyEvent shift_released(
402 ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, ui::EF_NONE, false); 402 ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, ui::EF_NONE);
403 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&shift_pressed, events[0]); 403 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&shift_pressed, events[0]);
404 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&search_pressed, events[1]); 404 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&search_pressed, events[1]);
405 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&direction_pressed, events[2]); 405 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&direction_pressed, events[2]);
406 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&direction_released, events[3]); 406 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&direction_released, events[3]);
407 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&search_released, events[4]); 407 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&search_released, events[4]);
408 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&shift_released, events[5]); 408 CONFIRM_EVENTS_ARE_KEY_AND_EQUAL(&shift_released, events[5]);
409 } 409 }
410 410
411 TEST_F(TouchExplorationTest, EntersTouchToMouseModeAfterPressAndDelay) { 411 TEST_F(TouchExplorationTest, EntersTouchToMouseModeAfterPressAndDelay) {
412 SwitchTouchExplorationMode(true); 412 SwitchTouchExplorationMode(true);
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 EXPECT_FALSE(IsInSlideGestureState()); 1628 EXPECT_FALSE(IsInSlideGestureState());
1629 EXPECT_FALSE(IsInTouchToMouseMode()); 1629 EXPECT_FALSE(IsInTouchToMouseMode());
1630 1630
1631 AdvanceSimulatedTimePastTapDelay(); 1631 AdvanceSimulatedTimePastTapDelay();
1632 EXPECT_FALSE(IsInGestureInProgressState()); 1632 EXPECT_FALSE(IsInGestureInProgressState());
1633 EXPECT_FALSE(IsInSlideGestureState()); 1633 EXPECT_FALSE(IsInSlideGestureState());
1634 EXPECT_TRUE(IsInTouchToMouseMode()); 1634 EXPECT_TRUE(IsInTouchToMouseMode());
1635 } 1635 }
1636 1636
1637 } // namespace ui 1637 } // namespace ui
OLDNEW
« no previous file with comments | « ui/chromeos/touch_exploration_controller.cc ('k') | ui/events/cocoa/events_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698