| OLD | NEW |
| 1 // Copyright (c) 2009 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_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ | 5 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
| 6 #define CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ | 6 #define CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <exdisp.h> | 11 #include <exdisp.h> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 #define QUIT_LOOP_SOON(loop, seconds) testing::InvokeWithoutArgs(\ | 109 #define QUIT_LOOP_SOON(loop, seconds) testing::InvokeWithoutArgs(\ |
| 110 CreateFunctor(&loop, &chrome_frame_test::TimedMsgLoop::QuitAfter, \ | 110 CreateFunctor(&loop, &chrome_frame_test::TimedMsgLoop::QuitAfter, \ |
| 111 seconds)) | 111 seconds)) |
| 112 | 112 |
| 113 // Launches IE as a COM server and returns the corresponding IWebBrowser2 | 113 // Launches IE as a COM server and returns the corresponding IWebBrowser2 |
| 114 // interface pointer. | 114 // interface pointer. |
| 115 // Returns S_OK on success. | 115 // Returns S_OK on success. |
| 116 HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser); | 116 HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser); |
| 117 | 117 |
| 118 FilePath GetProfilePath(const std::wstring& suffix); |
| 119 |
| 118 #ifndef DISPID_NEWPROCESS | 120 #ifndef DISPID_NEWPROCESS |
| 119 #define DISPID_NEWPROCESS 284 | 121 #define DISPID_NEWPROCESS 284 |
| 120 #endif // DISPID_NEWPROCESS | 122 #endif // DISPID_NEWPROCESS |
| 121 | 123 |
| 122 // This class sets up event sinks to the IWebBrowser interface. Currently it | 124 // This class sets up event sinks to the IWebBrowser interface. Currently it |
| 123 // subscribes to the following events:- | 125 // subscribes to the following events:- |
| 124 // 1. DISPID_BEFORENAVIGATE2 | 126 // 1. DISPID_BEFORENAVIGATE2 |
| 125 // 2. DISPID_NAVIGATEERROR | 127 // 2. DISPID_NAVIGATEERROR |
| 126 // 3. DISPID_NAVIGATECOMPLETE2 | 128 // 3. DISPID_NAVIGATECOMPLETE2 |
| 127 // 4. DISPID_NEWWINDOW3 | 129 // 4. DISPID_NEWWINDOW3 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 #endif // _DEBUG | 250 #endif // _DEBUG |
| 249 | 251 |
| 250 // Chrome frame callbacks | 252 // Chrome frame callbacks |
| 251 virtual void OnLoad(const wchar_t* url) {} | 253 virtual void OnLoad(const wchar_t* url) {} |
| 252 virtual void OnLoadError(const wchar_t* url) {} | 254 virtual void OnLoadError(const wchar_t* url) {} |
| 253 virtual void OnMessage(const wchar_t* message, const wchar_t* origin, | 255 virtual void OnMessage(const wchar_t* message, const wchar_t* origin, |
| 254 const wchar_t* source) {} | 256 const wchar_t* source) {} |
| 255 virtual void OnNewBrowserWindow(IDispatch* new_window, const wchar_t* url) {} | 257 virtual void OnNewBrowserWindow(IDispatch* new_window, const wchar_t* url) {} |
| 256 | 258 |
| 257 // Window watchdog override | 259 // Window watchdog override |
| 258 virtual void OnWindowDetected(HWND hwnd, const std::string& caption) {}; | 260 virtual void OnWindowDetected(HWND hwnd, const std::string& caption) {} |
| 259 | 261 |
| 260 IWebBrowser2* web_browser2() { | 262 IWebBrowser2* web_browser2() { |
| 261 return web_browser2_.get(); | 263 return web_browser2_.get(); |
| 262 } | 264 } |
| 263 | 265 |
| 264 HRESULT SetWebBrowser(IWebBrowser2* web_browser2); | 266 HRESULT SetWebBrowser(IWebBrowser2* web_browser2); |
| 265 void ExpectRendererWindowHasfocus(); | 267 void ExpectRendererWindowHasfocus(); |
| 266 | 268 |
| 267 // Closes the web browser in such a way that the OnQuit notification will | 269 // Closes the web browser in such a way that the OnQuit notification will |
| 268 // be fired when the window closes (async). | 270 // be fired when the window closes (async). |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 static _ATL_FUNC_INFO kVoidMethodInfo; | 315 static _ATL_FUNC_INFO kVoidMethodInfo; |
| 314 static _ATL_FUNC_INFO kDocumentCompleteInfo; | 316 static _ATL_FUNC_INFO kDocumentCompleteInfo; |
| 315 static _ATL_FUNC_INFO kFileDownloadInfo; | 317 static _ATL_FUNC_INFO kFileDownloadInfo; |
| 316 | 318 |
| 317 WindowWatchdog window_watcher_; | 319 WindowWatchdog window_watcher_; |
| 318 }; | 320 }; |
| 319 | 321 |
| 320 } // namespace chrome_frame_test | 322 } // namespace chrome_frame_test |
| 321 | 323 |
| 322 #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ | 324 #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
| OLD | NEW |