1 // Copyright 2014 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 CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 6 #define CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 7 8 #include "base/basictypes.h" 9 #include "base/compiler_specific.h" 10 #include "base/test/test_simple_task_runner.h" 11 12 namespace cc { 13 14 // This runs pending tasks based on task's post_time + delay. 15 // We should not execute a delayed task sooner than some of the queued tasks 16 // which don't have a delay even though it is queued early. 17 class OrderedSimpleTaskRunner : public base::TestSimpleTaskRunner { 18 public: 19 OrderedSimpleTaskRunner(); 20 21 virtual void RunPendingTasks() OVERRIDE; 22 23 protected: 24 virtual ~OrderedSimpleTaskRunner(); 25 26 private: 27 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner); 28 }; 29 30 } // namespace cc 31 32 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 33