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 28 matching lines...) Expand all Loading... |
39 path = path.AppendASCII("Chromium Framework.framework"); | 39 path = path.AppendASCII("Chromium Framework.framework"); |
40 #else | 40 #else |
41 #error Unknown branding | 41 #error Unknown branding |
42 #endif | 42 #endif |
43 base::mac::SetOverrideFrameworkBundlePath(path); | 43 base::mac::SetOverrideFrameworkBundlePath(path); |
44 #elif defined(OS_POSIX) | 44 #elif defined(OS_POSIX) |
45 FilePath pak_dir; | 45 FilePath pak_dir; |
46 PathService::Get(base::DIR_MODULE, &pak_dir); | 46 PathService::Get(base::DIR_MODULE, &pak_dir); |
47 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); | 47 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); |
48 PathService::Override(ui::DIR_LOCALES, pak_dir); | 48 PathService::Override(ui::DIR_LOCALES, pak_dir); |
49 PathService::Override(ui::FILE_RESOURCES_PAK, | |
50 pak_dir.AppendASCII("ui_resources.pak")); | |
51 #endif // defined(OS_MACOSX) | 49 #endif // defined(OS_MACOSX) |
52 | 50 |
53 // Force unittests to run using en-US so if we test against string | 51 // Force unittests to run using en-US so if we test against string |
54 // output, it'll pass regardless of the system language. | 52 // output, it'll pass regardless of the system language. |
55 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US"); | 53 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US"); |
| 54 |
| 55 #if !defined(OS_MACOSX) && defined(OS_POSIX) |
| 56 ui::ResourceBundle::GetSharedInstance().AddDataPack( |
| 57 pak_dir.AppendASCII("ui_resources.pak")); |
| 58 #endif |
56 } | 59 } |
57 | 60 |
58 void UITestSuite::Shutdown() { | 61 void UITestSuite::Shutdown() { |
59 ui::ResourceBundle::CleanupSharedInstance(); | 62 ui::ResourceBundle::CleanupSharedInstance(); |
60 | 63 |
61 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
62 base::mac::SetOverrideFrameworkBundle(NULL); | 65 base::mac::SetOverrideFrameworkBundle(NULL); |
63 #endif | 66 #endif |
64 base::TestSuite::Shutdown(); | 67 base::TestSuite::Shutdown(); |
65 } | 68 } |
66 | 69 |
67 } // namespace test | 70 } // namespace test |
68 } // namespace ui | 71 } // namespace ui |
OLD | NEW |