| 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_discardable_memory_shmem_allocator.h" | 10 #include "base/test/test_discardable_memory_allocator.h" |
| 11 #include "base/test/test_suite.h" | 11 #include "base/test/test_suite.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 14 #include "ui/base/ui_base_paths.h" | 14 #include "ui/base/ui_base_paths.h" |
| 15 | 15 |
| 16 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
| 17 #include "base/test/mock_chrome_application_mac.h" | 17 #include "base/test/mock_chrome_application_mac.h" |
| 18 #else | 18 #else |
| 19 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
| 20 #endif | 20 #endif |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 #else | 32 #else |
| 33 gfx::GLSurface::InitializeOneOffForTests(); | 33 gfx::GLSurface::InitializeOneOffForTests(); |
| 34 #endif | 34 #endif |
| 35 base::TestSuite::Initialize(); | 35 base::TestSuite::Initialize(); |
| 36 ui::RegisterPathProvider(); | 36 ui::RegisterPathProvider(); |
| 37 | 37 |
| 38 base::FilePath ui_test_pak_path; | 38 base::FilePath ui_test_pak_path; |
| 39 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &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); | 40 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 41 | 41 |
| 42 base::DiscardableMemoryShmemAllocator::SetInstance( | 42 base::DiscardableMemoryAllocator::SetInstance( |
| 43 &discardable_memory_allocator_); | 43 &discardable_memory_allocator_); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void Shutdown() override { | 46 void Shutdown() override { |
| 47 ui::ResourceBundle::CleanupSharedInstance(); | 47 ui::ResourceBundle::CleanupSharedInstance(); |
| 48 base::TestSuite::Shutdown(); | 48 base::TestSuite::Shutdown(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 base::TestDiscardableMemoryShmemAllocator discardable_memory_allocator_; | 52 base::TestDiscardableMemoryAllocator discardable_memory_allocator_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(MessageCenterTestSuite); | 54 DISALLOW_COPY_AND_ASSIGN(MessageCenterTestSuite); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 int main(int argc, char** argv) { | 59 int main(int argc, char** argv) { |
| 60 MessageCenterTestSuite test_suite(argc, argv); | 60 MessageCenterTestSuite test_suite(argc, argv); |
| 61 | 61 |
| 62 return base::LaunchUnitTests( | 62 return base::LaunchUnitTests( |
| 63 argc, | 63 argc, |
| 64 argv, | 64 argv, |
| 65 base::Bind(&MessageCenterTestSuite::Run, base::Unretained(&test_suite))); | 65 base::Bind(&MessageCenterTestSuite::Run, base::Unretained(&test_suite))); |
| 66 } | 66 } |
| OLD | NEW |