| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 #include "gfx/test_suite.h" | |
| 6 | |
| 7 #include "gfx/gfx_paths.h" | |
| 8 #include "base/file_path.h" | |
| 9 #include "base/path_service.h" | |
| 10 #include "base/mac/scoped_nsautorelease_pool.h" | |
| 11 | |
| 12 #if defined(OS_MACOSX) | |
| 13 #include "base/mac/mac_util.h" | |
| 14 #endif | |
| 15 | |
| 16 GfxTestSuite::GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} | |
| 17 | |
| 18 void GfxTestSuite::Initialize() { | |
| 19 base::mac::ScopedNSAutoreleasePool autorelease_pool; | |
| 20 | |
| 21 TestSuite::Initialize(); | |
| 22 | |
| 23 gfx::RegisterPathProvider(); | |
| 24 | |
| 25 #if defined(OS_MACOSX) | |
| 26 // Look in the framework bundle for resources. | |
| 27 // TODO(port): make a resource bundle for non-app exes. What's done here | |
| 28 // isn't really right because this code needs to depend on chrome_dll | |
| 29 // being built. This is inappropriate in app. | |
| 30 FilePath path; | |
| 31 PathService::Get(base::DIR_EXE, &path); | |
| 32 #if defined(GOOGLE_CHROME_BUILD) | |
| 33 path = path.AppendASCII("Google Chrome Framework.framework"); | |
| 34 #elif defined(CHROMIUM_BUILD) | |
| 35 path = path.AppendASCII("Chromium Framework.framework"); | |
| 36 #else | |
| 37 #error Unknown branding | |
| 38 #endif | |
| 39 base::mac::SetOverrideAppBundlePath(path); | |
| 40 #endif // OS_MACOSX | |
| 41 } | |
| 42 | |
| 43 void GfxTestSuite::Shutdown() { | |
| 44 #if defined(OS_MACOSX) | |
| 45 base::mac::SetOverrideAppBundle(NULL); | |
| 46 #endif | |
| 47 TestSuite::Shutdown(); | |
| 48 } | |
| OLD | NEW |