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

Side by Side Diff: base/threading/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/thread_restrictions.cc ('k') | no next file » | 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/threading/thread.h" 5 #include "base/threading/thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 a->StopSoon(); 314 a->StopSoon();
315 base::PlatformThread::YieldCurrentThread(); 315 base::PlatformThread::YieldCurrentThread();
316 last_task_event.Wait(); 316 last_task_event.Wait();
317 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(20)); 317 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(20));
318 318
319 // This test assumes that the above was sufficient to let the thread fully 319 // This test assumes that the above was sufficient to let the thread fully
320 // stop. 320 // stop.
321 ASSERT_FALSE(a->IsRunning()); 321 ASSERT_FALSE(a->IsRunning());
322 322
323 // Restarting it should not be allowed. 323 // Restarting it should not be allowed.
324 EXPECT_DCHECK_DEATH(a->Start(), ""); 324 EXPECT_DCHECK_DEATH(a->Start());
325 } 325 }
326 326
327 TEST_F(ThreadTest, ThreadName) { 327 TEST_F(ThreadTest, ThreadName) {
328 Thread a("ThreadName"); 328 Thread a("ThreadName");
329 EXPECT_TRUE(a.Start()); 329 EXPECT_TRUE(a.Start());
330 EXPECT_EQ("ThreadName", a.thread_name()); 330 EXPECT_EQ("ThreadName", a.thread_name());
331 } 331 }
332 332
333 TEST_F(ThreadTest, ThreadId) { 333 TEST_F(ThreadTest, ThreadId) {
334 Thread a("ThreadId0"); 334 Thread a("ThreadId0");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 464
465 a.Stop(); 465 a.Stop();
466 EXPECT_FALSE(a.message_loop()); 466 EXPECT_FALSE(a.message_loop());
467 EXPECT_FALSE(a.IsRunning()); 467 EXPECT_FALSE(a.IsRunning());
468 468
469 // Confirm that running any remaining tasks posted from Stop() goes smoothly 469 // Confirm that running any remaining tasks posted from Stop() goes smoothly
470 // (e.g. https://codereview.chromium.org/2135413003/#ps300001 crashed if 470 // (e.g. https://codereview.chromium.org/2135413003/#ps300001 crashed if
471 // StopSoon() posted Thread::ThreadQuitHelper() while |run_loop_| was null). 471 // StopSoon() posted Thread::ThreadQuitHelper() while |run_loop_| was null).
472 base::RunLoop().RunUntilIdle(); 472 base::RunLoop().RunUntilIdle();
473 } 473 }
OLDNEW
« no previous file with comments | « base/threading/thread_restrictions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698