1 // Copyright (c) 2010 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.
5 #ifndef GFX_TEST_SUITE_H_
6 #define GFX_TEST_SUITE_H_
9 #include "build/build_config.h"
13 #include "gfx/gfx_paths.h"
14 #include "base/file_path.h"
15 #include "base/path_service.h"
16 #if defined(OS_MACOSX)
17 #include "base/mac_util.h"
19 #include "base/mac/scoped_nsautorelease_pool.h"
20 #include "base/test/test_suite.h"
22 class GfxTestSuite
: public base::TestSuite
{
24 GfxTestSuite(int argc
, char** argv
) : TestSuite(argc
, argv
) {
29 virtual void Initialize() {
30 base::mac::ScopedNSAutoreleasePool autorelease_pool
;
32 TestSuite::Initialize();
34 gfx::RegisterPathProvider();
36 #if defined(OS_MACOSX)
37 // Look in the framework bundle for resources.
38 // TODO(port): make a resource bundle for non-app exes. What's done here
39 // isn't really right because this code needs to depend on chrome_dll
40 // being built. This is inappropriate in app.
42 PathService::Get(base::DIR_EXE
, &path
);
43 #if defined(GOOGLE_CHROME_BUILD)
44 path
= path
.AppendASCII("Google Chrome Framework.framework");
45 #elif defined(CHROMIUM_BUILD)
46 path
= path
.AppendASCII("Chromium Framework.framework");
48 #error Unknown branding
50 mac_util::SetOverrideAppBundlePath(path
);
54 virtual void Shutdown() {
55 #if defined(OS_MACOSX)
56 mac_util::SetOverrideAppBundle(NULL
);
58 TestSuite::Shutdown();
62 #endif // GFX_TEST_SUITE_H_