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 #ifndef CHROME_TEST_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_UI_TEST_UTILS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <set> | 11 #include <set> |
12 | 12 |
| 13 #include "app/keyboard_codes.h" |
13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
14 #include "base/keyboard_codes.h" | |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/scoped_temp_dir.h" | 16 #include "base/scoped_temp_dir.h" |
17 #include "base/string16.h" | 17 #include "base/string16.h" |
18 #include "chrome/browser/view_ids.h" | 18 #include "chrome/browser/view_ids.h" |
19 #include "chrome/common/notification_observer.h" | 19 #include "chrome/common/notification_observer.h" |
20 #include "chrome/common/notification_registrar.h" | 20 #include "chrome/common/notification_registrar.h" |
21 #include "chrome/common/notification_type.h" | 21 #include "chrome/common/notification_type.h" |
22 #include "chrome/common/notification_service.h" | 22 #include "chrome/common/notification_service.h" |
23 #include "chrome/test/automation/dom_element_proxy.h" | 23 #include "chrome/test/automation/dom_element_proxy.h" |
24 #include "gfx/native_widget_types.h" | 24 #include "gfx/native_widget_types.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 NotificationType::Type type, | 186 NotificationType::Type type, |
187 const NotificationSource& source); | 187 const NotificationSource& source); |
188 | 188 |
189 // Blocks until |model| finishes loading. | 189 // Blocks until |model| finishes loading. |
190 void WaitForBookmarkModelToLoad(BookmarkModel* model); | 190 void WaitForBookmarkModelToLoad(BookmarkModel* model); |
191 | 191 |
192 // Sends a key press blocking until the key press is received or the test times | 192 // Sends a key press blocking until the key press is received or the test times |
193 // out. This uses ui_controls::SendKeyPress, see it for details. Returns true | 193 // out. This uses ui_controls::SendKeyPress, see it for details. Returns true |
194 // if the event was successfully sent and received. | 194 // if the event was successfully sent and received. |
195 bool SendKeyPressSync(gfx::NativeWindow window, | 195 bool SendKeyPressSync(gfx::NativeWindow window, |
196 base::KeyboardCode key, | 196 app::KeyboardCode key, |
197 bool control, | 197 bool control, |
198 bool shift, | 198 bool shift, |
199 bool alt, | 199 bool alt, |
200 bool command) WARN_UNUSED_RESULT; | 200 bool command) WARN_UNUSED_RESULT; |
201 | 201 |
202 // Run a message loop only for the specified amount of time. | 202 // Run a message loop only for the specified amount of time. |
203 class TimedMessageLoopRunner { | 203 class TimedMessageLoopRunner { |
204 public: | 204 public: |
205 // Create new MessageLoopForUI and attach to it. | 205 // Create new MessageLoopForUI and attach to it. |
206 TimedMessageLoopRunner(); | 206 TimedMessageLoopRunner(); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 // Hide a native window. | 432 // Hide a native window. |
433 void HideNativeWindow(gfx::NativeWindow window); | 433 void HideNativeWindow(gfx::NativeWindow window); |
434 | 434 |
435 // Show and focus a native window. | 435 // Show and focus a native window. |
436 void ShowAndFocusNativeWindow(gfx::NativeWindow window); | 436 void ShowAndFocusNativeWindow(gfx::NativeWindow window); |
437 | 437 |
438 } // namespace ui_test_utils | 438 } // namespace ui_test_utils |
439 | 439 |
440 #endif // CHROME_TEST_UI_TEST_UTILS_H_ | 440 #endif // CHROME_TEST_UI_TEST_UTILS_H_ |
OLD | NEW |