1 // Copyright 2018 The Fuchsia 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 ZIRCON_SYSTEM_UTEST_FIT_EXAMPLES_UTILS_H_ 6 #define ZIRCON_SYSTEM_UTEST_FIT_EXAMPLES_UTILS_H_ 7 8 #include <lib/fit/promise.h> 9 10 namespace utils { 11 12 // Returns a task that completes a little later. 13 // Used by examples to simulate the passage of time in asynchronous logic. 14 fit::promise<> sleep_for_a_little_while(); 15 16 // Resumes the task after some time has elapsed. 17 // Used by examples to simulate the passage of time in asynchronous logic. 18 void resume_in_a_little_while(fit::suspended_task task); 19 20 } // namespace utils 21 22 #endif // ZIRCON_SYSTEM_UTEST_FIT_EXAMPLES_UTILS_H_ 23