| 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 "ash/test/test_suite.h" | 5 #include "ash/test/test_suite.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 namespace test { | 26 namespace test { |
| 27 | 27 |
| 28 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) | 28 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) |
| 29 : TestSuite(argc, argv) {} | 29 : TestSuite(argc, argv) {} |
| 30 | 30 |
| 31 void AuraShellTestSuite::Initialize() { | 31 void AuraShellTestSuite::Initialize() { |
| 32 base::TestSuite::Initialize(); | 32 base::TestSuite::Initialize(); |
| 33 gfx::GLSurface::InitializeOneOffForTests(true); | 33 gfx::GLSurface::InitializeOneOffForTests(); |
| 34 | 34 |
| 35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 36 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 36 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 37 !CommandLine::ForCurrentProcess()->HasSwitch( | 37 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 38 ash::switches::kForceAshToDesktop)) { | 38 ash::switches::kForceAshToDesktop)) { |
| 39 com_initializer_.reset(new base::win::ScopedCOMInitializer()); | 39 com_initializer_.reset(new base::win::ScopedCOMInitializer()); |
| 40 ui::win::CreateATLModuleIfNeeded(); | 40 ui::win::CreateATLModuleIfNeeded(); |
| 41 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously()); | 41 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously()); |
| 42 } | 42 } |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 gfx::RegisterPathProvider(); | 45 gfx::RegisterPathProvider(); |
| 46 ui::RegisterPathProvider(); | 46 ui::RegisterPathProvider(); |
| 47 | 47 |
| 48 // Force unittests to run using en-US so if we test against string | 48 // Force unittests to run using en-US so if we test against string |
| 49 // output, it'll pass regardless of the system language. | 49 // output, it'll pass regardless of the system language. |
| 50 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 50 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void AuraShellTestSuite::Shutdown() { | 53 void AuraShellTestSuite::Shutdown() { |
| 54 ui::ResourceBundle::CleanupSharedInstance(); | 54 ui::ResourceBundle::CleanupSharedInstance(); |
| 55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 56 com_initializer_.reset(); | 56 com_initializer_.reset(); |
| 57 #endif | 57 #endif |
| 58 base::TestSuite::Shutdown(); | 58 base::TestSuite::Shutdown(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace test | 61 } // namespace test |
| 62 } // namespace ash | 62 } // namespace ash |
| OLD | NEW |