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