| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOMATION_MOCK_H_ | 5 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ |
| 6 #define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ | 6 #define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/test/test_process_killer_win.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome_frame/chrome_frame_automation.h" | 15 #include "chrome_frame/chrome_frame_automation.h" |
| 15 #include "chrome_frame/chrome_frame_plugin.h" | 16 #include "chrome_frame/chrome_frame_plugin.h" |
| 16 #include "chrome_frame/navigation_constraints.h" | 17 #include "chrome_frame/navigation_constraints.h" |
| 17 #include "chrome_frame/test/chrome_frame_test_utils.h" | |
| 18 #include "chrome_frame/test/test_scrubber.h" | 18 #include "chrome_frame/test/test_scrubber.h" |
| 19 #include "chrome_frame/test/test_with_web_server.h" | 19 #include "chrome_frame/test/test_with_web_server.h" |
| 20 #include "chrome_frame/utils.h" | 20 #include "chrome_frame/utils.h" |
| 21 | 21 |
| 22 template <typename T> | 22 template <typename T> |
| 23 class AutomationMockDelegate | 23 class AutomationMockDelegate |
| 24 : public CWindowImpl<T>, | 24 : public CWindowImpl<T>, |
| 25 public ChromeFramePlugin<T> { | 25 public ChromeFramePlugin<T> { |
| 26 public: | 26 public: |
| 27 AutomationMockDelegate(MessageLoop* caller_message_loop, | 27 AutomationMockDelegate(MessageLoop* caller_message_loop, |
| 28 int launch_timeout, bool perform_version_check, | 28 int launch_timeout, bool perform_version_check, |
| 29 const std::wstring& profile_name, | 29 const std::wstring& profile_name, |
| 30 const std::wstring& language, | 30 const std::wstring& language, |
| 31 bool incognito, bool is_widget_mode) | 31 bool incognito, bool is_widget_mode) |
| 32 : caller_message_loop_(caller_message_loop), is_connected_(false), | 32 : caller_message_loop_(caller_message_loop), is_connected_(false), |
| 33 navigation_result_(false), | 33 navigation_result_(false), |
| 34 mock_server_(1337, L"127.0.0.1", | 34 mock_server_(1337, L"127.0.0.1", |
| 35 chrome_frame_test::GetTestDataFolder()) { | 35 chrome_frame_test::GetTestDataFolder()) { |
| 36 | 36 |
| 37 // Endeavour to only kill off Chrome Frame derived Chrome processes. | 37 // Endeavour to only kill off Chrome Frame derived Chrome processes. |
| 38 KillAllNamedProcessesWithArgument( | 38 base::KillAllNamedProcessesWithArgument( |
| 39 UTF8ToWide(chrome_frame_test::kChromeImageName), | 39 UTF8ToWide(chrome_frame_test::kChromeImageName), |
| 40 UTF8ToWide(switches::kChromeFrame)); | 40 UTF8ToWide(switches::kChromeFrame)); |
| 41 | 41 |
| 42 mock_server_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE)); | 42 mock_server_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE)); |
| 43 | 43 |
| 44 base::FilePath profile_path; | 44 base::FilePath profile_path; |
| 45 GetChromeFrameProfilePath(profile_name, &profile_path); | 45 GetChromeFrameProfilePath(profile_name, &profile_path); |
| 46 chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value()); | 46 chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value()); |
| 47 | 47 |
| 48 automation_client_ = new ChromeFrameAutomationClient; | 48 automation_client_ = new ChromeFrameAutomationClient; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 QuitMessageLoop(); | 231 QuitMessageLoop(); |
| 232 } | 232 } |
| 233 virtual void OnLoad(const GURL& url) { | 233 virtual void OnLoad(const GURL& url) { |
| 234 Base::OnLoad(url); | 234 Base::OnLoad(url); |
| 235 } | 235 } |
| 236 private: | 236 private: |
| 237 bool request_start_result_; | 237 bool request_start_result_; |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 #endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ | 240 #endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ |
| OLD | NEW |