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

Side by Side Diff: base/threading/simple_thread_unittest.cc

Issue 2213933003: Change EXPECT/ASSERT_DCHECK_DEATH macro to not expose the |regex| parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b2b0_simplethreadJoinable
Patch Set: Disabling a death test which crashed instead of DCHECKing : http://crbug.com/634552 Created 4 years, 4 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/threading/non_thread_safe_unittest.cc ('k') | base/threading/thread_restrictions.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 <memory> 5 #include <memory>
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/test/gtest_util.h" 10 #include "base/test/gtest_util.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::string("event_waiter/") + IntToString(thread.tid())); 146 std::string("event_waiter/") + IntToString(thread.tid()));
147 } 147 }
148 148
149 TEST(SimpleThreadTest, JoinNonJoinableThreadDeath) { 149 TEST(SimpleThreadTest, JoinNonJoinableThreadDeath) {
150 SleepRunner runner; 150 SleepRunner runner;
151 SimpleThread::Options options; 151 SimpleThread::Options options;
152 options.joinable = false; 152 options.joinable = false;
153 DelegateSimpleThread thread(&runner, "noop_runner", options); 153 DelegateSimpleThread thread(&runner, "noop_runner", options);
154 154
155 thread.Start(); 155 thread.Start();
156 EXPECT_DCHECK_DEATH(thread.Join(), ""); 156 EXPECT_DCHECK_DEATH(thread.Join());
157 } 157 }
158 158
159 TEST(SimpleThreadTest, DeleteNonJoinableWithoutJoinIsSafe) { 159 TEST(SimpleThreadTest, DeleteNonJoinableWithoutJoinIsSafe) {
160 SleepRunner runner; 160 SleepRunner runner;
161 SimpleThread::Options options; 161 SimpleThread::Options options;
162 options.joinable = false; 162 options.joinable = false;
163 DelegateSimpleThread thread(&runner, "noop_runner", options); 163 DelegateSimpleThread thread(&runner, "noop_runner", options);
164 thread.Start(); 164 thread.Start();
165 // Nothing blows up when |thread| goes out of scope. 165 // Nothing blows up when |thread| goes out of scope.
166 } 166 }
(...skipping 25 matching lines...) Expand all
192 VerifyPoolRunner verifier(&seq2, 9, &event); 192 VerifyPoolRunner verifier(&seq2, 9, &event);
193 pool.Start(); 193 pool.Start();
194 194
195 pool.AddWork(&verifier, 10); 195 pool.AddWork(&verifier, 10);
196 196
197 pool.JoinAll(); 197 pool.JoinAll();
198 EXPECT_EQ(seq2.GetNext(), 10); 198 EXPECT_EQ(seq2.GetNext(), 10);
199 } 199 }
200 200
201 } // namespace base 201 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/non_thread_safe_unittest.cc ('k') | base/threading/thread_restrictions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698