Chromium Code Reviews| 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( | |
|
sky
2015/03/13 22:54:12
Do you need any cleanup code in Shutdown or the li
reveman
2015/03/13 23:08:21
No, this is a set once at startup kind of thing an
| |
| 115 &discardable_memory_allocator_); | |
| 113 } | 116 } |
| 114 | 117 |
| 115 void ChromeUnitTestSuite::Shutdown() { | 118 void ChromeUnitTestSuite::Shutdown() { |
| 116 ResourceBundle::CleanupSharedInstance(); | 119 ResourceBundle::CleanupSharedInstance(); |
| 117 ChromeTestSuite::Shutdown(); | 120 ChromeTestSuite::Shutdown(); |
| 118 } | 121 } |
| 119 | 122 |
| 120 void ChromeUnitTestSuite::InitializeProviders() { | 123 void ChromeUnitTestSuite::InitializeProviders() { |
| 121 { | 124 { |
| 122 ChromeContentClient content_client; | 125 ChromeContentClient content_client; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 #if defined(OS_MACOSX) && !defined(OS_IOS) | 166 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 164 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 167 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
| 165 resources_pack_path = | 168 resources_pack_path = |
| 166 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 169 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
| 167 #else | 170 #else |
| 168 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 171 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
| 169 #endif | 172 #endif |
| 170 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 173 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 171 resources_pack_path, ui::SCALE_FACTOR_NONE); | 174 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 172 } | 175 } |
| OLD | NEW |