| OLD | NEW |
| 1 // Copyright (c) 2010 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 #include "chrome_frame/test/automation_client_mock.h" | 4 #include "chrome_frame/test/automation_client_mock.h" |
| 5 | 5 |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
| 8 #include "chrome_frame/custom_sync_call_context.h" | 8 #include "chrome_frame/custom_sync_call_context.h" |
| 9 #include "chrome_frame/test/chrome_frame_test_utils.h" | 9 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 10 | 10 |
| 11 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 11 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 12 #include "testing/gmock_mutant.h" | 12 #include "testing/gmock_mutant.h" |
| 13 | 13 |
| 14 using testing::_; | 14 using testing::_; |
| 15 using testing::CreateFunctor; | 15 using testing::CreateFunctor; |
| 16 using testing::Return; | 16 using testing::Return; |
| 17 | 17 |
| 18 DISABLE_RUNNABLE_METHOD_REFCOUNT(ProxyFactory::LaunchDelegate); | 18 DISABLE_RUNNABLE_METHOD_REFCOUNT(LaunchDelegate); |
| 19 DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeFrameAutomationClient); | 19 DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeFrameAutomationClient); |
| 20 DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_frame_test::TimedMsgLoop); | 20 DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_frame_test::TimedMsgLoop); |
| 21 | 21 |
| 22 MATCHER_P(LaunchParamProfileEq, profile_name, "Check for profile name") { |
| 23 return arg->profile_name().compare(profile_name) == 0; |
| 24 } |
| 25 |
| 22 void MockProxyFactory::GetServerImpl(ChromeFrameAutomationProxy* pxy, | 26 void MockProxyFactory::GetServerImpl(ChromeFrameAutomationProxy* pxy, |
| 23 void* proxy_id, | 27 void* proxy_id, |
| 24 AutomationLaunchResult result, | 28 AutomationLaunchResult result, |
| 25 LaunchDelegate* d, | 29 LaunchDelegate* d, |
| 26 const ChromeFrameLaunchParams& params, | 30 ChromeFrameLaunchParams* params, |
| 27 void** automation_server_id) { | 31 void** automation_server_id) { |
| 28 *automation_server_id = proxy_id; | 32 *automation_server_id = proxy_id; |
| 29 Task* task = NewRunnableMethod(d, | 33 Task* task = NewRunnableMethod(d, |
| 30 &ProxyFactory::LaunchDelegate::LaunchComplete, pxy, result); | 34 &LaunchDelegate::LaunchComplete, pxy, result); |
| 31 loop_->PostDelayedTask(FROM_HERE, task, | 35 loop_->PostDelayedTask(FROM_HERE, task, |
| 32 params.automation_server_launch_timeout/2); | 36 params->launch_timeout() / 2); |
| 33 } | 37 } |
| 34 | 38 |
| 35 void CFACMockTest::SetAutomationServerOk(int times) { | 39 void CFACMockTest::SetAutomationServerOk(int times) { |
| 36 EXPECT_CALL(factory_, GetAutomationServer(testing::NotNull(), | 40 EXPECT_CALL(factory_, GetAutomationServer(testing::NotNull(), |
| 37 testing::Field(&ChromeFrameLaunchParams::profile_name, | 41 LaunchParamProfileEq(profile_path_.BaseName().value()), |
| 38 testing::StrEq(profile_path_.BaseName().value())), | 42 testing::NotNull())) |
| 39 testing::NotNull())) | |
| 40 .Times(times) | 43 .Times(times) |
| 41 .WillRepeatedly(testing::Invoke(CreateFunctor(&factory_, | 44 .WillRepeatedly(testing::Invoke(CreateFunctor(&factory_, |
| 42 &MockProxyFactory::GetServerImpl, get_proxy(), id_, | 45 &MockProxyFactory::GetServerImpl, get_proxy(), id_, |
| 43 AUTOMATION_SUCCESS))); | 46 AUTOMATION_SUCCESS))); |
| 44 | 47 |
| 45 EXPECT_CALL(factory_, ReleaseAutomationServer(testing::Eq(id_))).Times(times); | 48 EXPECT_CALL(factory_, |
| 49 ReleaseAutomationServer(testing::Eq(id_), testing::NotNull())) |
| 50 .Times(times); |
| 46 } | 51 } |
| 47 | 52 |
| 48 void CFACMockTest::Set_CFD_LaunchFailed(AutomationLaunchResult result) { | 53 void CFACMockTest::Set_CFD_LaunchFailed(AutomationLaunchResult result) { |
| 49 EXPECT_CALL(cfd_, OnAutomationServerLaunchFailed(testing::Eq(result), | 54 EXPECT_CALL(cfd_, OnAutomationServerLaunchFailed(testing::Eq(result), |
| 50 testing::_)) | 55 testing::_)) |
| 51 .Times(1) | 56 .Times(1) |
| 52 .WillOnce(QUIT_LOOP(loop_)); | 57 .WillOnce(QUIT_LOOP(loop_)); |
| 53 } | 58 } |
| 54 | 59 |
| 55 MATCHER_P(MsgType, msg_type, "IPC::Message::type()") { | 60 MATCHER_P(MsgType, msg_type, "IPC::Message::type()") { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 86 const FilePath profile_path( | 91 const FilePath profile_path( |
| 87 chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); | 92 chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); |
| 88 | 93 |
| 89 scoped_refptr<ChromeFrameAutomationClient> client; | 94 scoped_refptr<ChromeFrameAutomationClient> client; |
| 90 client = new ChromeFrameAutomationClient(); | 95 client = new ChromeFrameAutomationClient(); |
| 91 | 96 |
| 92 EXPECT_CALL(cfd, OnAutomationServerLaunchFailed(AUTOMATION_TIMEOUT, _)) | 97 EXPECT_CALL(cfd, OnAutomationServerLaunchFailed(AUTOMATION_TIMEOUT, _)) |
| 93 .Times(1) | 98 .Times(1) |
| 94 .WillOnce(QUIT_LOOP(loop)); | 99 .WillOnce(QUIT_LOOP(loop)); |
| 95 | 100 |
| 96 ChromeFrameLaunchParams clp = { | 101 GURL empty; |
| 97 timeout, | 102 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 98 GURL(), | 103 empty, empty, profile_path, profile_path.BaseName().value(), L"", |
| 99 GURL(), | 104 false, false)); |
| 100 profile_path, | 105 clp->set_launch_timeout(timeout); |
| 101 profile_path.BaseName().value(), | 106 clp->set_version_check(false); |
| 102 L"", | |
| 103 false, | |
| 104 false, | |
| 105 false | |
| 106 }; | |
| 107 EXPECT_TRUE(client->Initialize(&cfd, clp)); | 107 EXPECT_TRUE(client->Initialize(&cfd, clp)); |
| 108 loop.RunFor(10); | 108 loop.RunFor(10); |
| 109 client->Uninitialize(); | 109 client->Uninitialize(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // This test may fail if Chrome take more that 10 seconds (timeout var) to | 112 // This test may fail if Chrome take more that 10 seconds (timeout var) to |
| 113 // launch. In this case GMock shall print something like "unexpected call to | 113 // launch. In this case GMock shall print something like "unexpected call to |
| 114 // OnAutomationServerLaunchFailed". I'm yet to find out how to specify | 114 // OnAutomationServerLaunchFailed". I'm yet to find out how to specify |
| 115 // that this is an unexpected call, and still to execute an action. | 115 // that this is an unexpected call, and still to execute an action. |
| 116 TEST(CFACWithChrome, CreateNotSoFast) { | 116 TEST(CFACWithChrome, CreateNotSoFast) { |
| 117 MockCFDelegate cfd; | 117 MockCFDelegate cfd; |
| 118 chrome_frame_test::TimedMsgLoop loop; | 118 chrome_frame_test::TimedMsgLoop loop; |
| 119 const FilePath profile_path( | 119 const FilePath profile_path( |
| 120 chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); | 120 chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); |
| 121 int timeout = 10000; | 121 int timeout = 10000; |
| 122 | 122 |
| 123 scoped_refptr<ChromeFrameAutomationClient> client; | 123 scoped_refptr<ChromeFrameAutomationClient> client; |
| 124 client = new ChromeFrameAutomationClient; | 124 client = new ChromeFrameAutomationClient; |
| 125 | 125 |
| 126 EXPECT_CALL(cfd, OnAutomationServerReady()) | 126 EXPECT_CALL(cfd, OnAutomationServerReady()) |
| 127 .Times(1) | 127 .Times(1) |
| 128 .WillOnce(QUIT_LOOP(loop)); | 128 .WillOnce(QUIT_LOOP(loop)); |
| 129 | 129 |
| 130 EXPECT_CALL(cfd, OnAutomationServerLaunchFailed(_, _)) | 130 EXPECT_CALL(cfd, OnAutomationServerLaunchFailed(_, _)) |
| 131 .Times(0); | 131 .Times(0); |
| 132 | 132 |
| 133 ChromeFrameLaunchParams clp = { | 133 GURL empty; |
| 134 timeout, | 134 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 135 GURL(), | 135 empty, empty, profile_path, profile_path.BaseName().value(), L"", |
| 136 GURL(), | 136 false, false)); |
| 137 profile_path, | 137 clp->set_launch_timeout(timeout); |
| 138 profile_path.BaseName().value(), | 138 clp->set_version_check(false); |
| 139 L"", | |
| 140 false, | |
| 141 false, | |
| 142 false | |
| 143 }; | |
| 144 EXPECT_TRUE(client->Initialize(&cfd, clp)); | 139 EXPECT_TRUE(client->Initialize(&cfd, clp)); |
| 145 | 140 |
| 146 loop.RunFor(11); | 141 loop.RunFor(11); |
| 147 client->Uninitialize(); | 142 client->Uninitialize(); |
| 148 client = NULL; | 143 client = NULL; |
| 149 } | 144 } |
| 150 | 145 |
| 151 TEST(CFACWithChrome, NavigateOk) { | 146 TEST(CFACWithChrome, NavigateOk) { |
| 152 MockCFDelegate cfd; | 147 MockCFDelegate cfd; |
| 153 chrome_frame_test::TimedMsgLoop loop; | 148 chrome_frame_test::TimedMsgLoop loop; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 175 EXPECT_CALL(cfd, OnDidNavigate(_, EqNavigationInfoUrl(GURL()))) | 170 EXPECT_CALL(cfd, OnDidNavigate(_, EqNavigationInfoUrl(GURL()))) |
| 176 .Times(1); | 171 .Times(1); |
| 177 | 172 |
| 178 EXPECT_CALL(cfd, OnUpdateTargetUrl(_, _)).Times(testing::AtMost(1)); | 173 EXPECT_CALL(cfd, OnUpdateTargetUrl(_, _)).Times(testing::AtMost(1)); |
| 179 | 174 |
| 180 EXPECT_CALL(cfd, OnLoad(_, _)) | 175 EXPECT_CALL(cfd, OnLoad(_, _)) |
| 181 .Times(1) | 176 .Times(1) |
| 182 .WillOnce(QUIT_LOOP(loop)); | 177 .WillOnce(QUIT_LOOP(loop)); |
| 183 } | 178 } |
| 184 | 179 |
| 185 ChromeFrameLaunchParams clp = { | 180 GURL empty; |
| 186 timeout, | 181 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 187 GURL(), | 182 empty, empty, profile_path, profile_path.BaseName().value(), L"", |
| 188 GURL(), | 183 false, false)); |
| 189 profile_path, | 184 clp->set_launch_timeout(timeout); |
| 190 profile_path.BaseName().value(), | 185 clp->set_version_check(false); |
| 191 L"", | |
| 192 false, | |
| 193 false, | |
| 194 false | |
| 195 }; | |
| 196 EXPECT_TRUE(client->Initialize(&cfd, clp)); | 186 EXPECT_TRUE(client->Initialize(&cfd, clp)); |
| 197 loop.RunFor(10); | 187 loop.RunFor(10); |
| 198 client->Uninitialize(); | 188 client->Uninitialize(); |
| 199 client = NULL; | 189 client = NULL; |
| 200 } | 190 } |
| 201 | 191 |
| 202 TEST(CFACWithChrome, NavigateFailed) { | 192 TEST(CFACWithChrome, NavigateFailed) { |
| 203 MockCFDelegate cfd; | 193 MockCFDelegate cfd; |
| 204 chrome_frame_test::TimedMsgLoop loop; | 194 chrome_frame_test::TimedMsgLoop loop; |
| 205 const FilePath profile_path( | 195 const FilePath profile_path( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 226 .WillRepeatedly(testing::WithArgs<1>(testing::Invoke(CreateFunctor(&cfd, | 216 .WillRepeatedly(testing::WithArgs<1>(testing::Invoke(CreateFunctor(&cfd, |
| 227 &MockCFDelegate::Reply, connection_failed)))); | 217 &MockCFDelegate::Reply, connection_failed)))); |
| 228 | 218 |
| 229 EXPECT_CALL(cfd, OnUpdateTargetUrl(_, _)).Times(testing::AnyNumber()); | 219 EXPECT_CALL(cfd, OnUpdateTargetUrl(_, _)).Times(testing::AnyNumber()); |
| 230 EXPECT_CALL(cfd, OnLoad(_, _)).Times(testing::AtMost(1)); | 220 EXPECT_CALL(cfd, OnLoad(_, _)).Times(testing::AtMost(1)); |
| 231 | 221 |
| 232 EXPECT_CALL(cfd, OnNavigationFailed(_, _, GURL(url))) | 222 EXPECT_CALL(cfd, OnNavigationFailed(_, _, GURL(url))) |
| 233 .Times(1) | 223 .Times(1) |
| 234 .WillOnce(QUIT_LOOP_SOON(loop, 2)); | 224 .WillOnce(QUIT_LOOP_SOON(loop, 2)); |
| 235 | 225 |
| 236 ChromeFrameLaunchParams clp = { | 226 GURL empty; |
| 237 10000, | 227 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 238 GURL(), | 228 empty, empty, profile_path, profile_path.BaseName().value(), L"", |
| 239 GURL(), | 229 false, false)); |
| 240 profile_path, | 230 clp->set_launch_timeout(10000); |
| 241 profile_path.BaseName().value(), | 231 clp->set_version_check(false); |
| 242 L"", | |
| 243 false, | |
| 244 false, | |
| 245 false | |
| 246 }; | |
| 247 EXPECT_TRUE(client->Initialize(&cfd, clp)); | 232 EXPECT_TRUE(client->Initialize(&cfd, clp)); |
| 248 | 233 |
| 249 loop.RunFor(10); | 234 loop.RunFor(10); |
| 250 client->Uninitialize(); | 235 client->Uninitialize(); |
| 251 client = NULL; | 236 client = NULL; |
| 252 } | 237 } |
| 253 | 238 |
| 254 TEST_F(CFACMockTest, MockedCreateTabOk) { | 239 TEST_F(CFACMockTest, MockedCreateTabOk) { |
| 255 int timeout = 500; | 240 int timeout = 500; |
| 256 CreateTab(); | 241 CreateTab(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 269 | 254 |
| 270 EXPECT_CALL(mock_proxy_, CreateTabProxy(testing::Eq(tab_handle_))) | 255 EXPECT_CALL(mock_proxy_, CreateTabProxy(testing::Eq(tab_handle_))) |
| 271 .WillOnce(Return(tab_)); | 256 .WillOnce(Return(tab_)); |
| 272 | 257 |
| 273 EXPECT_CALL(cfd_, OnAutomationServerReady()) | 258 EXPECT_CALL(cfd_, OnAutomationServerReady()) |
| 274 .WillOnce(QUIT_LOOP(loop_)); | 259 .WillOnce(QUIT_LOOP(loop_)); |
| 275 | 260 |
| 276 EXPECT_CALL(mock_proxy_, CancelAsync(_)).Times(testing::AnyNumber()); | 261 EXPECT_CALL(mock_proxy_, CancelAsync(_)).Times(testing::AnyNumber()); |
| 277 | 262 |
| 278 // Here we go! | 263 // Here we go! |
| 279 ChromeFrameLaunchParams clp = { | 264 GURL empty; |
| 280 timeout, | 265 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 281 GURL(), | 266 empty, empty, profile_path_, profile_path_.BaseName().value(), L"", |
| 282 GURL(), | 267 false, false)); |
| 283 profile_path_, | 268 clp->set_launch_timeout(timeout); |
| 284 profile_path_.BaseName().value(), | 269 clp->set_version_check(false); |
| 285 L"", | |
| 286 false, | |
| 287 false, | |
| 288 false | |
| 289 }; | |
| 290 EXPECT_TRUE(client_->Initialize(&cfd_, clp)); | 270 EXPECT_TRUE(client_->Initialize(&cfd_, clp)); |
| 291 loop_.RunFor(10); | 271 loop_.RunFor(10); |
| 292 | 272 |
| 293 EXPECT_CALL(mock_proxy_, ReleaseTabProxy(testing::Eq(tab_handle_))).Times(1); | 273 EXPECT_CALL(mock_proxy_, ReleaseTabProxy(testing::Eq(tab_handle_))).Times(1); |
| 294 client_->Uninitialize(); | 274 client_->Uninitialize(); |
| 295 } | 275 } |
| 296 | 276 |
| 297 TEST_F(CFACMockTest, MockedCreateTabFailed) { | 277 TEST_F(CFACMockTest, MockedCreateTabFailed) { |
| 298 HWND null_wnd = NULL; | 278 HWND null_wnd = NULL; |
| 299 SetAutomationServerOk(1); | 279 SetAutomationServerOk(1); |
| 300 | 280 |
| 301 EXPECT_CALL(mock_proxy_, server_version()).Times(testing::AnyNumber()) | 281 EXPECT_CALL(mock_proxy_, server_version()).Times(testing::AnyNumber()) |
| 302 .WillRepeatedly(Return("")); | 282 .WillRepeatedly(Return("")); |
| 303 | 283 |
| 304 EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( | 284 EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( |
| 305 &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), | 285 &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), |
| 306 testing::NotNull(), _)) | 286 testing::NotNull(), _)) |
| 307 .Times(1).WillOnce(HandleCreateTab(tab_handle_, null_wnd, null_wnd)); | 287 .Times(1).WillOnce(HandleCreateTab(tab_handle_, null_wnd, null_wnd)); |
| 308 | 288 |
| 309 EXPECT_CALL(mock_proxy_, CreateTabProxy(_)).Times(0); | 289 EXPECT_CALL(mock_proxy_, CreateTabProxy(_)).Times(0); |
| 310 | 290 |
| 311 EXPECT_CALL(mock_proxy_, CancelAsync(_)).Times(testing::AnyNumber()); | 291 EXPECT_CALL(mock_proxy_, CancelAsync(_)).Times(testing::AnyNumber()); |
| 312 | 292 |
| 313 Set_CFD_LaunchFailed(AUTOMATION_CREATE_TAB_FAILED); | 293 Set_CFD_LaunchFailed(AUTOMATION_CREATE_TAB_FAILED); |
| 314 | 294 |
| 315 // Here we go! | 295 // Here we go! |
| 316 ChromeFrameLaunchParams clp = { | 296 GURL empty; |
| 317 timeout_, | 297 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 318 GURL(), | 298 empty, empty, profile_path_, profile_path_.BaseName().value(), L"", |
| 319 GURL(), | 299 false, false)); |
| 320 profile_path_, | 300 clp->set_launch_timeout(timeout_); |
| 321 profile_path_.BaseName().value(), | 301 clp->set_version_check(false); |
| 322 L"", | |
| 323 false, | |
| 324 false, | |
| 325 false | |
| 326 }; | |
| 327 EXPECT_TRUE(client_->Initialize(&cfd_, clp)); | 302 EXPECT_TRUE(client_->Initialize(&cfd_, clp)); |
| 328 loop_.RunFor(4); | 303 loop_.RunFor(4); |
| 329 client_->Uninitialize(); | 304 client_->Uninitialize(); |
| 330 } | 305 } |
| 331 | 306 |
| 332 class TestChromeFrameAutomationProxyImpl | 307 class TestChromeFrameAutomationProxyImpl |
| 333 : public ChromeFrameAutomationProxyImpl { | 308 : public ChromeFrameAutomationProxyImpl { |
| 334 public: | 309 public: |
| 335 TestChromeFrameAutomationProxyImpl() | 310 TestChromeFrameAutomationProxyImpl() |
| 336 : ChromeFrameAutomationProxyImpl(1) { // 1 is an unneeded timeout. | 311 // 1 is an unneeded timeout. |
| 312 : ChromeFrameAutomationProxyImpl(NULL, 1) { |
| 337 } | 313 } |
| 338 MOCK_METHOD3( | 314 MOCK_METHOD3( |
| 339 SendAsAsync, | 315 SendAsAsync, |
| 340 void(IPC::SyncMessage* msg, | 316 void(IPC::SyncMessage* msg, |
| 341 SyncMessageReplyDispatcher::SyncMessageCallContext* context, | 317 SyncMessageReplyDispatcher::SyncMessageCallContext* context, |
| 342 void* key)); | 318 void* key)); |
| 343 void FakeChannelError() { | 319 void FakeChannelError() { |
| 344 reinterpret_cast<IPC::ChannelProxy::MessageFilter*>(message_filter_.get())-> | 320 reinterpret_cast<IPC::ChannelProxy::MessageFilter*>(message_filter_.get())-> |
| 345 OnChannelError(); | 321 OnChannelError(); |
| 346 } | 322 } |
| 347 }; | 323 }; |
| 348 | 324 |
| 349 TEST_F(CFACMockTest, OnChannelErrorEmpty) { | 325 TEST_F(CFACMockTest, OnChannelErrorEmpty) { |
| 350 TestChromeFrameAutomationProxyImpl proxy; | 326 TestChromeFrameAutomationProxyImpl proxy; |
| 351 | 327 |
| 352 // No tabs should do nothing yet still not fail either. | 328 // No tabs should do nothing yet still not fail either. |
| 353 proxy.FakeChannelError(); | 329 proxy.FakeChannelError(); |
| 354 } | 330 } |
| 355 | 331 |
| 356 TEST_F(CFACMockTest, OnChannelError) { | 332 TEST_F(CFACMockTest, OnChannelError) { |
| 357 TestChromeFrameAutomationProxyImpl proxy; | 333 TestChromeFrameAutomationProxyImpl proxy; |
| 358 returned_proxy_ = &proxy; | 334 returned_proxy_ = &proxy; |
| 359 | 335 |
| 360 ChromeFrameLaunchParams clp = { | 336 GURL empty; |
| 361 1, // Unneeded timeout, but can't be 0. | 337 scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( |
| 362 GURL(), | 338 empty, empty, profile_path_, profile_path_.BaseName().value(), L"", |
| 363 GURL(), | 339 false, false)); |
| 364 profile_path_, | 340 clp->set_launch_timeout(1); // Unneeded timeout, but can't be 0. |
| 365 profile_path_.BaseName().value(), | 341 clp->set_version_check(false); |
| 366 L"", | |
| 367 false, | |
| 368 false, | |
| 369 false | |
| 370 }; | |
| 371 | 342 |
| 372 HWND h1 = ::GetDesktopWindow(); | 343 HWND h1 = ::GetDesktopWindow(); |
| 373 HWND h2 = ::GetDesktopWindow(); | 344 HWND h2 = ::GetDesktopWindow(); |
| 374 EXPECT_CALL(proxy, SendAsAsync(testing::Property( | 345 EXPECT_CALL(proxy, SendAsAsync(testing::Property( |
| 375 &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), | 346 &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), |
| 376 testing::NotNull(), _)).Times(3) | 347 testing::NotNull(), _)).Times(3) |
| 377 .WillOnce(HandleCreateTab(tab_handle_, h1, h2)) | 348 .WillOnce(HandleCreateTab(tab_handle_, h1, h2)) |
| 378 .WillOnce(HandleCreateTab(tab_handle_ * 2, h1, h2)) | 349 .WillOnce(HandleCreateTab(tab_handle_ * 2, h1, h2)) |
| 379 .WillOnce(HandleCreateTab(tab_handle_ * 3, h1, h2)); | 350 .WillOnce(HandleCreateTab(tab_handle_ * 3, h1, h2)); |
| 380 | 351 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 loop_.RunFor(11); | 403 loop_.RunFor(11); |
| 433 | 404 |
| 434 // Cleanup. | 405 // Cleanup. |
| 435 client1->Uninitialize(); | 406 client1->Uninitialize(); |
| 436 client2->Uninitialize(); | 407 client2->Uninitialize(); |
| 437 client3->Uninitialize(); | 408 client3->Uninitialize(); |
| 438 client1 = NULL; | 409 client1 = NULL; |
| 439 client2 = NULL; | 410 client2 = NULL; |
| 440 client3 = NULL; | 411 client3 = NULL; |
| 441 } | 412 } |
| OLD | NEW |