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

Side by Side Diff: base/stats_table_unittest.cc

Issue 24004: Fix the windows implementation of KillProcess and WaitForSingleProcess to not... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « base/process_util_win.cc ('k') | chrome/browser/message_window.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/multiprocess_test.h" 5 #include "base/multiprocess_test.h"
6 #include "base/platform_thread.h" 6 #include "base/platform_thread.h"
7 #include "base/simple_thread.h" 7 #include "base/simple_thread.h"
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "base/stats_table.h" 9 #include "base/stats_table.h"
10 #include "base/stats_counters.h" 10 #include "base/stats_counters.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 // Spawn the processes. 204 // Spawn the processes.
205 for (int16 index = 0; index < kMaxProcs; index++) { 205 for (int16 index = 0; index < kMaxProcs; index++) {
206 procs[index] = this->SpawnChild(L"StatsTableMultipleProcessMain"); 206 procs[index] = this->SpawnChild(L"StatsTableMultipleProcessMain");
207 EXPECT_NE(static_cast<ProcessHandle>(NULL), procs[index]); 207 EXPECT_NE(static_cast<ProcessHandle>(NULL), procs[index]);
208 } 208 }
209 209
210 // Wait for the processes to finish. 210 // Wait for the processes to finish.
211 for (int index = 0; index < kMaxProcs; index++) { 211 for (int index = 0; index < kMaxProcs; index++) {
212 EXPECT_TRUE(WaitForSingleProcess(procs[index], 60 * 1000)); 212 EXPECT_TRUE(WaitForSingleProcess(procs[index], 60 * 1000));
213 base::CloseProcessHandle(procs[index]);
213 } 214 }
214 215
215 StatsCounter zero_counter(kCounterZero); 216 StatsCounter zero_counter(kCounterZero);
216 StatsCounter lucky13_counter(kCounter1313); 217 StatsCounter lucky13_counter(kCounter1313);
217 StatsCounter increment_counter(kCounterIncrement); 218 StatsCounter increment_counter(kCounterIncrement);
218 StatsCounter decrement_counter(kCounterDecrement); 219 StatsCounter decrement_counter(kCounterDecrement);
219 220
220 // Verify the various counters are correct. 221 // Verify the various counters are correct.
221 std::string name; 222 std::string name;
222 name = "c:" + kCounterZero; 223 name = "c:" + kCounterZero;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 PlatformThread::Sleep(500); 394 PlatformThread::Sleep(500);
394 } 395 }
395 EXPECT_LE(1000, table.GetCounterValue("t:foo")); 396 EXPECT_LE(1000, table.GetCounterValue("t:foo"));
396 EXPECT_LE(1000, table.GetCounterValue("t:bar")); 397 EXPECT_LE(1000, table.GetCounterValue("t:bar"));
397 EXPECT_EQ(2, table.GetCounterValue("c:bar")); 398 EXPECT_EQ(2, table.GetCounterValue("c:bar"));
398 399
399 DeleteShmem(kTableName); 400 DeleteShmem(kTableName);
400 } 401 }
401 402
402 } // namespace base 403 } // namespace base
OLDNEW
« no previous file with comments | « base/process_util_win.cc ('k') | chrome/browser/message_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698