MacViews: Get c/b/ui/views/tabs to build on Mac
[chromium-blink-merge.git] / ui / app_list / test / run_all_unittests.cc
blobb730cfb78112e914dd7e16211457273ed714fbe9
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"
6 #include "base/bind.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"
15 #if defined(OS_MACOSX)
16 #include "base/test/mock_chrome_application_mac.h"
17 #else
18 #include "ui/gl/gl_surface.h"
19 #endif
21 namespace {
23 class AppListTestSuite : public base::TestSuite {
24 public:
25 AppListTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
27 protected:
28 void Initialize() override {
29 #if defined(OS_MACOSX)
30 mock_cr_app::RegisterMockCrApp();
31 #else
32 gfx::GLSurface::InitializeOneOffForTests();
33 #endif
34 base::TestSuite::Initialize();
35 ui::RegisterPathProvider();
37 base::FilePath ui_test_pak_path;
38 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
39 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
42 void Shutdown() override {
43 ui::ResourceBundle::CleanupSharedInstance();
44 base::TestSuite::Shutdown();
47 private:
48 DISALLOW_COPY_AND_ASSIGN(AppListTestSuite);
51 } // namespace
53 int main(int argc, char** argv) {
54 AppListTestSuite test_suite(argc, argv);
56 return base::LaunchUnitTests(
57 argc,
58 argv,
59 base::Bind(&AppListTestSuite::Run, base::Unretained(&test_suite)));