diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-18 21:23:49 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-18 21:23:49 +0000 |
commit | 3c53cfa23d26b9477e3ca46e141c820e9793a5f2 (patch) | |
tree | 704ac6f5b8b9ebbb0640a853f25002d86ccd0c8e /app/test_suite.h | |
parent | 24f57133d4cf6da4c4122a609c6d1fd7262d6f06 (diff) | |
download | chromium_src-3c53cfa23d26b9477e3ca46e141c820e9793a5f2.zip chromium_src-3c53cfa23d26b9477e3ca46e141c820e9793a5f2.tar.gz chromium_src-3c53cfa23d26b9477e3ca46e141c820e9793a5f2.tar.bz2 |
Move app-related unit tests to gyp in app.gyp
http://crbug.com/11387
Review URL: http://codereview.chromium.org/113540
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/test_suite.h')
-rw-r--r-- | app/test_suite.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/app/test_suite.h b/app/test_suite.h new file mode 100644 index 0000000..18b07e6 --- /dev/null +++ b/app/test_suite.h @@ -0,0 +1,59 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef APP_TEST_SUITE_H_ +#define APP_TEST_SUITE_H_ + +#include "build/build_config.h" + +#include <string> + +#include "app/app_paths.h" +#include "app/resource_bundle.h" +#include "base/path_service.h" +#if defined(OS_MACOSX) +#include "base/mac_util.h" +#endif +#include "base/scoped_nsautorelease_pool.h" +#include "base/test_suite.h" + +class AppTestSuite : public TestSuite { + public: + AppTestSuite(int argc, char** argv) : TestSuite(argc, argv) { + } + + protected: + + virtual void Initialize() { + base::ScopedNSAutoreleasePool autorelease_pool; + + TestSuite::Initialize(); + + app::RegisterPathProvider(); + +#if defined(OS_MACOSX) + FilePath path; + PathService::Get(base::DIR_EXE, &path); + // TODO(port): make a resource bundle for non-app exes. + path = path.AppendASCII("Chromium.app"); + mac_util::SetOverrideAppBundlePath(path); +#endif + + // 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(); + } + + virtual void Shutdown() { + ResourceBundle::CleanupSharedInstance(); + +#if defined(OS_MACOSX) + mac_util::SetOverrideAppBundle(NULL); +#endif + TestSuite::Shutdown(); + } +}; + +#endif // APP_TEST_SUITE_H_ |