| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 // Make sure no element is focused. | 607 // Make sure no element is focused. |
| 608 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); | 608 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); |
| 609 | 609 |
| 610 #if !defined(OS_MACOSX) | 610 #if !defined(OS_MACOSX) |
| 611 // Alt+D should move the focus to the location entry. | 611 // Alt+D should move the focus to the location entry. |
| 612 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAccessD)); | 612 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAccessD)); |
| 613 | 613 |
| 614 // TODO(isherman): This is an experimental change to help diagnose | 614 // TODO(isherman): This is an experimental change to help diagnose |
| 615 // http://crbug.com/55713 | 615 // http://crbug.com/55713 |
| 616 ui_test_utils::RunAllPendingInMessageLoop(); | 616 ui_test_utils::RunAllPendingInMessageLoop(); |
| 617 | 617 #if defined(USE_AURA) |
| 618 EXPECT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| 619 #else |
| 618 EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); | 620 EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); |
| 621 #endif |
| 619 // No element should be focused, as Alt+D was handled by the browser. | 622 // No element should be focused, as Alt+D was handled by the browser. |
| 620 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); | 623 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); |
| 621 | 624 |
| 622 // Move the focus back to the web page. | 625 // Move the focus back to the web page. |
| 623 ASSERT_NO_FATAL_FAILURE(ClickOnView(VIEW_ID_TAB_CONTAINER)); | 626 ASSERT_NO_FATAL_FAILURE(ClickOnView(VIEW_ID_TAB_CONTAINER)); |
| 624 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); | 627 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
| 625 | 628 |
| 626 // Make sure no element is focused. | 629 // Make sure no element is focused. |
| 627 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); | 630 EXPECT_NO_FATAL_FAILURE(CheckFocusedElement(tab_index, L"")); |
| 628 #endif | 631 #endif |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); | 855 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); |
| 853 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); | 856 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
| 854 | 857 |
| 855 // Ctrl+Alt should have no effect. | 858 // Ctrl+Alt should have no effect. |
| 856 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); | 859 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); |
| 857 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); | 860 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
| 858 } | 861 } |
| 859 #endif | 862 #endif |
| 860 | 863 |
| 861 } // namespace | 864 } // namespace |
| OLD | NEW |