Index: chrome_frame/test/chrome_frame_test_utils.h |
=================================================================== |
--- chrome_frame/test/chrome_frame_test_utils.h (revision 38776) |
+++ chrome_frame/test/chrome_frame_test_utils.h (working copy) |
@@ -22,36 +22,14 @@ |
#include "base/scoped_variant_win.h" |
#include "chrome_frame/test_utils.h" |
+#include "chrome_frame/test/simulate_input.h" |
// Include without path to make GYP build see it. |
#include "chrome_tab.h" // NOLINT |
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. |
-// The extended flag indicates if this is an extended key |
-void SendVirtualKey(int16 key, bool extended); |
- |
-// 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); |
@@ -72,26 +50,6 @@ |
extern const wchar_t kSafariImageName[]; |
extern const wchar_t kChromeImageName[]; |
-// Displays the chrome frame context menu by posting mouse move messages to |
-// Chrome |
-void ShowChromeFrameContextMenu(); |
- |
-// Sends keyboard messages to the chrome frame context menu to select the About |
-// Chrome frame option. |
-void SelectAboutChromeFrame(); |
- |
-// Returns a handle to the chrome frame render widget child window. |
-// Returns NULL on failure. |
-HWND GetChromeRendererWindow(); |
- |
-// Sends the specified input to the window passed in. |
-void SendInputToWindow(HWND window, const std::string& input_string); |
- |
-// Helper function to set keyboard focus to a window. This is achieved by |
-// sending a mouse move followed by a mouse down/mouse up combination to the |
-// window. |
-void SetKeyboardFocusToWindow(HWND window, int x, int y); |
- |
// Temporarily impersonate the current thread to low integrity for the lifetime |
// of the object. Destructor will automatically revert integrity level. |
class LowIntegrityToken { |
@@ -192,8 +150,15 @@ |
// Send keyboard input to the renderer window hosted in chrome using |
// SendInput API |
- void SendInputToChrome(const std::string& input_string); |
+ void SendKeys(const wchar_t* input_string); |
+ // Send mouse click to the renderer window hosted in chrome using |
+ // SendInput API |
+ void SendMouseClick(int x, int y, simulate_input::MouseButton button); |
+ |
+ void Exec(const GUID* cmd_group_guid, DWORD command_id, |
+ DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args); |
+ |
BEGIN_COM_MAP(WebBrowserEventSink) |
END_COM_MAP() |
@@ -247,7 +212,8 @@ |
// Chrome frame callbacks |
virtual void OnLoad(const wchar_t* url) {} |
virtual void OnLoadError(const wchar_t* url) {} |
- virtual void OnMessage(const wchar_t* message) {} |
+ virtual void OnMessage(const wchar_t* message, const wchar_t* origin, |
+ const wchar_t* source) {} |
IWebBrowser2* web_browser2() { |
return web_browser2_.get(); |
@@ -256,6 +222,7 @@ |
virtual void OnNewBrowserWindow(IDispatch* new_window, const wchar_t* url) {} |
HRESULT SetWebBrowser(IWebBrowser2* web_browser2); |
+ void ExpectRendererWindowHasfocus(); |
protected: |
STDMETHOD(OnBeforeNavigate2Internal)(IDispatch* dispatch, VARIANT* url, |
@@ -278,7 +245,7 @@ |
void ConnectToChromeFrame(); |
void DisconnectFromChromeFrame(); |
- HWND GetTabWindow(); |
+ HWND GetRendererWindow(); |
public: |
ScopedComPtr<IWebBrowser2> web_browser2_; |