Index: chrome_frame/test/chrome_frame_test_utils.h |
=================================================================== |
--- chrome_frame/test/chrome_frame_test_utils.h (revision 0) |
+++ chrome_frame/test/chrome_frame_test_utils.h (revision 0) |
@@ -0,0 +1,61 @@ |
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
+#define CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
+ |
+#include <windows.h> |
+ |
+#include "base/basictypes.h" |
+#include "base/process_util.h" |
+ |
+namespace chrome_frame_test { |
+ |
+bool IsTopLevelWindow(HWND window); |
+int CloseVisibleWindowsOnAllThreads(HANDLE process); |
+bool ForceSetForegroundWindow(HWND window); |
+bool EnsureProcessInForeground(base::ProcessId process_id); |
+ |
+// Iterates through all the characters in the string and simulates |
+// keyboard input. The input goes to the currently active application. |
+bool SendString(const wchar_t* s); |
+ |
+// Sends a virtual key such as VK_TAB, VK_RETURN or a character that has been |
+// translated to a virtual key. |
+void SendVirtualKey(int16 key); |
+ |
+// Translates a single char to a virtual key and calls SendVirtualKey. |
+void SendChar(char c); |
+ |
+// Sends an ascii string, char by char (calls SendChar for each). |
+void SendString(const char* s); |
+ |
+// Sends a keystroke to the currently active application with optional |
+// modifiers set. |
+bool SendMnemonic(WORD mnemonic_char, bool shift_pressed, bool control_pressed, |
+ bool alt_pressed); |
+ |
+base::ProcessHandle LaunchFirefox(const std::wstring& url); |
+base::ProcessHandle LaunchOpera(const std::wstring& url); |
+base::ProcessHandle LaunchIE(const std::wstring& url); |
+base::ProcessHandle LaunchSafari(const std::wstring& url); |
+base::ProcessHandle LaunchChrome(const std::wstring& url); |
+ |
+// Attempts to close all open IE windows. |
+// The return value is the number of windows closed. |
+// @note: this function requires COM to be initialized on the calling thread. |
+// Since the caller might be running in either MTA or STA, the function does |
+// not perform this initialization itself. |
+int CloseAllIEWindows(); |
+ |
+extern const wchar_t kIEImageName[]; |
+extern const wchar_t kIEBrokerImageName[]; |
+extern const wchar_t kFirefoxImageName[]; |
+extern const wchar_t kOperaImageName[]; |
+extern const wchar_t kSafariImageName[]; |
+extern const wchar_t kChromeImageName[]; |
+ |
+} // namespace chrome_frame_test |
+ |
+#endif // CHROME_FRAME_CHROMETAB_UNITTESTS_CF_TEST_UTILS_H_ |