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

Side by Side Diff: base/test/parallel_test_launcher.h

Issue 24398002: GTTF: instantiate ThreadChecker early in the test launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/test/test_launcher.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef BASE_TEST_PARALLEL_TEST_LAUNCHER_H_ 5 #ifndef BASE_TEST_PARALLEL_TEST_LAUNCHER_H_
6 #define BASE_TEST_PARALLEL_TEST_LAUNCHER_H_ 6 #define BASE_TEST_PARALLEL_TEST_LAUNCHER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 size_t sequence_number, 73 size_t sequence_number,
74 const LaunchChildGTestProcessCallback& callback, 74 const LaunchChildGTestProcessCallback& callback,
75 int exit_code, 75 int exit_code,
76 const TimeDelta& elapsed_time, 76 const TimeDelta& elapsed_time,
77 bool was_timeout, 77 bool was_timeout,
78 const std::string& output); 78 const std::string& output);
79 79
80 // Called by the delay timer when no output was made for a while. 80 // Called by the delay timer when no output was made for a while.
81 void OnOutputTimeout(); 81 void OnOutputTimeout();
82 82
83 // Make sure we don't accidentally call the wrong methods e.g. on the worker
84 // pool thread. With lots of callbacks used this is non-trivial.
85 // Should be the first member so that it's destroyed last: when destroying
86 // other members, especially the worker pool, we may check the code is running
87 // on the correct thread.
88 ThreadChecker thread_checker_;
89
83 // Watchdog timer to make sure we do not go without output for too long. 90 // Watchdog timer to make sure we do not go without output for too long.
84 DelayTimer<ParallelTestLauncher> timer_; 91 DelayTimer<ParallelTestLauncher> timer_;
85 92
86 // Monotonically increasing sequence number to uniquely identify each 93 // Monotonically increasing sequence number to uniquely identify each
87 // launched child process. 94 // launched child process.
88 size_t launch_sequence_number_; 95 size_t launch_sequence_number_;
89 96
90 // Map of currently running child processes, keyed by the sequence number. 97 // Map of currently running child processes, keyed by the sequence number.
91 typedef std::map<size_t, CommandLine> RunningProcessesMap; 98 typedef std::map<size_t, CommandLine> RunningProcessesMap;
92 RunningProcessesMap running_processes_map_; 99 RunningProcessesMap running_processes_map_;
93 100
94 // Worker pool used to launch processes in parallel. 101 // Worker pool used to launch processes in parallel.
95 scoped_ptr<SequencedWorkerPoolOwner> worker_pool_owner_; 102 scoped_ptr<SequencedWorkerPoolOwner> worker_pool_owner_;
96 103
97 // Make sure we don't accidentally call the wrong methods e.g. on the worker
98 // pool thread. With lots of callbacks used this is non-trivial.
99 ThreadChecker thread_checker_;
100
101 DISALLOW_COPY_AND_ASSIGN(ParallelTestLauncher); 104 DISALLOW_COPY_AND_ASSIGN(ParallelTestLauncher);
102 }; 105 };
103 106
104 } // namespace base 107 } // namespace base
105 108
106 #endif // BASE_TEST_PARALLEL_TEST_LAUNCHER_H_ 109 #endif // BASE_TEST_PARALLEL_TEST_LAUNCHER_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698