Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/gfx/test_suite.h" | 5 #include "ui/gfx/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/ui_base_paths.h" | 11 #include "ui/base/ui_base_paths.h" |
| 12 #include "ui/gfx/gfx_paths.h" | 12 #include "ui/gfx/gfx_paths.h" |
| 13 | 13 |
| 14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
| 15 #include "base/mac/foundation_util.h" | 15 #include "base/mac/foundation_util.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #if defined(USE_AURA) | |
| 19 #include "ui/gfx/compositor/compositor_test_support.h" | |
| 20 #endif | |
| 21 | |
| 18 GfxTestSuite::GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} | 22 GfxTestSuite::GfxTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} |
| 19 | 23 |
| 20 void GfxTestSuite::Initialize() { | 24 void GfxTestSuite::Initialize() { |
| 21 base::TestSuite::Initialize(); | 25 base::TestSuite::Initialize(); |
| 22 | 26 |
| 23 gfx::RegisterPathProvider(); | 27 gfx::RegisterPathProvider(); |
| 24 ui::RegisterPathProvider(); | 28 ui::RegisterPathProvider(); |
| 25 | 29 |
| 26 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 27 // Look in the framework bundle for resources. | 31 // Look in the framework bundle for resources. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 43 PathService::Get(base::DIR_MODULE, &pak_dir); | 47 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 44 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); | 48 pak_dir = pak_dir.AppendASCII("ui_unittests_strings"); |
| 45 PathService::Override(ui::DIR_LOCALES, pak_dir); | 49 PathService::Override(ui::DIR_LOCALES, pak_dir); |
| 46 PathService::Override(ui::FILE_RESOURCES_PAK, | 50 PathService::Override(ui::FILE_RESOURCES_PAK, |
| 47 pak_dir.AppendASCII("ui_resources.pak")); | 51 pak_dir.AppendASCII("ui_resources.pak")); |
| 48 #endif // defined(OS_MACOSX) | 52 #endif // defined(OS_MACOSX) |
| 49 | 53 |
| 50 // Force unittests to run using en-US so if we test against string | 54 // Force unittests to run using en-US so if we test against string |
| 51 // output, it'll pass regardless of the system language. | 55 // output, it'll pass regardless of the system language. |
| 52 ui::ResourceBundle::InitSharedInstance("en-US"); | 56 ui::ResourceBundle::InitSharedInstance("en-US"); |
| 57 | |
| 58 #if defined(USE_AURA) | |
| 59 ui::CompositorTestSupport::Initialize(); | |
| 60 ui::CompositorTestSupport::SetupMockCompositor(); | |
| 61 #endif | |
| 53 } | 62 } |
| 54 | 63 |
| 55 void GfxTestSuite::Shutdown() { | 64 void GfxTestSuite::Shutdown() { |
| 56 ui::ResourceBundle::CleanupSharedInstance(); | 65 ui::ResourceBundle::CleanupSharedInstance(); |
|
jonathan.backer
2011/10/25 20:13:53
think we need a ui::CompositorTestSupport::Termina
sadrul
2011/10/25 20:28:42
Done.
| |
| 57 | 66 |
| 58 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
| 59 base::mac::SetOverrideAppBundle(NULL); | 68 base::mac::SetOverrideAppBundle(NULL); |
| 60 #endif | 69 #endif |
| 61 base::TestSuite::Shutdown(); | 70 base::TestSuite::Shutdown(); |
| 62 } | 71 } |
| OLD | NEW |