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 "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/compositor/compositor_setup.h" | 12 #include "ui/compositor/compositor_setup.h" |
13 #include "ui/compositor/test/compositor_test_support.h" | 13 #include "ui/compositor/test/compositor_test_support.h" |
14 #include "ui/gfx/gfx_paths.h" | 14 #include "ui/gfx/gfx_paths.h" |
15 | 15 |
16 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
17 #include "ash/test/test_suite_init.h" | 17 #include "ash/test/test_suite_init.h" |
18 #endif | 18 #endif |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
22 #include "ui/base/win/atl_module.h" | |
23 #include "win8/test/metro_registration_helper.h" | |
24 #include "win8/test/open_with_dialog_controller.h" | |
25 #include "win8/test/test_registrar_constants.h" | |
22 #endif | 26 #endif |
23 | 27 |
24 namespace ash { | 28 namespace ash { |
25 namespace test { | 29 namespace test { |
26 | 30 |
27 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) | 31 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) |
28 : TestSuite(argc, argv) {} | 32 : TestSuite(argc, argv) {} |
29 | 33 |
30 void AuraShellTestSuite::Initialize() { | 34 void AuraShellTestSuite::Initialize() { |
31 base::TestSuite::Initialize(); | 35 base::TestSuite::Initialize(); |
32 | 36 |
37 #if defined(OS_WIN) | |
38 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | |
39 CHECK(win8::RegisterTestDefaultBrowser( | |
sky
2013/02/12 22:31:42
ASSERT
| |
40 win8::test::kDefaultTestAppUserModelId, | |
41 win8::test::kDefaultTestExeName)); | |
42 | |
43 ui::win::CreateATLModuleIfNeeded(); | |
44 | |
45 std::vector<string16> choices; | |
46 win8::OpenWithDialogController controller; | |
47 controller.RunSynchronously(NULL, L"http", win8::test::kDefaultTestExeName, | |
48 &choices); | |
49 } | |
50 #endif | |
51 | |
33 gfx::RegisterPathProvider(); | 52 gfx::RegisterPathProvider(); |
34 ui::RegisterPathProvider(); | 53 ui::RegisterPathProvider(); |
35 | 54 |
36 #if defined(OS_MACOSX) | 55 #if defined(OS_MACOSX) |
37 ash::test::OverrideFrameworkBundle(); | 56 ash::test::OverrideFrameworkBundle(); |
38 #endif | 57 #endif |
39 | 58 |
40 // Force unittests to run using en-US so if we test against string | 59 // Force unittests to run using en-US so if we test against string |
41 // output, it'll pass regardless of the system language. | 60 // output, it'll pass regardless of the system language. |
42 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 61 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
43 ui::CompositorTestSupport::Initialize(); | 62 ui::CompositorTestSupport::Initialize(); |
44 ui::SetupTestCompositor(); | 63 ui::SetupTestCompositor(); |
45 } | 64 } |
46 | 65 |
47 void AuraShellTestSuite::Shutdown() { | 66 void AuraShellTestSuite::Shutdown() { |
48 ui::CompositorTestSupport::Terminate(); | 67 ui::CompositorTestSupport::Terminate(); |
49 ui::ResourceBundle::CleanupSharedInstance(); | 68 ui::ResourceBundle::CleanupSharedInstance(); |
50 base::TestSuite::Shutdown(); | 69 base::TestSuite::Shutdown(); |
51 } | 70 } |
52 | 71 |
53 } // namespace test | 72 } // namespace test |
54 } // namespace ash | 73 } // namespace ash |
OLD | NEW |