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

Side by Side Diff: base/stats_table_unittest.cc

Issue 7995: Move Time, TimeDelta and TimeTicks into namespace base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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
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 using base::TimeTicks;
18
17 namespace { 19 namespace {
18 class StatsTableTest : public MultiProcessTest { 20 class StatsTableTest : public MultiProcessTest {
19 }; 21 };
20 } 22 }
21 23
22 // Open a StatsTable and verify that we can write to each of the 24 // Open a StatsTable and verify that we can write to each of the
23 // locations in the table. 25 // locations in the table.
24 TEST_F(StatsTableTest, VerifySlots) { 26 TEST_F(StatsTableTest, VerifySlots) {
25 const std::wstring kTableName = L"VerifySlotsStatTable"; 27 const std::wstring kTableName = L"VerifySlotsStatTable";
26 const int kMaxThreads = 1; 28 const int kMaxThreads = 1;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 { 372 {
371 StatsScope<StatsCounterTimer> timer(foo); 373 StatsScope<StatsCounterTimer> timer(foo);
372 StatsScope<StatsRate> timer2(bar); 374 StatsScope<StatsRate> timer2(bar);
373 PlatformThread::Sleep(500); 375 PlatformThread::Sleep(500);
374 } 376 }
375 EXPECT_LE(1000, table.GetCounterValue(L"t:foo")); 377 EXPECT_LE(1000, table.GetCounterValue(L"t:foo"));
376 EXPECT_LE(1000, table.GetCounterValue(L"t:bar")); 378 EXPECT_LE(1000, table.GetCounterValue(L"t:bar"));
377 EXPECT_EQ(2, table.GetCounterValue(L"c:bar")); 379 EXPECT_EQ(2, table.GetCounterValue(L"c:bar"));
378 } 380 }
379 381
OLDNEW
« no previous file with comments | « base/stats_counters.h ('k') | base/time.h » ('j') | base/time_format.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698