| OLD | NEW |
| 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 "base/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
| 5 #include "chrome_frame/crash_reporting/crash_metrics.h" | 6 #include "chrome_frame/crash_reporting/crash_metrics.h" |
| 6 #include "chrome_frame/test/proxy_factory_mock.h" | 7 #include "chrome_frame/test/proxy_factory_mock.h" |
| 7 | 8 |
| 8 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 9 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 9 #include "testing/gmock_mutant.h" | 10 #include "testing/gmock_mutant.h" |
| 10 | 11 |
| 11 using testing::CreateFunctor; | 12 using testing::CreateFunctor; |
| 12 using testing::_; | 13 using testing::_; |
| 13 | 14 |
| 14 DISABLE_RUNNABLE_METHOD_REFCOUNT(MockProxyFactory); | |
| 15 | |
| 16 TEST(ProxyFactoryTest, CreateDestroy) { | 15 TEST(ProxyFactoryTest, CreateDestroy) { |
| 17 CrashMetricsReporter::GetInstance()->set_active(true); | 16 CrashMetricsReporter::GetInstance()->set_active(true); |
| 18 | 17 |
| 19 ProxyFactory f; | 18 ProxyFactory f; |
| 20 LaunchDelegateMock d; | 19 LaunchDelegateMock d; |
| 21 EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(1); | 20 EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(1); |
| 22 | 21 |
| 23 GURL empty; | 22 GURL empty; |
| 24 FilePath profile_path; | 23 FilePath profile_path; |
| 25 scoped_refptr<ChromeFrameLaunchParams> params( | 24 scoped_refptr<ChromeFrameLaunchParams> params( |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 void* i2 = NULL; | 125 void* i2 = NULL; |
| 127 f.GetAutomationServer(d2, params, &i2); | 126 f.GetAutomationServer(d2, params, &i2); |
| 128 EXPECT_EQ(i1, i2); | 127 EXPECT_EQ(i1, i2); |
| 129 f.ReleaseAutomationServer(i2, d2); | 128 f.ReleaseAutomationServer(i2, d2); |
| 130 delete d2; | 129 delete d2; |
| 131 | 130 |
| 132 ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_NORMAL); | 131 ::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_NORMAL); |
| 133 f.ReleaseAutomationServer(i1, d1); | 132 f.ReleaseAutomationServer(i1, d1); |
| 134 delete d1; | 133 delete d1; |
| 135 } | 134 } |
| OLD | NEW |