OLD | NEW |
1 // Copyright (c) 2009 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> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); | 123 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); |
124 } | 124 } |
125 | 125 |
126 void QuitAfter(int seconds) { | 126 void QuitAfter(int seconds) { |
127 loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 1000 * seconds); | 127 loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 1000 * seconds); |
128 } | 128 } |
129 | 129 |
130 MessageLoopForUI loop_; | 130 MessageLoopForUI loop_; |
131 }; | 131 }; |
132 | 132 |
| 133 // Saves typing. It's somewhat hard to create a wrapper around |
| 134 // testing::InvokeWithoutArgs since it returns a |
| 135 // non-public (testing::internal) type. |
| 136 #define QUIT_LOOP(loop) testing::InvokeWithoutArgs(\ |
| 137 CreateFunctor(&loop, &chrome_frame_test::TimedMsgLoop::Quit)) |
| 138 |
| 139 #define QUIT_LOOP_SOON(loop, seconds) testing::InvokeWithoutArgs(\ |
| 140 CreateFunctor(&loop, &chrome_frame_test::TimedMsgLoop::QuitAfter, \ |
| 141 seconds)) |
| 142 |
133 // Launches IE as a COM server and returns the corresponding IWebBrowser2 | 143 // Launches IE as a COM server and returns the corresponding IWebBrowser2 |
134 // interface pointer. | 144 // interface pointer. |
135 // Returns S_OK on success. | 145 // Returns S_OK on success. |
136 HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser); | 146 HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser); |
137 | 147 |
138 #ifndef DISPID_NEWPROCESS | 148 #ifndef DISPID_NEWPROCESS |
139 #define DISPID_NEWPROCESS 284 | 149 #define DISPID_NEWPROCESS 284 |
140 #endif // DISPID_NEWPROCESS | 150 #endif // DISPID_NEWPROCESS |
141 | 151 |
142 // This class sets up event sinks to the IWebBrowser interface. Currently it | 152 // This class sets up event sinks to the IWebBrowser interface. Currently it |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 static _ATL_FUNC_INFO kNavigateComplete2Info; | 284 static _ATL_FUNC_INFO kNavigateComplete2Info; |
275 static _ATL_FUNC_INFO kNavigateErrorInfo; | 285 static _ATL_FUNC_INFO kNavigateErrorInfo; |
276 static _ATL_FUNC_INFO kNewWindow3Info; | 286 static _ATL_FUNC_INFO kNewWindow3Info; |
277 static _ATL_FUNC_INFO kVoidMethodInfo; | 287 static _ATL_FUNC_INFO kVoidMethodInfo; |
278 static _ATL_FUNC_INFO kDocumentCompleteInfo; | 288 static _ATL_FUNC_INFO kDocumentCompleteInfo; |
279 }; | 289 }; |
280 | 290 |
281 } // namespace chrome_frame_test | 291 } // namespace chrome_frame_test |
282 | 292 |
283 #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ | 293 #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |
OLD | NEW |