diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 16:11:11 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 16:11:11 +0000 |
commit | 5dfe8dcd174ecb6cc4b91de62bb6c0ed80c862ca (patch) | |
tree | 5bffeecac79061d39d4c4eb9c213a8e077b97008 /chrome | |
parent | f9c61c9a94741747d223fbd0ae902478205aba61 (diff) | |
download | chromium_src-5dfe8dcd174ecb6cc4b91de62bb6c0ed80c862ca.zip chromium_src-5dfe8dcd174ecb6cc4b91de62bb6c0ed80c862ca.tar.gz chromium_src-5dfe8dcd174ecb6cc4b91de62bb6c0ed80c862ca.tar.bz2 |
move a few #ifdefs around so that unit_tests does proper path initialization for Mac and Linux. This allows use of things like DIR_TEST_DATA.
StatsTable also comes along for the ride.
Review URL: http://codereview.chromium.org/13153
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/test/unit/chrome_test_suite.h | 9 | ||||
-rw-r--r-- | chrome/test/unit/run_all_unittests.cc | 8 |
2 files changed, 8 insertions, 9 deletions
diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h index 92f000f..b2c192a 100644 --- a/chrome/test/unit/chrome_test_suite.h +++ b/chrome/test/unit/chrome_test_suite.h @@ -9,11 +9,12 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/test_suite.h" -#include "chrome/browser/browser_process.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" +#if defined(OS_WIN) // to be ported #include "chrome/common/resource_bundle.h" #include "chrome/test/testing_browser_process.h" +#endif class ChromeTestSuite : public TestSuite { public: @@ -26,7 +27,9 @@ protected: TestSuite::Initialize(); chrome::RegisterPathProvider(); +#if defined(OS_WIN) // to be ported g_browser_process = new TestingBrowserProcess; +#endif // Notice a user data override, and otherwise default to using a custom // user data directory that lives alongside the current app. @@ -40,10 +43,12 @@ protected: if (!user_data_dir.empty()) PathService::Override(chrome::DIR_USER_DATA, user_data_dir); +#if defined(OS_WIN) // to be ported // Force unittests to run using en-us so if we test against string // output, it'll pass regardless of the system language. ResourceBundle::InitSharedInstance(L"en-us"); ResourceBundle::GetSharedInstance().LoadThemeResources(); +#endif // initialize the global StatsTable for unit_tests stats_table_ = new StatsTable("unit_tests", 20, 200); @@ -51,10 +56,12 @@ protected: } virtual void Shutdown() { +#if defined(OS_WIN) // to be ported ResourceBundle::CleanupSharedInstance(); delete g_browser_process; g_browser_process = NULL; +#endif // Tear down shared StatsTable; prevents unit_tests from leaking it. StatsTable::set_current(NULL); diff --git a/chrome/test/unit/run_all_unittests.cc b/chrome/test/unit/run_all_unittests.cc index 4d16777..84f1dae 100644 --- a/chrome/test/unit/run_all_unittests.cc +++ b/chrome/test/unit/run_all_unittests.cc @@ -7,17 +7,9 @@ #include "base/test_suite.h" -// TODO(port): This is not Windows-specific, but needs to be ported. -#if defined(OS_WIN) #include "chrome/test/unit/chrome_test_suite.h" -#endif int main(int argc, char **argv) { base::EnableTerminationOnHeapCorruption(); -#if defined(OS_WIN) - // TODO(port): This is not Windows-specific, but needs to be ported. return ChromeTestSuite(argc, argv).Run(); -#else - return TestSuite(argc, argv).Run(); -#endif } |