test_suite.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
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 3// found in the LICENSE file. 4 5#include "ash/test/test_suite.h" 6 7#include "base/file_path.h" 8#include "base/path_service.h" 9#include "build/build_config.h" 10#include "ui/base/resource/resource_bundle.h" 11#include "ui/base/ui_base_paths.h" 12#include "ui/compositor/compositor_setup.h" 13#include "ui/compositor/test/compositor_test_support.h" 14#include "ui/gfx/gfx_paths.h" 15 16#if defined(OS_MACOSX) 17#include "ash/test/test_suite_init.h" 18#endif 19 20namespace ash { 21namespace test { 22 23AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) 24 : TestSuite(argc, argv) {} 25 26void AuraShellTestSuite::Initialize() { 27 base::TestSuite::Initialize(); 28 29 gfx::RegisterPathProvider(); 30 ui::RegisterPathProvider(); 31 32#if defined(OS_MACOSX) 33 ash::test::OverrideFrameworkBundle(); 34#endif 35 36 // Force unittests to run using en-US so if we test against string 37 // output, it'll pass regardless of the system language. 38 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 39 ui::CompositorTestSupport::Initialize(); 40 ui::SetupTestCompositor(); 41} 42 43void AuraShellTestSuite::Shutdown() { 44 ui::CompositorTestSupport::Terminate(); 45 ui::ResourceBundle::CleanupSharedInstance(); 46 base::TestSuite::Shutdown(); 47} 48 49} // namespace test 50} // namespace ash 51