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

Side by Side Diff: base/metrics/stats_table_unittest.cc

Issue 580213002: Disable TLS destructor tests on Win x64 incremental (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 6 years, 3 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
« no previous file with comments | « base/base.gyp ('k') | base/threading/thread_local_storage_unittest.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) 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/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 #include "base/metrics/stats_counters.h" 6 #include "base/metrics/stats_counters.h"
7 #include "base/metrics/stats_table.h" 7 #include "base/metrics/stats_table.h"
8 #include "base/process/kill.h" 8 #include "base/process/kill.h"
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (id_ % 2) 94 if (id_ % 2)
95 mixed_counter.Decrement(); 95 mixed_counter.Decrement();
96 else 96 else
97 mixed_counter.Increment(); 97 mixed_counter.Increment();
98 PlatformThread::Sleep(TimeDelta::FromMilliseconds(index % 10)); 98 PlatformThread::Sleep(TimeDelta::FromMilliseconds(index % 10));
99 } 99 }
100 } 100 }
101 101
102 // Create a few threads and have them poke on their counters. 102 // Create a few threads and have them poke on their counters.
103 // See http://crbug.com/10611 for more information. 103 // See http://crbug.com/10611 for more information.
104 #if defined(OS_MACOSX) || defined(THREAD_SANITIZER) 104 // It is disabled on Win x64 incremental linking pending resolution of
105 // http://crbug.com/251251.
106 #if defined(OS_MACOSX) || defined(THREAD_SANITIZER) || \
107 (defined(OS_WIN) && defined(ARCH_CPU_X86_64) && \
108 defined(INCREMENTAL_LINKING))
105 #define MAYBE_MultipleThreads DISABLED_MultipleThreads 109 #define MAYBE_MultipleThreads DISABLED_MultipleThreads
106 #else 110 #else
107 #define MAYBE_MultipleThreads MultipleThreads 111 #define MAYBE_MultipleThreads MultipleThreads
108 #endif 112 #endif
109 TEST_F(StatsTableTest, MAYBE_MultipleThreads) { 113 TEST_F(StatsTableTest, MAYBE_MultipleThreads) {
110 // Create a stats table. 114 // Create a stats table.
111 const int kMaxThreads = 20; 115 const int kMaxThreads = 20;
112 const int kMaxCounter = 5; 116 const int kMaxCounter = 5;
113 StatsTable table(StatsTable::TableIdentifier(), kMaxThreads, kMaxCounter); 117 StatsTable table(StatsTable::TableIdentifier(), kMaxThreads, kMaxCounter);
114 StatsTable::set_current(&table); 118 StatsTable::set_current(&table);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 StatsScope<StatsCounterTimer> timer(foo); 393 StatsScope<StatsCounterTimer> timer(foo);
390 StatsScope<StatsRate> timer2(bar); 394 StatsScope<StatsRate> timer2(bar);
391 PlatformThread::Sleep(kDuration); 395 PlatformThread::Sleep(kDuration);
392 } 396 }
393 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:foo")); 397 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:foo"));
394 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:bar")); 398 EXPECT_LE(kDuration.InMilliseconds() * 2, table.GetCounterValue("t:bar"));
395 EXPECT_EQ(2, table.GetCounterValue("c:bar")); 399 EXPECT_EQ(2, table.GetCounterValue("c:bar"));
396 } 400 }
397 401
398 } // namespace base 402 } // namespace base
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | base/threading/thread_local_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698