| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 | |
| 120 #ifndef DISPID_NEWPROCESS | 118 #ifndef DISPID_NEWPROCESS |
| 121 #define DISPID_NEWPROCESS 284 | 119 #define DISPID_NEWPROCESS 284 |
| 122 #endif // DISPID_NEWPROCESS | 120 #endif // DISPID_NEWPROCESS |
| 123 | 121 |
| 124 // This class sets up event sinks to the IWebBrowser interface. Currently it | 122 // This class sets up event sinks to the IWebBrowser interface. Currently it |
| 125 // subscribes to the following events:- | 123 // subscribes to the following events:- |
| 126 // 1. DISPID_BEFORENAVIGATE2 | 124 // 1. DISPID_BEFORENAVIGATE2 |
| 127 // 2. DISPID_NAVIGATEERROR | 125 // 2. DISPID_NAVIGATEERROR |
| 128 // 3. DISPID_NAVIGATECOMPLETE2 | 126 // 3. DISPID_NAVIGATECOMPLETE2 |
| 129 // 4. DISPID_NEWWINDOW3 | 127 // 4. DISPID_NEWWINDOW3 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 #endif // _DEBUG | 248 #endif // _DEBUG |
| 251 | 249 |
| 252 // Chrome frame callbacks | 250 // Chrome frame callbacks |
| 253 virtual void OnLoad(const wchar_t* url) {} | 251 virtual void OnLoad(const wchar_t* url) {} |
| 254 virtual void OnLoadError(const wchar_t* url) {} | 252 virtual void OnLoadError(const wchar_t* url) {} |
| 255 virtual void OnMessage(const wchar_t* message, const wchar_t* origin, | 253 virtual void OnMessage(const wchar_t* message, const wchar_t* origin, |
| 256 const wchar_t* source) {} | 254 const wchar_t* source) {} |
| 257 virtual void OnNewBrowserWindow(IDispatch* new_window, const wchar_t* url) {} | 255 virtual void OnNewBrowserWindow(IDispatch* new_window, const wchar_t* url) {} |
| 258 | 256 |
| 259 // Window watchdog override | 257 // Window watchdog override |
| 260 virtual void OnWindowDetected(HWND hwnd, const std::string& caption) {} | 258 virtual void OnWindowDetected(HWND hwnd, const std::string& caption) {}; |
| 261 | 259 |
| 262 IWebBrowser2* web_browser2() { | 260 IWebBrowser2* web_browser2() { |
| 263 return web_browser2_.get(); | 261 return web_browser2_.get(); |
| 264 } | 262 } |
| 265 | 263 |
| 266 HRESULT SetWebBrowser(IWebBrowser2* web_browser2); | 264 HRESULT SetWebBrowser(IWebBrowser2* web_browser2); |
| 267 void ExpectRendererWindowHasfocus(); | 265 void ExpectRendererWindowHasfocus(); |
| 268 | 266 |
| 269 // Closes the web browser in such a way that the OnQuit notification will | 267 // Closes the web browser in such a way that the OnQuit notification will |
| 270 // be fired when the window closes (async). | 268 // be fired when the window closes (async). |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 static _ATL_FUNC_INFO kVoidMethodInfo; | 313 static _ATL_FUNC_INFO kVoidMethodInfo; |
| 316 static _ATL_FUNC_INFO kDocumentCompleteInfo; | 314 static _ATL_FUNC_INFO kDocumentCompleteInfo; |
| 317 static _ATL_FUNC_INFO kFileDownloadInfo; | 315 static _ATL_FUNC_INFO kFileDownloadInfo; |
| 318 | 316 |
| 319 WindowWatchdog window_watcher_; | 317 WindowWatchdog window_watcher_; |
| 320 }; | 318 }; |
| 321 | 319 |
| 322 } // namespace chrome_frame_test | 320 } // namespace chrome_frame_test |
| 323 | 321 |
| 324 #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ | 322 #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
| OLD | NEW |