OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/metrics/stats_counters.h" | 5 #include "base/metrics/stats_counters.h" |
6 #include "base/metrics/stats_table.h" | 6 #include "base/metrics/stats_table.h" |
7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "base/test/multiprocess_test.h" | 10 #include "base/test/multiprocess_test.h" |
11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
12 #include "base/threading/simple_thread.h" | 12 #include "base/threading/simple_thread.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "testing/multiprocess_func_list.h" | 15 #include "testing/multiprocess_func_list.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 | 18 |
19 class StatsTableTest : public MultiProcessTest { | 19 class StatsTableTest : public MultiProcessTest { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 PlatformThread::Sleep(kDuration); | 414 PlatformThread::Sleep(kDuration); |
415 } | 415 } |
416 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:foo")); | 416 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:foo")); |
417 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:bar")); | 417 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:bar")); |
418 EXPECT_EQ(2, table.GetCounterValue("c:bar")); | 418 EXPECT_EQ(2, table.GetCounterValue("c:bar")); |
419 | 419 |
420 DeleteShmem(kTableName); | 420 DeleteShmem(kTableName); |
421 } | 421 } |
422 | 422 |
423 } // namespace base | 423 } // namespace base |
OLD | NEW |