Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/base/ui_base_paths.h" | 13 #include "ui/base/ui_base_paths.h" |
| 14 | 14 |
| 15 #if !defined(OS_MACOSX) | 15 #if !defined(OS_MACOSX) |
|
Mark Mentovai
2014/10/17 19:44:58
Now that these have an else clause, they’d probabl
Robert Sesek
2014/10/17 21:02:29
Done.
| |
| 16 #include "ui/gl/gl_surface.h" | 16 #include "ui/gl/gl_surface.h" |
| 17 #else | |
| 18 #include "base/test/mock_chrome_application_mac.h" | |
| 17 #endif | 19 #endif |
| 18 | 20 |
| 19 namespace { | 21 namespace { |
| 20 | 22 |
| 21 class AppListTestSuite : public base::TestSuite { | 23 class AppListTestSuite : public base::TestSuite { |
| 22 public: | 24 public: |
| 23 AppListTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 25 AppListTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 24 | 26 |
| 25 protected: | 27 protected: |
| 26 virtual void Initialize() override { | 28 virtual void Initialize() override { |
| 27 #if !defined(OS_MACOSX) | 29 #if !defined(OS_MACOSX) |
| 28 gfx::GLSurface::InitializeOneOffForTests(); | 30 gfx::GLSurface::InitializeOneOffForTests(); |
| 31 #else | |
| 32 mock_cr_app::RegisterMockCrApp(); | |
| 29 #endif | 33 #endif |
| 30 base::TestSuite::Initialize(); | 34 base::TestSuite::Initialize(); |
| 31 ui::RegisterPathProvider(); | 35 ui::RegisterPathProvider(); |
| 32 | 36 |
| 33 base::FilePath ui_test_pak_path; | 37 base::FilePath ui_test_pak_path; |
| 34 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 38 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 35 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 39 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 36 } | 40 } |
| 37 | 41 |
| 38 virtual void Shutdown() override { | 42 virtual void Shutdown() override { |
| 39 ui::ResourceBundle::CleanupSharedInstance(); | 43 ui::ResourceBundle::CleanupSharedInstance(); |
| 40 base::TestSuite::Shutdown(); | 44 base::TestSuite::Shutdown(); |
| 41 } | 45 } |
| 42 | 46 |
| 43 private: | 47 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(AppListTestSuite); | 48 DISALLOW_COPY_AND_ASSIGN(AppListTestSuite); |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 } // namespace | 51 } // namespace |
| 48 | 52 |
| 49 int main(int argc, char** argv) { | 53 int main(int argc, char** argv) { |
| 50 AppListTestSuite test_suite(argc, argv); | 54 AppListTestSuite test_suite(argc, argv); |
| 51 | 55 |
| 52 return base::LaunchUnitTests( | 56 return base::LaunchUnitTests( |
| 53 argc, | 57 argc, |
| 54 argv, | 58 argv, |
| 55 base::Bind(&AppListTestSuite::Run, base::Unretained(&test_suite))); | 59 base::Bind(&AppListTestSuite::Run, base::Unretained(&test_suite))); |
| 56 } | 60 } |
| OLD | NEW |