[DevTools] Reenable some DevTools tests, which should be fixed on blink side.
[chromium-blink-merge.git] / ash / test / test_suite.cc
blob7955264789c56448dc18aa3e54b921d80c400044
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.
5 #include "ash/test/test_suite.h"
7 #include "ash/ash_switches.h"
8 #include "base/command_line.h"
9 #include "base/files/file_path.h"
10 #include "base/path_service.h"
11 #include "build/build_config.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/base/ui_base_paths.h"
15 #include "ui/gfx/gfx_paths.h"
16 #include "ui/gl/gl_surface.h"
18 #if defined(OS_WIN)
19 #include "base/win/windows_version.h"
20 #include "ui/base/win/atl_module.h"
21 #include "win8/test/metro_registration_helper.h"
22 #include "win8/test/test_registrar_constants.h"
23 #endif
25 namespace ash {
26 namespace test {
28 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv)
29 : TestSuite(argc, argv) {}
31 void AuraShellTestSuite::Initialize() {
32 base::TestSuite::Initialize();
33 gfx::GLSurface::InitializeOneOffForTests();
35 #if defined(OS_WIN)
36 base::win::Version version = base::win::GetVersion();
37 // Although Ash officially is only supported for users on Win7+, we still run
38 // ash_unittests on Vista builders, so we still need to initialize COM.
39 if (version >= base::win::VERSION_VISTA &&
40 !CommandLine::ForCurrentProcess()->HasSwitch(
41 ash::switches::kForceAshToDesktop)) {
42 com_initializer_.reset(new base::win::ScopedCOMInitializer());
43 ui::win::CreateATLModuleIfNeeded();
44 if (version >= base::win::VERSION_WIN8)
45 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously());
47 #endif
49 gfx::RegisterPathProvider();
50 ui::RegisterPathProvider();
52 // Force unittests to run using en-US so if we test against string
53 // output, it'll pass regardless of the system language.
54 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
57 void AuraShellTestSuite::Shutdown() {
58 ui::ResourceBundle::CleanupSharedInstance();
59 #if defined(OS_WIN)
60 com_initializer_.reset();
61 #endif
62 base::TestSuite::Shutdown();
65 } // namespace test
66 } // namespace ash