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 "ui/base/resource/resource_bundle.h"
12 #include "ui/base/ui_base_paths.h"
13 #include "ui/gl/gl_surface.h"
15 class ViewTestSuite
: public base::TestSuite
{
17 ViewTestSuite(int argc
, char** argv
) : base::TestSuite(argc
, argv
) {}
20 virtual void Initialize() OVERRIDE
{
21 base::TestSuite::Initialize();
22 gfx::GLSurface::InitializeOneOffForTests();
23 ui::RegisterPathProvider();
25 base::FilePath pak_dir
;
26 PathService::Get(base::DIR_MODULE
, &pak_dir
);
28 base::FilePath pak_file
;
29 pak_file
= pak_dir
.Append(FILE_PATH_LITERAL("ui_test.pak"));
31 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file
);
34 virtual void Shutdown() OVERRIDE
{
35 ui::ResourceBundle::CleanupSharedInstance();
36 base::TestSuite::Shutdown();
40 DISALLOW_COPY_AND_ASSIGN(ViewTestSuite
);
43 int main(int argc
, char** argv
) {
44 ViewTestSuite
test_suite(argc
, argv
);
46 return base::LaunchUnitTests(
47 argc
, argv
, base::Bind(&ViewTestSuite::Run
,
48 base::Unretained(&test_suite
)));