summaryrefslogtreecommitdiffstats
path: root/base/test/test_suite.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-16 20:38:42 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-16 20:38:42 +0000
commit4e7395b4167738538b51f4884cc7c2eacf226752 (patch)
treeb6281c011f28b9f95e860c7f9548ac4f05730a98 /base/test/test_suite.h
parenta9add880aab37473c810b10bf0165575c547b5d8 (diff)
downloadchromium_src-4e7395b4167738538b51f4884cc7c2eacf226752.zip
chromium_src-4e7395b4167738538b51f4884cc7c2eacf226752.tar.gz
chromium_src-4e7395b4167738538b51f4884cc7c2eacf226752.tar.bz2
Remove test isolation enforcement code.
I think it was a failed experiment, and it only ever worked for base_unittests. This removes some potentially risky code from LazyInstance that was only needed for the test isolation. The lesson from this experiment is that removing singletons works better than trying to make tests work fine even when singletons are overused. TEST=none BUG=12710 Review URL: http://codereview.chromium.org/3127012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test/test_suite.h')
-rw-r--r--base/test/test_suite.h26
1 files changed, 0 insertions, 26 deletions
diff --git a/base/test/test_suite.h b/base/test/test_suite.h
index 3cfc7ec..c0a2891 100644
--- a/base/test/test_suite.h
+++ b/base/test/test_suite.h
@@ -37,25 +37,6 @@ const char kStrictFailureHandling[] = "strict_failure_handling";
// Match function used by the GetTestCount method.
typedef bool (*TestMatch)(const testing::TestInfo&);
-// By setting up a shadow AtExitManager, this test event listener ensures that
-// no state is carried between tests (like singletons, lazy instances, etc).
-// Of course it won't help if the code under test corrupts memory.
-class TestIsolationEnforcer : public testing::EmptyTestEventListener {
- public:
- virtual void OnTestStart(const testing::TestInfo& test_info) {
- ASSERT_FALSE(exit_manager_.get());
- exit_manager_.reset(new base::ShadowingAtExitManager());
- }
-
- virtual void OnTestEnd(const testing::TestInfo& test_info) {
- ASSERT_TRUE(exit_manager_.get());
- exit_manager_.reset();
- }
-
- private:
- scoped_ptr<base::ShadowingAtExitManager> exit_manager_;
-};
-
class TestSuite {
public:
TestSuite(int argc, char** argv);
@@ -111,13 +92,6 @@ class TestSuite {
return count;
}
- // TODO(phajdan.jr): Enforce isolation for all tests once it's stable.
- void EnforceTestIsolation() {
- testing::TestEventListeners& listeners =
- testing::UnitTest::GetInstance()->listeners();
- listeners.Append(new TestIsolationEnforcer);
- }
-
void CatchMaybeTests() {
testing::TestEventListeners& listeners =
testing::UnitTest::GetInstance()->listeners();