| 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/aura/test/test_suite.h" | 5 #include "ui/aura/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/ui_base_paths.h" | 11 #include "ui/base/ui_base_paths.h" |
| 12 #include "ui/gfx/compositor/compositor.h" |
| 13 #include "ui/gfx/compositor/test_compositor.h" |
| 12 #include "ui/gfx/gfx_paths.h" | 14 #include "ui/gfx/gfx_paths.h" |
| 13 #include "ui/gfx/gl/gl_implementation.h" | 15 #include "ui/gfx/gl/gl_implementation.h" |
| 14 | 16 |
| 15 namespace aura { | 17 namespace aura { |
| 16 namespace test { | 18 namespace test { |
| 17 | 19 |
| 18 AuraTestSuite::AuraTestSuite(int argc, char** argv) | 20 AuraTestSuite::AuraTestSuite(int argc, char** argv) |
| 19 : TestSuite(argc, argv) {} | 21 : TestSuite(argc, argv) {} |
| 20 | 22 |
| 21 void AuraTestSuite::Initialize() { | 23 void AuraTestSuite::Initialize() { |
| 22 #if defined(OS_LINUX) | 24 #if defined(OS_LINUX) |
| 23 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); | 25 gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); |
| 24 #endif | 26 #endif |
| 25 base::TestSuite::Initialize(); | 27 base::TestSuite::Initialize(); |
| 26 | 28 |
| 27 gfx::RegisterPathProvider(); | 29 gfx::RegisterPathProvider(); |
| 28 ui::RegisterPathProvider(); | 30 ui::RegisterPathProvider(); |
| 29 | 31 |
| 30 // Force unittests to run using en-US so if we test against string | 32 // Force unittests to run using en-US so if we test against string |
| 31 // output, it'll pass regardless of the system language. | 33 // output, it'll pass regardless of the system language. |
| 32 ui::ResourceBundle::InitSharedInstance("en-US"); | 34 ui::ResourceBundle::InitSharedInstance("en-US"); |
| 35 |
| 36 // Use a mock compositor that noops draws. |
| 37 ui::Compositor::set_compositor_factory_for_testing( |
| 38 ui::TestCompositor::Create); |
| 33 } | 39 } |
| 34 | 40 |
| 35 void AuraTestSuite::Shutdown() { | 41 void AuraTestSuite::Shutdown() { |
| 36 ui::ResourceBundle::CleanupSharedInstance(); | 42 ui::ResourceBundle::CleanupSharedInstance(); |
| 37 | 43 |
| 38 base::TestSuite::Shutdown(); | 44 base::TestSuite::Shutdown(); |
| 39 } | 45 } |
| 40 | 46 |
| 41 } // namespace test | 47 } // namespace test |
| 42 } // namespace aura | 48 } // namespace aura |
| OLD | NEW |