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 "base/basictypes.h"
7 #include "base/compiler_specific.h"
8 #include "base/path_service.h"
9 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.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/gl/test/gl_surface_test_support.h"
17 #include "ui/aura/env.h"
20 class ViewTestSuite
: public base::TestSuite
{
22 ViewTestSuite(int argc
, char** argv
) : base::TestSuite(argc
, argv
) {}
25 void Initialize() override
{
26 base::TestSuite::Initialize();
27 gfx::GLSurfaceTestSupport::InitializeOneOff();
28 ui::RegisterPathProvider();
30 base::FilePath ui_test_pak_path
;
31 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK
, &ui_test_pak_path
));
32 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path
);
34 aura::Env::CreateInstance(true);
38 void Shutdown() override
{
40 aura::Env::DeleteInstance();
42 ui::ResourceBundle::CleanupSharedInstance();
43 base::TestSuite::Shutdown();
47 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite
);
50 int main(int argc
, char** argv
) {
51 ViewTestSuite
test_suite(argc
, argv
);
53 return base::LaunchUnitTests(
54 argc
, argv
, base::Bind(&ViewTestSuite::Run
,
55 base::Unretained(&test_suite
)));