Remove existing Skia suppressions
[chromium-blink-merge.git] / ash / test / test_suite.cc
blobd368a2120a2c90fe349148b40039b59ed7b3fe66
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 "build/build_config.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/base/ui_base_paths.h"
14 #include "ui/gfx/gfx_paths.h"
15 #include "ui/gl/gl_surface.h"
17 #if defined(OS_WIN)
18 #include "base/win/windows_version.h"
19 #include "ui/base/win/atl_module.h"
20 #include "win8/test/metro_registration_helper.h"
21 #include "win8/test/test_registrar_constants.h"
22 #endif
24 namespace ash {
25 namespace test {
27 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv)
28 : TestSuite(argc, argv) {
31 AuraShellTestSuite::~AuraShellTestSuite() {
34 void AuraShellTestSuite::Initialize() {
35 base::TestSuite::Initialize();
36 gfx::GLSurface::InitializeOneOffForTests();
38 #if defined(OS_WIN)
39 base::win::Version version = base::win::GetVersion();
40 // Although Ash officially is only supported for users on Win7+, we still run
41 // ash_unittests on Vista builders, so we still need to initialize COM.
42 if (version >= base::win::VERSION_VISTA &&
43 !base::CommandLine::ForCurrentProcess()->HasSwitch(
44 ash::switches::kForceAshToDesktop)) {
45 com_initializer_.reset(new base::win::ScopedCOMInitializer());
46 ui::win::CreateATLModuleIfNeeded();
47 if (version >= base::win::VERSION_WIN8)
48 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously());
50 #endif
52 gfx::RegisterPathProvider();
53 ui::RegisterPathProvider();
55 // Force unittests to run using en-US so if we test against string
56 // output, it'll pass regardless of the system language.
57 ui::ResourceBundle::InitSharedInstanceWithLocale(
58 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
60 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
63 void AuraShellTestSuite::Shutdown() {
64 ui::ResourceBundle::CleanupSharedInstance();
65 #if defined(OS_WIN)
66 com_initializer_.reset();
67 #endif
68 base::TestSuite::Shutdown();
71 } // namespace test
72 } // namespace ash