Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1153)

Side by Side Diff: base/test/test_suite.h

Issue 8947021: Destroy all Singletons and LazyInstances between each test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for realz Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/test/test_suite.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_TEST_TEST_SUITE_H_ 5 #ifndef BASE_TEST_TEST_SUITE_H_
6 #define BASE_TEST_TEST_SUITE_H_ 6 #define BASE_TEST_TEST_SUITE_H_
7 7
8 // Defines a basic test suite framework for running gtest based tests. You can 8 // Defines a basic test suite framework for running gtest based tests. You can
9 // instantiate this class in your main function and call its Run method to run 9 // instantiate this class in your main function and call its Run method to run
10 // any gtest based tests that are linked into your executable. 10 // any gtest based tests that are linked into your executable.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Disable crash dialogs so that it doesn't gum up the buildbot 53 // Disable crash dialogs so that it doesn't gum up the buildbot
54 virtual void SuppressErrorDialogs(); 54 virtual void SuppressErrorDialogs();
55 55
56 // Override these for custom initialization and shutdown handling. Use these 56 // Override these for custom initialization and shutdown handling. Use these
57 // instead of putting complex code in your constructor/destructor. 57 // instead of putting complex code in your constructor/destructor.
58 58
59 virtual void Initialize(); 59 virtual void Initialize();
60 virtual void Shutdown(); 60 virtual void Shutdown();
61 61
62 // Sets up a TestEventListener to shadow the at_exit_manager_ between each
63 // individual test. Broken test suites can override this method to disable
64 // this behavior until they can be fixed.
65 virtual void EnableSingletonTestIsolation();
jam 2013/05/07 18:09:57 i highly suggest not adding this method, i.e. not
Robert Sesek 2013/05/07 18:12:29 Good point. Done.
66
62 // Make sure that we setup an AtExitManager so Singleton objects will be 67 // Make sure that we setup an AtExitManager so Singleton objects will be
63 // destroyed. 68 // destroyed.
64 scoped_ptr<base::AtExitManager> at_exit_manager_; 69 scoped_ptr<base::AtExitManager> at_exit_manager_;
65 70
66 private: 71 private:
67 // Basic initialization for the test suite happens here. 72 // Basic initialization for the test suite happens here.
68 void PreInitialize(int argc, char** argv, bool create_at_exit_manager); 73 void PreInitialize(int argc, char** argv, bool create_at_exit_manager);
69 74
70 bool initialized_command_line_; 75 bool initialized_command_line_;
71 76
72 DISALLOW_COPY_AND_ASSIGN(TestSuite); 77 DISALLOW_COPY_AND_ASSIGN(TestSuite);
73 }; 78 };
74 79
75 } // namespace base 80 } // namespace base
76 81
77 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile 82 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile
78 // until we can update it to use "base::" (preventing a two-sided patch). 83 // until we can update it to use "base::" (preventing a two-sided patch).
79 using base::TestSuite; 84 using base::TestSuite;
80 85
81 #endif // BASE_TEST_TEST_SUITE_H_ 86 #endif // BASE_TEST_TEST_SUITE_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698