• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_TASK_SEQUENCE_MANAGER_TEST_TEST_TASK_QUEUE_H_
6 #define BASE_TASK_SEQUENCE_MANAGER_TEST_TEST_TASK_QUEUE_H_
7 
8 #include "base/memory/weak_ptr.h"
9 #include "base/task/sequence_manager/task_queue.h"
10 
11 namespace base {
12 namespace sequence_manager {
13 
14 class TestTaskQueue : public TaskQueue {
15  public:
16   explicit TestTaskQueue(std::unique_ptr<internal::TaskQueueImpl> impl,
17                          const TaskQueue::Spec& spec);
18 
19   using TaskQueue::GetTaskQueueImpl;
20 
21   WeakPtr<TestTaskQueue> GetWeakPtr();
22 
23  private:
24   ~TestTaskQueue() override;  // Ref-counted.
25 
26   // Used to ensure that task queue is deleted in tests.
27   WeakPtrFactory<TestTaskQueue> weak_factory_;
28 };
29 
30 }  // namespace sequence_manager
31 }  // namespace base
32 
33 #endif  // BASE_TASK_SEQUENCE_MANAGER_TEST_TEST_TASK_QUEUE_H_
34