OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome_frame/test/automation_client_mock.h" | 5 #include "chrome_frame/test/automation_client_mock.h" |
5 | 6 |
6 #include "base/callback.h" | 7 #include "base/callback.h" |
7 #include "chrome_frame/custom_sync_call_context.h" | 8 #include "chrome_frame/custom_sync_call_context.h" |
8 #include "chrome_frame/navigation_constraints.h" | 9 #include "chrome_frame/navigation_constraints.h" |
9 #include "chrome_frame/test/chrome_frame_test_utils.h" | 10 #include "chrome_frame/test/chrome_frame_test_utils.h" |
10 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
11 | 12 |
12 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 13 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
13 #include "testing/gmock_mutant.h" | 14 #include "testing/gmock_mutant.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 client = NULL; | 199 client = NULL; |
199 } | 200 } |
200 | 201 |
201 TEST(CFACWithChrome, NavigateFailed) { | 202 TEST(CFACWithChrome, NavigateFailed) { |
202 MockCFDelegate cfd; | 203 MockCFDelegate cfd; |
203 NavigationConstraintsImpl navigation_constraints; | 204 NavigationConstraintsImpl navigation_constraints; |
204 chrome_frame_test::TimedMsgLoop loop; | 205 chrome_frame_test::TimedMsgLoop loop; |
205 const FilePath profile_path( | 206 const FilePath profile_path( |
206 chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); | 207 chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); |
207 const std::string url = "http://127.0.0.3:65412/"; | 208 const std::string url = "http://127.0.0.3:65412/"; |
208 const URLRequestStatus connection_failed(URLRequestStatus::FAILED, | 209 const net::URLRequestStatus connection_failed(net::URLRequestStatus::FAILED, |
209 net::ERR_INVALID_URL); | 210 net::ERR_INVALID_URL); |
210 | 211 |
211 scoped_refptr<ChromeFrameAutomationClient> client; | 212 scoped_refptr<ChromeFrameAutomationClient> client; |
212 client = new ChromeFrameAutomationClient; | 213 client = new ChromeFrameAutomationClient; |
213 cfd.SetRequestDelegate(client); | 214 cfd.SetRequestDelegate(client); |
214 | 215 |
215 EXPECT_CALL(cfd, OnAutomationServerReady()) | 216 EXPECT_CALL(cfd, OnAutomationServerReady()) |
216 .WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor( | 217 .WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor( |
217 client.get(), &ChromeFrameAutomationClient::InitiateNavigation, | 218 client.get(), &ChromeFrameAutomationClient::InitiateNavigation, |
218 url, std::string(), &navigation_constraints)))); | 219 url, std::string(), &navigation_constraints)))); |
219 | 220 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 GURL("http://www.nonexistent.com"), empty, profile_path_, | 471 GURL("http://www.nonexistent.com"), empty, profile_path_, |
471 profile_path_.BaseName().value(), L"", L"", false, false, false)); | 472 profile_path_.BaseName().value(), L"", L"", false, false, false)); |
472 launch_params->set_launch_timeout(timeout); | 473 launch_params->set_launch_timeout(timeout); |
473 launch_params->set_version_check(false); | 474 launch_params->set_version_check(false); |
474 EXPECT_TRUE(client_->Initialize(&cfd_, launch_params)); | 475 EXPECT_TRUE(client_->Initialize(&cfd_, launch_params)); |
475 loop_.RunFor(10); | 476 loop_.RunFor(10); |
476 | 477 |
477 EXPECT_CALL(mock_proxy_, ReleaseTabProxy(testing::Eq(tab_handle_))).Times(1); | 478 EXPECT_CALL(mock_proxy_, ReleaseTabProxy(testing::Eq(tab_handle_))).Times(1); |
478 client_->Uninitialize(); | 479 client_->Uninitialize(); |
479 } | 480 } |
OLD | NEW |