Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/test/base/chrome_unit_test_suite.cc

Issue 1004043002: Re-land: base: Implement browser process support for discardable memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set allocator instance for blink tests Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/base/chrome_unit_test_suite.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_);
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
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 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_unit_test_suite.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698