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

Side by Side Diff: app/test_suite.h

Issue 113540: Move app-related unit tests to gyp in app.gyp (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « app/run_all_unittests.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef APP_TEST_SUITE_H_
6 #define APP_TEST_SUITE_H_
7
8 #include "build/build_config.h"
9
10 #include <string>
11
12 #include "app/app_paths.h"
13 #include "app/resource_bundle.h"
14 #include "base/path_service.h"
15 #if defined(OS_MACOSX)
16 #include "base/mac_util.h"
17 #endif
18 #include "base/scoped_nsautorelease_pool.h"
19 #include "base/test_suite.h"
20
21 class AppTestSuite : public TestSuite {
22 public:
23 AppTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
24 }
25
26 protected:
27
28 virtual void Initialize() {
29 base::ScopedNSAutoreleasePool autorelease_pool;
30
31 TestSuite::Initialize();
32
33 app::RegisterPathProvider();
34
35 #if defined(OS_MACOSX)
36 FilePath path;
37 PathService::Get(base::DIR_EXE, &path);
38 // TODO(port): make a resource bundle for non-app exes.
39 path = path.AppendASCII("Chromium.app");
40 mac_util::SetOverrideAppBundlePath(path);
41 #endif
42
43 // Force unittests to run using en-us so if we test against string
44 // output, it'll pass regardless of the system language.
45 ResourceBundle::InitSharedInstance(L"en-us");
46 ResourceBundle::GetSharedInstance().LoadThemeResources();
47 }
48
49 virtual void Shutdown() {
50 ResourceBundle::CleanupSharedInstance();
51
52 #if defined(OS_MACOSX)
53 mac_util::SetOverrideAppBundle(NULL);
54 #endif
55 TestSuite::Shutdown();
56 }
57 };
58
59 #endif // APP_TEST_SUITE_H_
OLDNEW
« no previous file with comments | « app/run_all_unittests.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698