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