| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/test/test_suite.h" | 5 #include "ui/test/test_suite.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 ui::RegisterPathProvider(); | 37 ui::RegisterPathProvider(); |
| 38 gfx::RegisterPathProvider(); | 38 gfx::RegisterPathProvider(); |
| 39 | 39 |
| 40 #if defined(OS_MACOSX) && !defined(OS_IOS) | 40 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 41 // Look in the framework bundle for resources. | 41 // Look in the framework bundle for resources. |
| 42 // TODO(port): make a resource bundle for non-app exes. What's done here | 42 // TODO(port): make a resource bundle for non-app exes. What's done here |
| 43 // isn't really right because this code needs to depend on chrome_dll | 43 // isn't really right because this code needs to depend on chrome_dll |
| 44 // being built. This is inappropriate in app. | 44 // being built. This is inappropriate in app. |
| 45 FilePath path; | 45 base::FilePath path; |
| 46 PathService::Get(base::DIR_EXE, &path); | 46 PathService::Get(base::DIR_EXE, &path); |
| 47 #if defined(GOOGLE_CHROME_BUILD) | 47 #if defined(GOOGLE_CHROME_BUILD) |
| 48 path = path.AppendASCII("Google Chrome Framework.framework"); | 48 path = path.AppendASCII("Google Chrome Framework.framework"); |
| 49 #elif defined(CHROMIUM_BUILD) | 49 #elif defined(CHROMIUM_BUILD) |
| 50 path = path.AppendASCII("Chromium Framework.framework"); | 50 path = path.AppendASCII("Chromium Framework.framework"); |
| 51 #else | 51 #else |
| 52 #error Unknown branding | 52 #error Unknown branding |
| 53 #endif | 53 #endif |
| 54 base::mac::SetOverrideFrameworkBundlePath(path); | 54 base::mac::SetOverrideFrameworkBundlePath(path); |
| 55 #elif defined(OS_POSIX) | 55 #elif defined(OS_POSIX) |
| 56 FilePath pak_dir; | 56 base::FilePath pak_dir; |
| 57 #if defined(OS_ANDROID) | 57 #if defined(OS_ANDROID) |
| 58 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_dir); | 58 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_dir); |
| 59 #else | 59 #else |
| 60 PathService::Get(base::DIR_MODULE, &pak_dir); | 60 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 61 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); | 61 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); |
| 62 PathService::Override(ui::DIR_LOCALES, pak_dir); | 62 PathService::Override(ui::DIR_LOCALES, pak_dir); |
| 63 #endif // defined(OS_ANDROID) | 63 #endif // defined(OS_ANDROID) |
| 64 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 64 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 65 | 65 |
| 66 // Force unittests to run using en-US so if we test against string | 66 // Force unittests to run using en-US so if we test against string |
| (...skipping 11 matching lines...) Expand all Loading... |
| 78 ui::ResourceBundle::CleanupSharedInstance(); | 78 ui::ResourceBundle::CleanupSharedInstance(); |
| 79 | 79 |
| 80 #if defined(OS_MACOSX) && !defined(OS_IOS) | 80 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 81 base::mac::SetOverrideFrameworkBundle(NULL); | 81 base::mac::SetOverrideFrameworkBundle(NULL); |
| 82 #endif | 82 #endif |
| 83 base::TestSuite::Shutdown(); | 83 base::TestSuite::Shutdown(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace test | 86 } // namespace test |
| 87 } // namespace ui | 87 } // namespace ui |
| OLD | NEW |