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.h" | 9 #include "base/message_loop.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 private: | 121 private: |
122 bool finished_; | 122 bool finished_; |
123 bool waiting_; | 123 bool waiting_; |
124 content::NotificationRegistrar registrar_; | 124 content::NotificationRegistrar registrar_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); | 126 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); |
127 }; | 127 }; |
128 | 128 |
129 class BrowserKeyEventsTest : public InProcessBrowserTest { | 129 class BrowserKeyEventsTest : public InProcessBrowserTest { |
130 public: | 130 public: |
131 BrowserKeyEventsTest() { | 131 BrowserKeyEventsTest() {} |
132 EnableDOMAutomation(); | |
133 } | |
134 | 132 |
135 bool IsViewFocused(ViewID vid) { | 133 bool IsViewFocused(ViewID vid) { |
136 return ui_test_utils::IsViewFocused(browser(), vid); | 134 return ui_test_utils::IsViewFocused(browser(), vid); |
137 } | 135 } |
138 | 136 |
139 void ClickOnView(ViewID vid) { | 137 void ClickOnView(ViewID vid) { |
140 ui_test_utils::ClickOnView(browser(), vid); | 138 ui_test_utils::ClickOnView(browser(), vid); |
141 } | 139 } |
142 | 140 |
143 // Set the suppress flag of an event specified by |type|. If |suppress| is | 141 // Set the suppress flag of an event specified by |type|. If |suppress| is |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); | 881 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); |
884 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 882 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
885 | 883 |
886 // Ctrl+Alt should have no effect. | 884 // Ctrl+Alt should have no effect. |
887 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); | 885 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); |
888 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 886 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
889 } | 887 } |
890 #endif | 888 #endif |
891 | 889 |
892 } // namespace | 890 } // namespace |
OLD | NEW |