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

Side by Side Diff: base/task_scheduler/priority_queue_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/priority_queue.h" 5 #include "base/task_scheduler/priority_queue.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 TEST(TaskSchedulerPriorityQueueTest, IllegalTwoTransactionsSameThread) { 131 TEST(TaskSchedulerPriorityQueueTest, IllegalTwoTransactionsSameThread) {
132 PriorityQueue pq_a; 132 PriorityQueue pq_a;
133 PriorityQueue pq_b; 133 PriorityQueue pq_b;
134 134
135 EXPECT_DCHECK_DEATH( 135 EXPECT_DCHECK_DEATH(
136 { 136 {
137 std::unique_ptr<PriorityQueue::Transaction> transaction_a = 137 std::unique_ptr<PriorityQueue::Transaction> transaction_a =
138 pq_a.BeginTransaction(); 138 pq_a.BeginTransaction();
139 std::unique_ptr<PriorityQueue::Transaction> transaction_b = 139 std::unique_ptr<PriorityQueue::Transaction> transaction_b =
140 pq_b.BeginTransaction(); 140 pq_b.BeginTransaction();
141 }, 141 });
142 "");
143 } 142 }
144 143
145 // Check that there is no crash when Transactions are created on the same thread 144 // Check that there is no crash when Transactions are created on the same thread
146 // for 2 PriorityQueues which have a predecessor relationship. 145 // for 2 PriorityQueues which have a predecessor relationship.
147 TEST(TaskSchedulerPriorityQueueTest, LegalTwoTransactionsSameThread) { 146 TEST(TaskSchedulerPriorityQueueTest, LegalTwoTransactionsSameThread) {
148 PriorityQueue pq_a; 147 PriorityQueue pq_a;
149 PriorityQueue pq_b(&pq_a); 148 PriorityQueue pq_b(&pq_a);
150 149
151 // This shouldn't crash. 150 // This shouldn't crash.
152 std::unique_ptr<PriorityQueue::Transaction> transaction_a = 151 std::unique_ptr<PriorityQueue::Transaction> transaction_a =
(...skipping 23 matching lines...) Expand all
176 175
177 // End the Transaction on the current thread. 176 // End the Transaction on the current thread.
178 transaction.reset(); 177 transaction.reset();
179 178
180 // The other thread should exit after its call to BeginTransaction() returns. 179 // The other thread should exit after its call to BeginTransaction() returns.
181 thread_beginning_transaction.Join(); 180 thread_beginning_transaction.Join();
182 } 181 }
183 182
184 } // namespace internal 183 } // namespace internal
185 } // namespace base 184 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/atomic_flag_unittest.cc ('k') | base/task_scheduler/scheduler_lock_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698