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

Side by Side Diff: chrome/browser/chromeos/events/event_rewriter_unittest.cc

Issue 653423004: Suppress Xorg generated key repeat events for Hotrod remote (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 6 years, 2 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 | « chrome/browser/chromeos/events/event_rewriter.cc ('k') | no next file » | 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 "chrome/browser/chromeos/events/event_rewriter.h" 5 #include "chrome/browser/chromeos/events/event_rewriter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/sticky_keys/sticky_keys_controller.h" 10 #include "ash/sticky_keys/sticky_keys_controller.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 for (size_t i = 0; i < arraysize(apple_keyboard_tests); ++i) { 383 for (size_t i = 0; i < arraysize(apple_keyboard_tests); ++i) {
384 SCOPED_TRACE(i); 384 SCOPED_TRACE(i);
385 CheckKeyTestCase(&rewriter, apple_keyboard_tests[i]); 385 CheckKeyTestCase(&rewriter, apple_keyboard_tests[i]);
386 } 386 }
387 } 387 }
388 388
389 void EventRewriterTest::TestRewriteNumPadKeys() { 389 void EventRewriterTest::TestRewriteNumPadKeys() {
390 TestingPrefServiceSyncable prefs; 390 TestingPrefServiceSyncable prefs;
391 EventRewriter rewriter(NULL); 391 EventRewriter rewriter(NULL);
392 rewriter.KeyboardDeviceAddedForTesting(kKeyboardDeviceId, "PC Keyboard");
392 rewriter.set_last_keyboard_device_id_for_testing(kKeyboardDeviceId); 393 rewriter.set_last_keyboard_device_id_for_testing(kKeyboardDeviceId);
393 rewriter.set_pref_service_for_testing(&prefs); 394 rewriter.set_pref_service_for_testing(&prefs);
394 395
395 KeyTestCase tests[] = { 396 KeyTestCase tests[] = {
396 // XK_KP_Insert (= NumPad 0 without Num Lock), no modifier. 397 // XK_KP_Insert (= NumPad 0 without Num Lock), no modifier.
397 {KeyTestCase::TEST_ALL|KeyTestCase::NUMPAD, ui::ET_KEY_PRESSED, 398 {KeyTestCase::TEST_ALL|KeyTestCase::NUMPAD, ui::ET_KEY_PRESSED,
398 {ui::VKEY_INSERT, ui::EF_NUMPAD_KEY}, 399 {ui::VKEY_INSERT, ui::EF_NUMPAD_KEY},
399 {ui::VKEY_NUMPAD0, ui::EF_NUMPAD_KEY}}, 400 {ui::VKEY_NUMPAD0, ui::EF_NUMPAD_KEY}},
400 401
401 // XK_KP_Insert (= NumPad 0 without Num Lock), Alt modifier. 402 // XK_KP_Insert (= NumPad 0 without Num Lock), Alt modifier.
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 EXPECT_FALSE(overlay_->GetModifierVisible(ui::EF_ALTGR_DOWN)); 2487 EXPECT_FALSE(overlay_->GetModifierVisible(ui::EF_ALTGR_DOWN));
2487 EXPECT_TRUE(overlay_->GetModifierVisible(ui::EF_MOD3_DOWN)); 2488 EXPECT_TRUE(overlay_->GetModifierVisible(ui::EF_MOD3_DOWN));
2488 2489
2489 // Turn off AltGr and Mod3. 2490 // Turn off AltGr and Mod3.
2490 sticky_keys_controller_->SetModifiersEnabled(false, false); 2491 sticky_keys_controller_->SetModifiersEnabled(false, false);
2491 EXPECT_FALSE(overlay_->GetModifierVisible(ui::EF_ALTGR_DOWN)); 2492 EXPECT_FALSE(overlay_->GetModifierVisible(ui::EF_ALTGR_DOWN));
2492 EXPECT_FALSE(overlay_->GetModifierVisible(ui::EF_MOD3_DOWN)); 2493 EXPECT_FALSE(overlay_->GetModifierVisible(ui::EF_MOD3_DOWN));
2493 } 2494 }
2494 2495
2495 } // namespace chromeos 2496 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/events/event_rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698