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: third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc

Issue 2326313003: Revert of Make canceling Timers fast. (Closed)
Patch Set: Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/scheduler/base/work_queue_sets.h" 5 #include "platform/scheduler/base/work_queue_sets.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "platform/scheduler/base/work_queue.h" 10 #include "platform/scheduler/base/work_queue.h"
(...skipping 17 matching lines...) Expand all
28 work_queue_sets_->RemoveQueue(work_queue.get()); 28 work_queue_sets_->RemoveQueue(work_queue.get());
29 } 29 }
30 } 30 }
31 31
32 protected: 32 protected:
33 enum { 33 enum {
34 kNumSets = 5 // An arbitary choice. 34 kNumSets = 5 // An arbitary choice.
35 }; 35 };
36 36
37 WorkQueue* NewTaskQueue(const char* queue_name) { 37 WorkQueue* NewTaskQueue(const char* queue_name) {
38 WorkQueue* queue = new WorkQueue(nullptr, "test"); 38 WorkQueue* queue = new WorkQueue(
39 nullptr, "test", TaskQueueImpl::Task::EnqueueOrderComparatorFn);
39 work_queues_.push_back(base::WrapUnique(queue)); 40 work_queues_.push_back(base::WrapUnique(queue));
40 work_queue_sets_->AddQueue(queue, TaskQueue::CONTROL_PRIORITY); 41 work_queue_sets_->AddQueue(queue, TaskQueue::CONTROL_PRIORITY);
41 return queue; 42 return queue;
42 } 43 }
43 44
44 TaskQueueImpl::Task FakeTaskWithEnqueueOrder(int enqueue_order) { 45 TaskQueueImpl::Task FakeTaskWithEnqueueOrder(int enqueue_order) {
45 TaskQueueImpl::Task fake_task(FROM_HERE, base::Closure(), base::TimeTicks(), 46 TaskQueueImpl::Task fake_task(FROM_HERE, base::Closure(), base::TimeTicks(),
46 0, true); 47 0, true);
47 fake_task.set_enqueue_order(enqueue_order); 48 fake_task.set_enqueue_order(enqueue_order);
48 return fake_task; 49 return fake_task;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 EXPECT_FALSE(work_queue_sets_->IsSetEmpty(set)); 305 EXPECT_FALSE(work_queue_sets_->IsSetEmpty(set));
305 306
306 work_queue->PopTaskForTest(); 307 work_queue->PopTaskForTest();
307 work_queue_sets_->OnPopQueue(work_queue); 308 work_queue_sets_->OnPopQueue(work_queue);
308 EXPECT_TRUE(work_queue_sets_->IsSetEmpty(set)); 309 EXPECT_TRUE(work_queue_sets_->IsSetEmpty(set));
309 } 310 }
310 311
311 } // namespace internal 312 } // namespace internal
312 } // namespace scheduler 313 } // namespace scheduler
313 } // namespace blink 314 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698