Chromium Code Reviews| 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" |
| 11 #include "ui/base/resource/resource_handle.h" | |
|
oshima
2012/04/26 15:27:55
duplicate?
sail
2012/05/01 04:16:02
oh no, handle vs bundle
| |
| 11 #include "ui/base/ui_base_paths.h" | 12 #include "ui/base/ui_base_paths.h" |
| 12 #include "ui/gfx/gfx_paths.h" | 13 #include "ui/gfx/gfx_paths.h" |
| 13 | 14 |
| 14 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
| 15 #include "base/mac/bundle_locations.h" | 16 #include "base/mac/bundle_locations.h" |
| 16 #endif | 17 #endif |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| 19 namespace test { | 20 namespace test { |
| 20 | 21 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 47 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); | 48 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); |
| 48 PathService::Override(ui::DIR_LOCALES, pak_dir); | 49 PathService::Override(ui::DIR_LOCALES, pak_dir); |
| 49 #endif // defined(OS_MACOSX) | 50 #endif // defined(OS_MACOSX) |
| 50 | 51 |
| 51 // Force unittests to run using en-US so if we test against string | 52 // Force unittests to run using en-US so if we test against string |
| 52 // output, it'll pass regardless of the system language. | 53 // output, it'll pass regardless of the system language. |
| 53 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US"); | 54 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US"); |
| 54 | 55 |
| 55 #if !defined(OS_MACOSX) && defined(OS_POSIX) | 56 #if !defined(OS_MACOSX) && defined(OS_POSIX) |
| 56 ui::ResourceBundle::GetSharedInstance().AddDataPack( | 57 ui::ResourceBundle::GetSharedInstance().AddDataPack( |
| 57 pak_dir.AppendASCII("ui_resources.pak")); | 58 pak_dir.AppendASCII("ui_resources.pak"), ResourceHandle::kScaleFactor1x); |
| 58 #endif | 59 #endif |
| 59 } | 60 } |
| 60 | 61 |
| 61 void UITestSuite::Shutdown() { | 62 void UITestSuite::Shutdown() { |
| 62 ui::ResourceBundle::CleanupSharedInstance(); | 63 ui::ResourceBundle::CleanupSharedInstance(); |
| 63 | 64 |
| 64 #if defined(OS_MACOSX) | 65 #if defined(OS_MACOSX) |
| 65 base::mac::SetOverrideFrameworkBundle(NULL); | 66 base::mac::SetOverrideFrameworkBundle(NULL); |
| 66 #endif | 67 #endif |
| 67 base::TestSuite::Shutdown(); | 68 base::TestSuite::Shutdown(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace test | 71 } // namespace test |
| 71 } // namespace ui | 72 } // namespace ui |
| OLD | NEW |