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

Side by Side Diff: base/stats_table_unittest.cc

Issue 8160: Enable stats_tabe_unittest.cc on OS X. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
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/stats_table.h" 7 #include "base/stats_table.h"
8 #include "base/stats_counters.h" 8 #include "base/stats_counters.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 #if defined(OS_WIN) 12 #if defined(OS_WIN)
13 #include <process.h> 13 #include <process.h>
14 #include <windows.h> 14 #include <windows.h>
15 #endif 15 #endif
16 16
17 namespace { 17 namespace {
18 class StatsTableTest : public MultiProcessTest { 18 class StatsTableTest : public MultiProcessTest {
19 }; 19 };
20 }
21 20
22 // Open a StatsTable and verify that we can write to each of the 21 // Open a StatsTable and verify that we can write to each of the
23 // locations in the table. 22 // locations in the table.
24 TEST_F(StatsTableTest, VerifySlots) { 23 TEST_F(StatsTableTest, VerifySlots) {
25 const std::wstring kTableName = L"VerifySlotsStatTable"; 24 const std::wstring kTableName = L"VerifySlotsStatTable";
26 const int kMaxThreads = 1; 25 const int kMaxThreads = 1;
27 const int kMaxCounter = 5; 26 const int kMaxCounter = 5;
28 StatsTable table(kTableName, kMaxThreads, kMaxCounter); 27 StatsTable table(kTableName, kMaxThreads, kMaxCounter);
29 28
30 // Register a single thread. 29 // Register a single thread.
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 { 369 {
371 StatsScope<StatsCounterTimer> timer(foo); 370 StatsScope<StatsCounterTimer> timer(foo);
372 StatsScope<StatsRate> timer2(bar); 371 StatsScope<StatsRate> timer2(bar);
373 PlatformThread::Sleep(500); 372 PlatformThread::Sleep(500);
374 } 373 }
375 EXPECT_LE(1000, table.GetCounterValue(L"t:foo")); 374 EXPECT_LE(1000, table.GetCounterValue(L"t:foo"));
376 EXPECT_LE(1000, table.GetCounterValue(L"t:bar")); 375 EXPECT_LE(1000, table.GetCounterValue(L"t:bar"));
377 EXPECT_EQ(2, table.GetCounterValue(L"c:bar")); 376 EXPECT_EQ(2, table.GetCounterValue(L"c:bar"));
378 } 377 }
379 378
379 } // namespace
OLDNEW
« base/process_util_mac.mm ('K') | « base/process_util_mac.mm ('k') | base/test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698