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

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_impl_unittest.cc

Issue 2163023002: Unify usage of logging/assert macros in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix base/android/build_info.cc compile 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 static_assert(
356 ENABLE_THREAD_RESTRICTIONS == DCHECK_IS_ON(),
357 "ENABLE_THREAD_RESTRICTIONS and DCHECK_IS_ON() have diverged.");
358 EXPECT_DCHECK_DEATH({ ThreadRestrictions::AssertIOAllowed(); }, ""); 355 EXPECT_DCHECK_DEATH({ ThreadRestrictions::AssertIOAllowed(); }, "");
359 } 356 }
360 357
361 event->Signal(); 358 event->Signal();
362 } 359 }
363 360
364 class TaskSchedulerWorkerPoolImplIORestrictionTest 361 class TaskSchedulerWorkerPoolImplIORestrictionTest
365 : public testing::TestWithParam<IORestriction> { 362 : public testing::TestWithParam<IORestriction> {
366 public: 363 public:
367 TaskSchedulerWorkerPoolImplIORestrictionTest() = default; 364 TaskSchedulerWorkerPoolImplIORestrictionTest() = default;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 count_waiter->Wait(); 548 count_waiter->Wait();
552 549
553 EXPECT_GT(subtle::NoBarrier_Load(&zero_tls_values_), 0); 550 EXPECT_GT(subtle::NoBarrier_Load(&zero_tls_values_), 0);
554 551
555 // Release tasks waiting on |waiter_|. 552 // Release tasks waiting on |waiter_|.
556 waiter_.Signal(); 553 waiter_.Signal();
557 } 554 }
558 555
559 } // namespace internal 556 } // namespace internal
560 } // namespace base 557 } // namespace base
OLDNEW
« no previous file with comments | « base/task/cancelable_task_tracker_unittest.cc ('k') | base/task_scheduler/task_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698