test_task_runner.h 826 B

1234567891011121314151617181920212223242526
  1. // Copyright 2017 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. #ifndef COMPONENTS_OFFLINE_PAGES_TASK_TEST_TASK_RUNNER_H_
  5. #define COMPONENTS_OFFLINE_PAGES_TASK_TEST_TASK_RUNNER_H_
  6. #include <memory>
  7. namespace offline_pages {
  8. class Task;
  9. // Tool for running (task queue related) tasks in test.
  10. class TestTaskRunner {
  11. public:
  12. // Runs task with expectation that it correctly completes.
  13. // Task is also cleaned up after completing.
  14. static void RunTask(std::unique_ptr<Task> task);
  15. // Runs task with expectation that it correctly completes.
  16. // Task is not cleaned up after completing.
  17. static void RunTask(Task* task);
  18. };
  19. } // namespace offline_pages
  20. #endif // COMPONENTS_OFFLINE_PAGES_TASK_TEST_TASK_RUNNER_H_