OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/keyboard_codes.h" | 8 #include "base/keyboard_codes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 BrowserWindow* window = browser()->window(); | 128 BrowserWindow* window = browser()->window(); |
129 ASSERT_TRUE(window); | 129 ASSERT_TRUE(window); |
130 *native_window = window->GetNativeHandle(); | 130 *native_window = window->GetNativeHandle(); |
131 ASSERT_TRUE(*native_window); | 131 ASSERT_TRUE(*native_window); |
132 } | 132 } |
133 | 133 |
134 void SendKey(base::KeyboardCode key, bool control, bool shift, bool alt) { | 134 void SendKey(base::KeyboardCode key, bool control, bool shift, bool alt) { |
135 gfx::NativeWindow window = NULL; | 135 gfx::NativeWindow window = NULL; |
136 ASSERT_NO_FATAL_FAILURE(GetNativeWindow(&window)); | 136 ASSERT_NO_FATAL_FAILURE(GetNativeWindow(&window)); |
137 EXPECT_TRUE(ui_controls::SendKeyPressNotifyWhenDone( | 137 EXPECT_TRUE(ui_controls::SendKeyPressNotifyWhenDone( |
138 window, key, control, shift, alt, new MessageLoop::QuitTask())); | 138 window, key, control, shift, alt, |
| 139 false /* command, */, |
| 140 new MessageLoop::QuitTask())); |
139 ui_test_utils::RunMessageLoop(); | 141 ui_test_utils::RunMessageLoop(); |
140 } | 142 } |
141 | 143 |
142 bool IsViewFocused(ViewID vid) { | 144 bool IsViewFocused(ViewID vid) { |
143 return ui_test_utils::IsViewFocused(browser(), vid); | 145 return ui_test_utils::IsViewFocused(browser(), vid); |
144 } | 146 } |
145 | 147 |
146 void ClickOnView(ViewID vid) { | 148 void ClickOnView(ViewID vid) { |
147 ui_test_utils::ClickOnView(browser(), vid); | 149 ui_test_utils::ClickOnView(browser(), vid); |
148 } | 150 } |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 ASSERT_EQ(0, browser()->selected_index()); | 643 ASSERT_EQ(0, browser()->selected_index()); |
642 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(0, kTestCtrlWBlocked)); | 644 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(0, kTestCtrlWBlocked)); |
643 ASSERT_EQ(2, browser()->tab_count()); | 645 ASSERT_EQ(2, browser()->tab_count()); |
644 | 646 |
645 // Ctrl+F4 to close the tab. | 647 // Ctrl+F4 to close the tab. |
646 ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(0, true)); | 648 ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(0, true)); |
647 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_F4, true, false, false)); | 649 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_F4, true, false, false)); |
648 ASSERT_EQ(1, browser()->tab_count()); | 650 ASSERT_EQ(1, browser()->tab_count()); |
649 #endif | 651 #endif |
650 } | 652 } |
OLD | NEW |