| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/test/base/chrome_unit_test_suite.h" | 5 #include "chrome/test/base/chrome_unit_test_suite.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/chrome_content_browser_client.h" | 10 #include "chrome/browser/chrome_content_browser_client.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 listeners.Append(new ChromeUnitTestSuiteInitializer); | 103 listeners.Append(new ChromeUnitTestSuiteInitializer); |
| 104 | 104 |
| 105 InitializeProviders(); | 105 InitializeProviders(); |
| 106 RegisterInProcessThreads(); | 106 RegisterInProcessThreads(); |
| 107 | 107 |
| 108 ChromeTestSuite::Initialize(); | 108 ChromeTestSuite::Initialize(); |
| 109 | 109 |
| 110 // This needs to run after ChromeTestSuite::Initialize which calls content's | 110 // This needs to run after ChromeTestSuite::Initialize which calls content's |
| 111 // intialization which calls base's which initializes ICU. | 111 // intialization which calls base's which initializes ICU. |
| 112 InitializeResourceBundle(); | 112 InitializeResourceBundle(); |
| 113 | |
| 114 base::DiscardableMemoryShmemAllocator::SetInstance( | |
| 115 &discardable_memory_allocator_); | |
| 116 } | 113 } |
| 117 | 114 |
| 118 void ChromeUnitTestSuite::Shutdown() { | 115 void ChromeUnitTestSuite::Shutdown() { |
| 119 ResourceBundle::CleanupSharedInstance(); | 116 ResourceBundle::CleanupSharedInstance(); |
| 120 ChromeTestSuite::Shutdown(); | 117 ChromeTestSuite::Shutdown(); |
| 121 } | 118 } |
| 122 | 119 |
| 123 void ChromeUnitTestSuite::InitializeProviders() { | 120 void ChromeUnitTestSuite::InitializeProviders() { |
| 124 { | 121 { |
| 125 ChromeContentClient content_client; | 122 ChromeContentClient content_client; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 #if defined(OS_MACOSX) && !defined(OS_IOS) | 163 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 167 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 164 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
| 168 resources_pack_path = | 165 resources_pack_path = |
| 169 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 166 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
| 170 #else | 167 #else |
| 171 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 168 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
| 172 #endif | 169 #endif |
| 173 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 170 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 174 resources_pack_path, ui::SCALE_FACTOR_NONE); | 171 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 175 } | 172 } |
| OLD | NEW |