diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 20:38:55 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 20:38:55 +0000 |
commit | 0676c489908737e8ab424bc7ba4f1961e6282c47 (patch) | |
tree | a796d4f9bbf33e67b4584831a908c30eed80fb9e | |
parent | 84cc3ad1010f72dc75713bbed861d93732275e39 (diff) | |
download | chromium_src-0676c489908737e8ab424bc7ba4f1961e6282c47.zip chromium_src-0676c489908737e8ab424bc7ba4f1961e6282c47.tar.gz chromium_src-0676c489908737e8ab424bc7ba4f1961e6282c47.tar.bz2 |
Fix random crashes in the ChromeFrame automation proxy mock tests. These crashes occur when an ASSERTION
fails in these tests which causes the ProxyFactory object instantiated at the beginning of the test suite
to be destroyed. For the curious the crash occurs in the UMA sending code in ChromeFrame which attempts to
dereference the ChromeFrameHistogramSnapshots pointer which has already been destroyed. It is a member
of the ProxyFactory class.
This crash will not occur in real life as the ProxyFactory is a global singleton in ChromeFrame. Temporary
hack to not crash in the test code is to flag the crash metrics object that reporting is active which disables
UMA sends to chrome.
BUG=none
TEST=chrome frame proxy mock tests should not crash.
Review URL: http://codereview.chromium.org/6901072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83393 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/test/proxy_factory_mock.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome_frame/test/proxy_factory_mock.cc b/chrome_frame/test/proxy_factory_mock.cc index ba0b010..20c56fe 100644 --- a/chrome_frame/test/proxy_factory_mock.cc +++ b/chrome_frame/test/proxy_factory_mock.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/synchronization/waitable_event.h" +#include "chrome_frame/crash_reporting/crash_metrics.h" #include "chrome_frame/test/proxy_factory_mock.h" #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING @@ -13,6 +14,8 @@ using testing::_; DISABLE_RUNNABLE_METHOD_REFCOUNT(MockProxyFactory); TEST(ProxyFactoryTest, CreateDestroy) { + CrashMetricsReporter::GetInstance()->set_active(true); + ProxyFactory f; LaunchDelegateMock d; EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(1); @@ -31,6 +34,7 @@ TEST(ProxyFactoryTest, CreateDestroy) { } TEST(ProxyFactoryTest, CreateSameProfile) { + CrashMetricsReporter::GetInstance()->set_active(true); ProxyFactory f; LaunchDelegateMock d; LaunchDelegateMock d2; @@ -57,6 +61,7 @@ TEST(ProxyFactoryTest, CreateSameProfile) { } TEST(ProxyFactoryTest, CreateDifferentProfiles) { + CrashMetricsReporter::GetInstance()->set_active(true); ProxyFactory f; LaunchDelegateMock d; EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(2); @@ -87,6 +92,7 @@ TEST(ProxyFactoryTest, CreateDifferentProfiles) { } TEST(ProxyFactoryTest, FastCreateDestroy) { + CrashMetricsReporter::GetInstance()->set_active(true); ProxyFactory f; LaunchDelegateMock* d1 = new LaunchDelegateMock(); LaunchDelegateMock* d2 = new LaunchDelegateMock(); |