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

Side by Side Diff: base/trace_event/trace_event_unittest.cc

Issue 1207823004: PlatformThreadHandle: remove public id() interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the last two nits Created 5 years, 5 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
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 <math.h> 5 #include <math.h>
6 #include <cstdlib> 6 #include <cstdlib>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 threads[i] = new Thread(StringPrintf("Thread %d", i)); 1542 threads[i] = new Thread(StringPrintf("Thread %d", i));
1543 1543
1544 // Enable tracing. 1544 // Enable tracing.
1545 BeginTrace(); 1545 BeginTrace();
1546 1546
1547 // Now run some trace code on these threads. 1547 // Now run some trace code on these threads.
1548 WaitableEvent* task_complete_events[kNumThreads]; 1548 WaitableEvent* task_complete_events[kNumThreads];
1549 for (int i = 0; i < kNumThreads; i++) { 1549 for (int i = 0; i < kNumThreads; i++) {
1550 task_complete_events[i] = new WaitableEvent(false, false); 1550 task_complete_events[i] = new WaitableEvent(false, false);
1551 threads[i]->Start(); 1551 threads[i]->Start();
1552 thread_ids[i] = threads[i]->thread_id(); 1552 thread_ids[i] = threads[i]->GetThreadId();
1553 threads[i]->task_runner()->PostTask( 1553 threads[i]->task_runner()->PostTask(
1554 FROM_HERE, base::Bind(&TraceManyInstantEvents, i, kNumEvents, 1554 FROM_HERE, base::Bind(&TraceManyInstantEvents, i, kNumEvents,
1555 task_complete_events[i])); 1555 task_complete_events[i]));
1556 } 1556 }
1557 for (int i = 0; i < kNumThreads; i++) { 1557 for (int i = 0; i < kNumThreads; i++) {
1558 task_complete_events[i]->Wait(); 1558 task_complete_events[i]->Wait();
1559 } 1559 }
1560 1560
1561 // Shut things down. 1561 // Shut things down.
1562 for (int i = 0; i < kNumThreads; i++) { 1562 for (int i = 0; i < kNumThreads; i++) {
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 } 2959 }
2960 2960
2961 TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) { 2961 TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) {
2962 const char filter[] = "DELAY(test.Delay;16;oneshot)"; 2962 const char filter[] = "DELAY(test.Delay;16;oneshot)";
2963 TraceConfig config(filter, ""); 2963 TraceConfig config(filter, "");
2964 EXPECT_EQ(filter, config.ToCategoryFilterString()); 2964 EXPECT_EQ(filter, config.ToCategoryFilterString());
2965 } 2965 }
2966 2966
2967 } // namespace trace_event 2967 } // namespace trace_event
2968 } // namespace base 2968 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | components/scheduler/child/webthread_impl_for_worker_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698