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