1 // Copyright 2014 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_discardable_memory_allocator.h"
11 #include "base/test/test_suite.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"
16 #if defined(OS_MACOSX)
17 #include "base/test/mock_chrome_application_mac.h"
19 #include "ui/gl/test/gl_surface_test_support.h"
24 class MessageCenterTestSuite
: public base::TestSuite
{
26 MessageCenterTestSuite(int argc
, char** argv
) : base::TestSuite(argc
, argv
) {}
29 void Initialize() override
{
30 #if defined(OS_MACOSX)
31 mock_cr_app::RegisterMockCrApp();
33 gfx::GLSurfaceTestSupport::InitializeOneOff();
35 base::TestSuite::Initialize();
36 ui::RegisterPathProvider();
38 base::FilePath ui_test_pak_path
;
39 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK
, &ui_test_pak_path
));
40 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path
);
42 base::DiscardableMemoryAllocator::SetInstance(
43 &discardable_memory_allocator_
);
46 void Shutdown() override
{
47 ui::ResourceBundle::CleanupSharedInstance();
48 base::TestSuite::Shutdown();
52 base::TestDiscardableMemoryAllocator discardable_memory_allocator_
;
54 DISALLOW_COPY_AND_ASSIGN(MessageCenterTestSuite
);
59 int main(int argc
, char** argv
) {
60 MessageCenterTestSuite
test_suite(argc
, argv
);
62 return base::LaunchUnitTests(
65 base::Bind(&MessageCenterTestSuite::Run
, base::Unretained(&test_suite
)));