[email protected] | 578c81b | 2012-01-27 07:25:02 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 2f74428 | 2011-12-23 22:40:52 | [diff] [blame] | 5 | #include "ash/test/test_suite.h" |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 6 | |
7 | #include "base/file_path.h" | ||||
8 | #include "base/path_service.h" | ||||
9 | #include "build/build_config.h" | ||||
[email protected] | 41168e2 | 2013-02-13 18:25:43 | [diff] [blame^] | 10 | #include "testing/gtest/include/gtest/gtest.h" |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 11 | #include "ui/base/resource/resource_bundle.h" |
12 | #include "ui/base/ui_base_paths.h" | ||||
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 13 | #include "ui/compositor/compositor_setup.h" |
[email protected] | 2f81e7e | 2012-11-29 00:04:54 | [diff] [blame] | 14 | #include "ui/compositor/test/compositor_test_support.h" |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 15 | #include "ui/gfx/gfx_paths.h" |
[email protected] | 72f08de | 2011-12-09 16:19:03 | [diff] [blame] | 16 | |
[email protected] | a0fea7e | 2012-01-30 17:43:33 | [diff] [blame] | 17 | #if defined(OS_MACOSX) |
18 | #include "ash/test/test_suite_init.h" | ||||
19 | #endif | ||||
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 20 | |
[email protected] | 1c3f700 | 2013-01-21 18:46:05 | [diff] [blame] | 21 | #if defined(OS_WIN) |
22 | #include "base/win/windows_version.h" | ||||
[email protected] | 41168e2 | 2013-02-13 18:25:43 | [diff] [blame^] | 23 | #include "ui/base/win/atl_module.h" |
24 | #include "win8/test/metro_registration_helper.h" | ||||
25 | #include "win8/test/open_with_dialog_controller.h" | ||||
26 | #include "win8/test/test_registrar_constants.h" | ||||
[email protected] | 1c3f700 | 2013-01-21 18:46:05 | [diff] [blame] | 27 | #endif |
28 | |||||
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 29 | namespace ash { |
[email protected] | 6377a00 | 2011-11-10 20:26:47 | [diff] [blame] | 30 | namespace test { |
31 | |||||
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 32 | AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) |
33 | : TestSuite(argc, argv) {} | ||||
34 | |||||
35 | void AuraShellTestSuite::Initialize() { | ||||
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 36 | base::TestSuite::Initialize(); |
37 | |||||
[email protected] | 41168e2 | 2013-02-13 18:25:43 | [diff] [blame^] | 38 | #if defined(OS_WIN) |
39 | if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | ||||
40 | ASSERT_TRUE(win8::RegisterTestDefaultBrowser( | ||||
41 | win8::test::kDefaultTestAppUserModelId, | ||||
42 | win8::test::kDefaultTestExeName)); | ||||
43 | |||||
44 | ui::win::CreateATLModuleIfNeeded(); | ||||
45 | |||||
46 | std::vector<string16> choices; | ||||
47 | win8::OpenWithDialogController controller; | ||||
48 | controller.RunSynchronously(NULL, L"http", win8::test::kDefaultTestExeName, | ||||
49 | &choices); | ||||
50 | } | ||||
51 | #endif | ||||
52 | |||||
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 53 | gfx::RegisterPathProvider(); |
54 | ui::RegisterPathProvider(); | ||||
55 | |||||
[email protected] | a0fea7e | 2012-01-30 17:43:33 | [diff] [blame] | 56 | #if defined(OS_MACOSX) |
57 | ash::test::OverrideFrameworkBundle(); | ||||
[email protected] | 3514ab6 | 2012-02-01 16:25:24 | [diff] [blame] | 58 | #endif |
[email protected] | a0fea7e | 2012-01-30 17:43:33 | [diff] [blame] | 59 | |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 60 | // Force unittests to run using en-US so if we test against string |
61 | // output, it'll pass regardless of the system language. | ||||
[email protected] | fb317a5 | 2012-05-09 15:57:47 | [diff] [blame] | 62 | ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
[email protected] | 2f81e7e | 2012-11-29 00:04:54 | [diff] [blame] | 63 | ui::CompositorTestSupport::Initialize(); |
[email protected] | 72f08de | 2011-12-09 16:19:03 | [diff] [blame] | 64 | ui::SetupTestCompositor(); |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 65 | } |
66 | |||||
67 | void AuraShellTestSuite::Shutdown() { | ||||
[email protected] | 2f81e7e | 2012-11-29 00:04:54 | [diff] [blame] | 68 | ui::CompositorTestSupport::Terminate(); |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 69 | ui::ResourceBundle::CleanupSharedInstance(); |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 70 | base::TestSuite::Shutdown(); |
71 | } | ||||
[email protected] | 6377a00 | 2011-11-10 20:26:47 | [diff] [blame] | 72 | |
73 | } // namespace test | ||||
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 74 | } // namespace ash |