| 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 #include "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
| 7 #include "chrome/common/chrome_paths_internal.h" | 7 #include "chrome/common/chrome_paths_internal.h" |
| 8 #include "chrome_frame/crash_reporting/crash_metrics.h" | 8 #include "chrome_frame/crash_reporting/crash_metrics.h" |
| 9 #include "chrome_frame/test/chrome_frame_test_utils.h" | 9 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 10 #include "chrome_frame/test/proxy_factory_mock.h" | 10 #include "chrome_frame/test/proxy_factory_mock.h" |
| 11 #include "chrome_frame/test/test_scrubber.h" | 11 #include "chrome_frame/test/test_scrubber.h" |
| 12 #include "chrome_frame/utils.h" |
| 12 | 13 |
| 13 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 14 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 14 #include "testing/gmock_mutant.h" | 15 #include "testing/gmock_mutant.h" |
| 15 | 16 |
| 16 using testing::CreateFunctor; | 17 using testing::CreateFunctor; |
| 17 using testing::_; | 18 using testing::_; |
| 18 | 19 |
| 19 class ProxyFactoryTest : public testing::Test { | 20 class ProxyFactoryTest : public testing::Test { |
| 20 protected: | 21 protected: |
| 21 virtual void SetUp() OVERRIDE; | 22 virtual void SetUp() OVERRIDE; |
| 22 | 23 |
| 23 ChromeFrameLaunchParams* MakeLaunchParams(const wchar_t* profile_name); | 24 ChromeFrameLaunchParams* MakeLaunchParams(const wchar_t* profile_name); |
| 24 | 25 |
| 25 ProxyFactory proxy_factory_; | 26 ProxyFactory proxy_factory_; |
| 26 LaunchDelegateMock launch_delegate_mock_; | 27 LaunchDelegateMock launch_delegate_mock_; |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 void ProxyFactoryTest::SetUp() { | 30 void ProxyFactoryTest::SetUp() { |
| 30 CrashMetricsReporter::GetInstance()->set_active(true); | 31 CrashMetricsReporter::GetInstance()->set_active(true); |
| 31 } | 32 } |
| 32 | 33 |
| 33 ChromeFrameLaunchParams* ProxyFactoryTest::MakeLaunchParams( | 34 ChromeFrameLaunchParams* ProxyFactoryTest::MakeLaunchParams( |
| 34 const wchar_t* profile_name) { | 35 const wchar_t* profile_name) { |
| 35 GURL empty; | 36 GURL empty; |
| 36 FilePath profile_path(chrome_frame_test::GetProfilePath(profile_name)); | 37 FilePath profile_path; |
| 38 GetChromeFrameProfilePath(&profile_path, profile_name); |
| 37 chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value()); | 39 chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value()); |
| 38 ChromeFrameLaunchParams* params = | 40 ChromeFrameLaunchParams* params = |
| 39 new ChromeFrameLaunchParams(empty, empty, profile_path, | 41 new ChromeFrameLaunchParams(empty, empty, profile_path, |
| 40 profile_path.BaseName().value(), L"", false, | 42 profile_path.BaseName().value(), L"", false, |
| 41 false, false, false); | 43 false, false, false); |
| 42 params->set_launch_timeout(0); | 44 params->set_launch_timeout(0); |
| 43 params->set_version_check(false); | 45 params->set_version_check(false); |
| 44 return params; | 46 return params; |
| 45 } | 47 } |
| 46 | 48 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_HIGHEST); | 129 ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_HIGHEST); |
| 128 void* i2 = NULL; | 130 void* i2 = NULL; |
| 129 proxy_factory_.GetAutomationServer(d2, params, &i2); | 131 proxy_factory_.GetAutomationServer(d2, params, &i2); |
| 130 EXPECT_EQ(i1, i2); | 132 EXPECT_EQ(i1, i2); |
| 131 proxy_factory_.ReleaseAutomationServer(i2, d2); | 133 proxy_factory_.ReleaseAutomationServer(i2, d2); |
| 132 delete d2; | 134 delete d2; |
| 133 | 135 |
| 134 ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_NORMAL); | 136 ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_NORMAL); |
| 135 proxy_factory_.ReleaseAutomationServer(i1, d1); | 137 proxy_factory_.ReleaseAutomationServer(i1, d1); |
| 136 } | 138 } |
| OLD | NEW |