| 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 "chrome/test/base/interactive_test_utils.h" | 5 #include "chrome/test/base/interactive_test_utils.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return *native_window; | 21 return *native_window; |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 bool BringBrowserWindowToFront(const Browser* browser) { | 26 bool BringBrowserWindowToFront(const Browser* browser) { |
| 27 gfx::NativeWindow window = NULL; | 27 gfx::NativeWindow window = NULL; |
| 28 if (!GetNativeWindow(browser, &window)) | 28 if (!GetNativeWindow(browser, &window)) |
| 29 return false; | 29 return false; |
| 30 | 30 |
| 31 return ui_test_utils::ShowAndFocusNativeWindow(window); | 31 if (!ShowAndFocusNativeWindow(window)) |
| 32 return false; |
| 33 |
| 34 BrowserActivationWaiter waiter(browser); |
| 35 waiter.WaitForActivation(); |
| 36 return true; |
| 32 } | 37 } |
| 33 | 38 |
| 34 bool SendKeyPressSync(const Browser* browser, | 39 bool SendKeyPressSync(const Browser* browser, |
| 35 ui::KeyboardCode key, | 40 ui::KeyboardCode key, |
| 36 bool control, | 41 bool control, |
| 37 bool shift, | 42 bool shift, |
| 38 bool alt, | 43 bool alt, |
| 39 bool command) { | 44 bool command) { |
| 40 gfx::NativeWindow window = NULL; | 45 gfx::NativeWindow window = NULL; |
| 41 if (!GetNativeWindow(browser, &window)) | 46 if (!GetNativeWindow(browser, &window)) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 const base::Closure& followup) { | 123 const base::Closure& followup) { |
| 119 if (!followup.is_null()) | 124 if (!followup.is_null()) |
| 120 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); | 125 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); |
| 121 else | 126 else |
| 122 ui_controls::SendMouseEvents(button, state); | 127 ui_controls::SendMouseEvents(button, state); |
| 123 } | 128 } |
| 124 | 129 |
| 125 } // namespace internal | 130 } // namespace internal |
| 126 | 131 |
| 127 } // namespace ui_test_utils | 132 } // namespace ui_test_utils |
| OLD | NEW |