OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 return nullptr; | 282 return nullptr; |
283 } | 283 } |
284 | 284 |
285 // This is a PointerVector because the address of a ThreadInfo object is | 285 // This is a PointerVector because the address of a ThreadInfo object is |
286 // passed to each thread’s ThreadMain(), so they cannot move around in memory. | 286 // passed to each thread’s ThreadMain(), so they cannot move around in memory. |
287 PointerVector<ThreadInfo> thread_infos_; | 287 PointerVector<ThreadInfo> thread_infos_; |
288 | 288 |
289 DISALLOW_COPY_AND_ASSIGN(TestThreadPool); | 289 DISALLOW_COPY_AND_ASSIGN(TestThreadPool); |
290 }; | 290 }; |
291 | 291 |
292 typedef std::map<uint64_t, TestThreadPool::ThreadExpectation> ThreadMap; | 292 using ThreadMap = std::map<uint64_t, TestThreadPool::ThreadExpectation>; |
293 | 293 |
294 // Verifies that all of the threads in |threads|, obtained from ProcessReader, | 294 // Verifies that all of the threads in |threads|, obtained from ProcessReader, |
295 // agree with the expectation in |thread_map|. If |tolerate_extra_threads| is | 295 // agree with the expectation in |thread_map|. If |tolerate_extra_threads| is |
296 // true, |threads| is allowed to contain threads that are not listed in | 296 // true, |threads| is allowed to contain threads that are not listed in |
297 // |thread_map|. This is useful when testing situations where code outside of | 297 // |thread_map|. This is useful when testing situations where code outside of |
298 // the test’s control (such as system libraries) may start threads, or may have | 298 // the test’s control (such as system libraries) may start threads, or may have |
299 // started threads prior to a test’s execution. | 299 // started threads prior to a test’s execution. |
300 void ExpectSeveralThreads(ThreadMap* thread_map, | 300 void ExpectSeveralThreads(ThreadMap* thread_map, |
301 const std::vector<ProcessReader::Thread>& threads, | 301 const std::vector<ProcessReader::Thread>& threads, |
302 const bool tolerate_extra_threads) { | 302 const bool tolerate_extra_threads) { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 }; | 683 }; |
684 | 684 |
685 TEST(ProcessReader, ChildModules) { | 685 TEST(ProcessReader, ChildModules) { |
686 ProcessReaderModulesChild process_reader_modules_child; | 686 ProcessReaderModulesChild process_reader_modules_child; |
687 process_reader_modules_child.Run(); | 687 process_reader_modules_child.Run(); |
688 } | 688 } |
689 | 689 |
690 } // namespace | 690 } // namespace |
691 } // namespace test | 691 } // namespace test |
692 } // namespace crashpad | 692 } // namespace crashpad |
OLD | NEW |