OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
| 6 #define CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
| 7 |
| 8 #include <windows.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/process_util.h" |
| 12 |
| 13 namespace chrome_frame_test { |
| 14 |
| 15 bool IsTopLevelWindow(HWND window); |
| 16 int CloseVisibleWindowsOnAllThreads(HANDLE process); |
| 17 bool ForceSetForegroundWindow(HWND window); |
| 18 bool EnsureProcessInForeground(base::ProcessId process_id); |
| 19 |
| 20 // Iterates through all the characters in the string and simulates |
| 21 // keyboard input. The input goes to the currently active application. |
| 22 bool SendString(const wchar_t* s); |
| 23 |
| 24 // Sends a virtual key such as VK_TAB, VK_RETURN or a character that has been |
| 25 // translated to a virtual key. |
| 26 void SendVirtualKey(int16 key); |
| 27 |
| 28 // Translates a single char to a virtual key and calls SendVirtualKey. |
| 29 void SendChar(char c); |
| 30 |
| 31 // Sends an ascii string, char by char (calls SendChar for each). |
| 32 void SendString(const char* s); |
| 33 |
| 34 // Sends a keystroke to the currently active application with optional |
| 35 // modifiers set. |
| 36 bool SendMnemonic(WORD mnemonic_char, bool shift_pressed, bool control_pressed, |
| 37 bool alt_pressed); |
| 38 |
| 39 base::ProcessHandle LaunchFirefox(const std::wstring& url); |
| 40 base::ProcessHandle LaunchOpera(const std::wstring& url); |
| 41 base::ProcessHandle LaunchIE(const std::wstring& url); |
| 42 base::ProcessHandle LaunchSafari(const std::wstring& url); |
| 43 base::ProcessHandle LaunchChrome(const std::wstring& url); |
| 44 |
| 45 // Attempts to close all open IE windows. |
| 46 // The return value is the number of windows closed. |
| 47 // @note: this function requires COM to be initialized on the calling thread. |
| 48 // Since the caller might be running in either MTA or STA, the function does |
| 49 // not perform this initialization itself. |
| 50 int CloseAllIEWindows(); |
| 51 |
| 52 extern const wchar_t kIEImageName[]; |
| 53 extern const wchar_t kIEBrokerImageName[]; |
| 54 extern const wchar_t kFirefoxImageName[]; |
| 55 extern const wchar_t kOperaImageName[]; |
| 56 extern const wchar_t kSafariImageName[]; |
| 57 extern const wchar_t kChromeImageName[]; |
| 58 |
| 59 } // namespace chrome_frame_test |
| 60 |
| 61 #endif // CHROME_FRAME_CHROMETAB_UNITTESTS_CF_TEST_UTILS_H_ |
OLD | NEW |