OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ | 4 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ |
5 #define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ | 5 #define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "chrome_frame/chrome_frame_automation.h" | 11 #include "chrome_frame/chrome_frame_automation.h" |
12 #include "chrome_frame/chrome_frame_plugin.h" | 12 #include "chrome_frame/chrome_frame_plugin.h" |
13 #include "chrome_frame/test/http_server.h" | 13 #include "chrome_frame/test/http_server.h" |
| 14 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 15 #include "chrome_frame/utils.h" |
14 | 16 |
15 template <typename T> | 17 template <typename T> |
16 class AutomationMockDelegate | 18 class AutomationMockDelegate |
17 : public CWindowImpl<T>, | 19 : public CWindowImpl<T>, |
18 public ChromeFramePlugin<T> { | 20 public ChromeFramePlugin<T> { |
19 public: | 21 public: |
20 AutomationMockDelegate(MessageLoop* caller_message_loop, | 22 AutomationMockDelegate(MessageLoop* caller_message_loop, |
21 int launch_timeout, bool perform_version_check, | 23 int launch_timeout, bool perform_version_check, |
22 const std::wstring& profile_name, | 24 const std::wstring& profile_name, |
23 const std::wstring& extra_chrome_arguments, bool incognito) | 25 const std::wstring& extra_chrome_arguments, bool incognito) |
24 : caller_message_loop_(caller_message_loop), is_connected_(false), | 26 : caller_message_loop_(caller_message_loop), is_connected_(false), |
25 navigation_result_(false) { | 27 navigation_result_(false) { |
26 test_server_.SetUp(); | 28 test_server_.SetUp(); |
| 29 |
| 30 FilePath profile_path( |
| 31 chrome_frame_test::GetProfilePath(profile_name)); |
| 32 |
27 automation_client_ = new ChromeFrameAutomationClient; | 33 automation_client_ = new ChromeFrameAutomationClient; |
28 automation_client_->Initialize(this, launch_timeout, perform_version_check, | 34 automation_client_->Initialize(this, launch_timeout, perform_version_check, |
29 profile_name, extra_chrome_arguments, incognito); | 35 profile_path, extra_chrome_arguments, incognito); |
30 } | 36 } |
31 ~AutomationMockDelegate() { | 37 ~AutomationMockDelegate() { |
32 if (automation_client_.get()) { | 38 if (automation_client_.get()) { |
33 automation_client_->Uninitialize(); | 39 automation_client_->Uninitialize(); |
34 automation_client_ = NULL; | 40 automation_client_ = NULL; |
35 } | 41 } |
36 if (IsWindow()) | 42 if (IsWindow()) |
37 DestroyWindow(); | 43 DestroyWindow(); |
38 | 44 |
39 test_server_.TearDown(); | 45 test_server_.TearDown(); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 virtual void OnLoad(int tab_handle, const GURL& url) { | 212 virtual void OnLoad(int tab_handle, const GURL& url) { |
207 Base::OnLoad(tab_handle, url); | 213 Base::OnLoad(tab_handle, url); |
208 } | 214 } |
209 private: | 215 private: |
210 bool request_start_result_; | 216 bool request_start_result_; |
211 }; | 217 }; |
212 | 218 |
213 | 219 |
214 #endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ | 220 #endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ |
215 | 221 |
OLD | NEW |