Update about_credits.html by re-running license.py
[chromium-blink-merge.git] / gfx / test_suite.h
blob8803c7cb592db5ae96553e86e30c4932ef876895
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_
7 #pragma once
9 #include "build/build_config.h"
11 #include <string>
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"
18 #endif
19 #include "base/mac/scoped_nsautorelease_pool.h"
20 #include "base/test/test_suite.h"
22 class GfxTestSuite : public base::TestSuite {
23 public:
24 GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
27 protected:
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.
41 FilePath path;
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");
47 #else
48 #error Unknown branding
49 #endif
50 mac_util::SetOverrideAppBundlePath(path);
51 #endif // OS_MACOSX
54 virtual void Shutdown() {
55 #if defined(OS_MACOSX)
56 mac_util::SetOverrideAppBundle(NULL);
57 #endif
58 TestSuite::Shutdown();
62 #endif // GFX_TEST_SUITE_H_