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

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_impl_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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/task_scheduler/scheduler_worker_pool_impl.h" 5 #include "base/task_scheduler/scheduler_worker_pool_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 345 }
346 346
347 // Verifies that the current thread allows I/O if |io_restriction| is ALLOWED 347 // Verifies that the current thread allows I/O if |io_restriction| is ALLOWED
348 // and disallows it otherwise. Signals |event| before returning. 348 // and disallows it otherwise. Signals |event| before returning.
349 void ExpectIORestriction(IORestriction io_restriction, WaitableEvent* event) { 349 void ExpectIORestriction(IORestriction io_restriction, WaitableEvent* event) {
350 DCHECK(event); 350 DCHECK(event);
351 351
352 if (io_restriction == IORestriction::ALLOWED) { 352 if (io_restriction == IORestriction::ALLOWED) {
353 ThreadRestrictions::AssertIOAllowed(); 353 ThreadRestrictions::AssertIOAllowed();
354 } else { 354 } else {
355 EXPECT_DCHECK_DEATH({ ThreadRestrictions::AssertIOAllowed(); }, ""); 355 EXPECT_DCHECK_DEATH({ ThreadRestrictions::AssertIOAllowed(); });
356 } 356 }
357 357
358 event->Signal(); 358 event->Signal();
359 } 359 }
360 360
361 class TaskSchedulerWorkerPoolImplIORestrictionTest 361 class TaskSchedulerWorkerPoolImplIORestrictionTest
362 : public testing::TestWithParam<IORestriction> { 362 : public testing::TestWithParam<IORestriction> {
363 public: 363 public:
364 TaskSchedulerWorkerPoolImplIORestrictionTest() = default; 364 TaskSchedulerWorkerPoolImplIORestrictionTest() = default;
365 365
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 count_waiter->Wait(); 548 count_waiter->Wait();
549 549
550 EXPECT_GT(subtle::NoBarrier_Load(&zero_tls_values_), 0); 550 EXPECT_GT(subtle::NoBarrier_Load(&zero_tls_values_), 0);
551 551
552 // Release tasks waiting on |waiter_|. 552 // Release tasks waiting on |waiter_|.
553 waiter_.Signal(); 553 waiter_.Signal();
554 } 554 }
555 555
556 } // namespace internal 556 } // namespace internal
557 } // namespace base 557 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_lock_unittest.cc ('k') | base/task_scheduler/scheduler_worker_stack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698