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

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

Issue 370973004: Update V8 histogram/counter API usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/chrome_unit_test_suite.h ('k') | content/renderer/render_thread_impl.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/metrics/stats_table.h"
10 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
11 #include "chrome/browser/chrome_content_browser_client.h" 10 #include "chrome/browser/chrome_content_browser_client.h"
12 #include "chrome/browser/omaha_query_params/chrome_omaha_query_params_delegate.h " 11 #include "chrome/browser/omaha_query_params/chrome_omaha_query_params_delegate.h "
13 #include "chrome/common/chrome_content_client.h" 12 #include "chrome/common/chrome_content_client.h"
14 #include "chrome/common/chrome_paths.h" 13 #include "chrome/common/chrome_paths.h"
15 #include "chrome/test/base/testing_browser_process.h" 14 #include "chrome/test/base/testing_browser_process.h"
16 #include "chrome/utility/chrome_content_utility_client.h" 15 #include "chrome/utility/chrome_content_utility_client.h"
17 #include "components/omaha_query_params/omaha_query_params.h" 16 #include "components/omaha_query_params/omaha_query_params.h"
18 #include "content/public/common/content_paths.h" 17 #include "content/public/common/content_paths.h"
19 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // Add an additional listener to do the extra initialization for unit tests. 92 // Add an additional listener to do the extra initialization for unit tests.
94 // It will be started before the base class listeners and ended after the 93 // It will be started before the base class listeners and ended after the
95 // base class listeners. 94 // base class listeners.
96 testing::TestEventListeners& listeners = 95 testing::TestEventListeners& listeners =
97 testing::UnitTest::GetInstance()->listeners(); 96 testing::UnitTest::GetInstance()->listeners();
98 listeners.Append(new ChromeUnitTestSuiteInitializer); 97 listeners.Append(new ChromeUnitTestSuiteInitializer);
99 98
100 InitializeProviders(); 99 InitializeProviders();
101 RegisterInProcessThreads(); 100 RegisterInProcessThreads();
102 101
103 // Create an anonymous stats table since we don't need to share between
104 // processes.
105 stats_table_.reset(
106 new base::StatsTable(base::StatsTable::TableIdentifier(), 20, 200));
107 base::StatsTable::set_current(stats_table_.get());
108
109 ChromeTestSuite::Initialize(); 102 ChromeTestSuite::Initialize();
110 103
111 // This needs to run after ChromeTestSuite::Initialize which calls content's 104 // This needs to run after ChromeTestSuite::Initialize which calls content's
112 // intialization which calls base's which initializes ICU. 105 // intialization which calls base's which initializes ICU.
113 InitializeResourceBundle(); 106 InitializeResourceBundle();
114 } 107 }
115 108
116 void ChromeUnitTestSuite::Shutdown() { 109 void ChromeUnitTestSuite::Shutdown() {
117 ResourceBundle::CleanupSharedInstance(); 110 ResourceBundle::CleanupSharedInstance();
118
119 base::StatsTable::set_current(NULL);
120 stats_table_.reset();
121
122 ChromeTestSuite::Shutdown(); 111 ChromeTestSuite::Shutdown();
123 } 112 }
124 113
125 void ChromeUnitTestSuite::InitializeProviders() { 114 void ChromeUnitTestSuite::InitializeProviders() {
126 { 115 {
127 ChromeContentClient content_client; 116 ChromeContentClient content_client;
128 RegisterContentSchemes(&content_client); 117 RegisterContentSchemes(&content_client);
129 } 118 }
130 119
131 chrome::RegisterPathProvider(); 120 chrome::RegisterPathProvider();
(...skipping 28 matching lines...) Expand all
160 #if defined(OS_MACOSX) && !defined(OS_IOS) 149 #if defined(OS_MACOSX) && !defined(OS_IOS)
161 PathService::Get(base::DIR_MODULE, &resources_pack_path); 150 PathService::Get(base::DIR_MODULE, &resources_pack_path);
162 resources_pack_path = 151 resources_pack_path =
163 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); 152 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak"));
164 #else 153 #else
165 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); 154 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
166 #endif 155 #endif
167 ResourceBundle::GetSharedInstance().AddDataPackFromPath( 156 ResourceBundle::GetSharedInstance().AddDataPackFromPath(
168 resources_pack_path, ui::SCALE_FACTOR_NONE); 157 resources_pack_path, ui::SCALE_FACTOR_NONE);
169 } 158 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_unit_test_suite.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698