| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"D")); | 646 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"D")); |
| 647 | 647 |
| 648 // Blur the focused element. | 648 // Blur the focused element. |
| 649 EXPECT_NO_FATAL_FAILURE(SetFocusedElement(tab_index, L"")); | 649 EXPECT_NO_FATAL_FAILURE(SetFocusedElement(tab_index, L"")); |
| 650 // Make sure no element is focused. | 650 // Make sure no element is focused. |
| 651 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); | 651 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); |
| 652 #if !defined(USE_ASH) | 652 #if !defined(USE_ASH) |
| 653 // On Ash, alt-1..9 are assigned as window selection global accelerators, so | 653 // On Ash, alt-1..9 are assigned as window selection global accelerators, so |
| 654 // they can not be used as accesskeys. | 654 // they can not be used as accesskeys. |
| 655 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAccess1)); | 655 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAccess1)); |
| 656 #if defined(TOOLKIT_GTK) | |
| 657 // On GTK, alt-0..9 are assigned as tab selection accelerators, so they can | |
| 658 // not be used as accesskeys. | |
| 659 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); | |
| 660 #else | |
| 661 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"1")); | 656 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"1")); |
| 662 #endif | 657 #endif |
| 663 #endif | |
| 664 } | 658 } |
| 665 | 659 |
| 666 // Flaky, http://crbug.com/69475. | 660 // Flaky, http://crbug.com/69475. |
| 667 #if defined(OS_LINUX) || defined(OS_WIN) | 661 #if defined(OS_LINUX) || defined(OS_WIN) |
| 668 #define MAYBE_ReservedAccelerators DISABLED_ReservedAccelerators | 662 #define MAYBE_ReservedAccelerators DISABLED_ReservedAccelerators |
| 669 #else | 663 #else |
| 670 #define MAYBE_ReservedAccelerators ReservedAccelerators | 664 #define MAYBE_ReservedAccelerators ReservedAccelerators |
| 671 #endif | 665 #endif |
| 672 IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { | 666 IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { |
| 673 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 667 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); | 865 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); |
| 872 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 866 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
| 873 | 867 |
| 874 // Ctrl+Alt should have no effect. | 868 // Ctrl+Alt should have no effect. |
| 875 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); | 869 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); |
| 876 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 870 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
| 877 } | 871 } |
| 878 #endif | 872 #endif |
| 879 | 873 |
| 880 } // namespace | 874 } // namespace |
| OLD | NEW |