blob: 7ffe3b211e44654ad192466f769186d1cfecfb44 [file] [log] [blame]
[email protected]578c81b2012-01-27 07:25:021// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]2b99f8c2011-10-11 19:42:242// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]2f744282011-12-23 22:40:525#include "ash/test/test_suite.h"
[email protected]2b99f8c2011-10-11 19:42:246
7#include "base/file_path.h"
8#include "base/path_service.h"
9#include "build/build_config.h"
[email protected]41168e22013-02-13 18:25:4310#include "testing/gtest/include/gtest/gtest.h"
[email protected]2b99f8c2011-10-11 19:42:2411#include "ui/base/resource/resource_bundle.h"
12#include "ui/base/ui_base_paths.h"
[email protected]116302fc2012-05-05 21:45:4113#include "ui/compositor/compositor_setup.h"
[email protected]2f81e7e2012-11-29 00:04:5414#include "ui/compositor/test/compositor_test_support.h"
[email protected]2b99f8c2011-10-11 19:42:2415#include "ui/gfx/gfx_paths.h"
[email protected]72f08de2011-12-09 16:19:0316
[email protected]a0fea7e2012-01-30 17:43:3317#if defined(OS_MACOSX)
18#include "ash/test/test_suite_init.h"
19#endif
[email protected]2b99f8c2011-10-11 19:42:2420
[email protected]1c3f7002013-01-21 18:46:0521#if defined(OS_WIN)
22#include "base/win/windows_version.h"
[email protected]41168e22013-02-13 18:25:4323#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]1c3f7002013-01-21 18:46:0527#endif
28
[email protected]55f593352011-12-24 05:42:4629namespace ash {
[email protected]6377a002011-11-10 20:26:4730namespace test {
31
[email protected]2b99f8c2011-10-11 19:42:2432AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv)
33 : TestSuite(argc, argv) {}
34
35void AuraShellTestSuite::Initialize() {
[email protected]2b99f8c2011-10-11 19:42:2436 base::TestSuite::Initialize();
37
[email protected]41168e22013-02-13 18:25:4338#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]2b99f8c2011-10-11 19:42:2453 gfx::RegisterPathProvider();
54 ui::RegisterPathProvider();
55
[email protected]a0fea7e2012-01-30 17:43:3356#if defined(OS_MACOSX)
57 ash::test::OverrideFrameworkBundle();
[email protected]3514ab62012-02-01 16:25:2458#endif
[email protected]a0fea7e2012-01-30 17:43:3359
[email protected]2b99f8c2011-10-11 19:42:2460 // 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]fb317a52012-05-09 15:57:4762 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
[email protected]2f81e7e2012-11-29 00:04:5463 ui::CompositorTestSupport::Initialize();
[email protected]72f08de2011-12-09 16:19:0364 ui::SetupTestCompositor();
[email protected]2b99f8c2011-10-11 19:42:2465}
66
67void AuraShellTestSuite::Shutdown() {
[email protected]2f81e7e2012-11-29 00:04:5468 ui::CompositorTestSupport::Terminate();
[email protected]2b99f8c2011-10-11 19:42:2469 ui::ResourceBundle::CleanupSharedInstance();
[email protected]2b99f8c2011-10-11 19:42:2470 base::TestSuite::Shutdown();
71}
[email protected]6377a002011-11-10 20:26:4772
73} // namespace test
[email protected]55f593352011-12-24 05:42:4674} // namespace ash