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

Unified Diff: chrome/test/base/chrome_unit_test_suite.cc

Issue 224713017: Remove IPC dependency from base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit tests Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/chrome_unit_test_suite.cc
diff --git a/chrome/test/base/chrome_unit_test_suite.cc b/chrome/test/base/chrome_unit_test_suite.cc
index 65f453b4b95582e40f8123c38b023f09ff7aeee4..37659c48e63b7a19caf095e8efa31a0d52e4d606 100644
--- a/chrome/test/base/chrome_unit_test_suite.cc
+++ b/chrome/test/base/chrome_unit_test_suite.cc
@@ -36,15 +36,6 @@
namespace {
-void RemoveSharedMemoryFile(const std::string& filename) {
- // Stats uses SharedMemory under the hood. On posix, this results in a file
- // on disk.
-#if defined(OS_POSIX)
- base::SharedMemory memory;
- memory.Delete(filename);
-#endif
-}
-
// Creates a TestingBrowserProcess for each test.
class ChromeUnitTestSuiteInitializer : public testing::EmptyTestEventListener {
public:
@@ -107,10 +98,10 @@ void ChromeUnitTestSuite::Initialize() {
InitializeProviders();
RegisterInProcessThreads();
- stats_filename_ = base::StringPrintf("unit_tests-%d",
- base::GetCurrentProcId());
- RemoveSharedMemoryFile(stats_filename_);
- stats_table_.reset(new base::StatsTable(stats_filename_, 20, 200));
+ // Create an anonymous stats table since we don't need to share between
+ // processes.
+ stats_table_.reset(
+ new base::StatsTable(base::StatsTable::TableIdentifier(), 20, 200));
base::StatsTable::set_current(stats_table_.get());
ChromeTestSuite::Initialize();
@@ -125,7 +116,6 @@ void ChromeUnitTestSuite::Shutdown() {
base::StatsTable::set_current(NULL);
stats_table_.reset();
- RemoveSharedMemoryFile(stats_filename_);
ChromeTestSuite::Shutdown();
}

Powered by Google App Engine
This is Rietveld 408576698