diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:09:22 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 01:09:22 +0000 |
commit | 8083cc31cb71654db903703a7ee7c56d7df8f6ae (patch) | |
tree | d65ef7b0d2863fab35387214dd770ffe72366a5b /base/test | |
parent | b053e3e31795c5a944b074516786eca4e30893d5 (diff) | |
download | chromium_src-8083cc31cb71654db903703a7ee7c56d7df8f6ae.zip chromium_src-8083cc31cb71654db903703a7ee7c56d7df8f6ae.tar.gz chromium_src-8083cc31cb71654db903703a7ee7c56d7df8f6ae.tar.bz2 |
Enable ChromeFrame net tests for IE versions 8 and below. Changes include the following:-
1. Get rid of the dummy AtlModule registration in the chrome frame net test suite. This is no longer needed
as there is an Atlmodule instance instantiated by the content code.
2. The TestSuite and NetTestSuite classes now provide special protected constructors which allow
test instances to control whether an AtExitManager instance is created for the duration of the
test. The ChromeFrame net test suite reuses the AtExitManager instance created in BrowserMain.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=105435
BUG=105435
TEST=ChromeFrame net tests should now run on the builders.
Review URL: http://codereview.chromium.org/8907054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test')
-rw-r--r-- | base/test/test_suite.cc | 21 | ||||
-rw-r--r-- | base/test/test_suite.h | 12 |
2 files changed, 28 insertions, 5 deletions
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index 6739a4e..cf04caf 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc @@ -72,6 +72,19 @@ class TestClientInitializer : public testing::EmptyTestEventListener { const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling"; TestSuite::TestSuite(int argc, char** argv) { + PreInitialize(argc, argv, true); +} + +TestSuite::TestSuite(int argc, char** argv, bool create_at_exit_manager) { + PreInitialize(argc, argv, create_at_exit_manager); +} + +TestSuite::~TestSuite() { + CommandLine::Reset(); +} + +void TestSuite::PreInitialize(int argc, char** argv, + bool create_at_exit_manager) { #if defined(OS_WIN) testing::GTEST_FLAG(catch_exceptions) = false; #endif @@ -86,13 +99,13 @@ TestSuite::TestSuite(int argc, char** argv) { #elif defined(TOOLKIT_USES_GTK) gtk_init_check(&argc, &argv); #endif // defined(TOOLKIT_USES_GTK) - // Don't add additional code to this constructor. Instead add it to + if (create_at_exit_manager) + at_exit_manager_.reset(new base::AtExitManager); + + // Don't add additional code to this function. Instead add it to // Initialize(). See bug 6436. } -TestSuite::~TestSuite() { - CommandLine::Reset(); -} // static bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) { diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 2572756..4cf6857c 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -13,6 +13,7 @@ #include <string> #include "base/at_exit.h" +#include "base/memory/scoped_ptr.h" namespace testing { class TestInfo; @@ -59,6 +60,11 @@ class TestSuite { static const char kStrictFailureHandling[]; protected: + // This constructor is only accessible to specialized test suite + // implementations which need to control the creation of an AtExitManager + // instance for the duration of the test. + TestSuite(int argc, char** argv, bool create_at_exit_manager); + // By default fatal log messages (e.g. from DCHECKs) result in error dialogs // which gum up buildbots. Use a minimalistic assert handler which just // terminates the process. @@ -75,7 +81,11 @@ class TestSuite { // Make sure that we setup an AtExitManager so Singleton objects will be // destroyed. - base::AtExitManager at_exit_manager_; + scoped_ptr<base::AtExitManager> at_exit_manager_; + + private: + // Basic initialization for the test suite happens here. + void PreInitialize(int argc, char** argv, bool create_at_exit_manager); DISALLOW_COPY_AND_ASSIGN(TestSuite); }; |