Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: tests/standalone/io/sleep_test.dart

Issue 13704003: Reapply "Add a sleep function to dart:io" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added "hide sleep" where needed Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/process.dart ('k') | utils/pub/command_cache.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/sleep_test.dart
diff --git a/tests/standalone/io/process_set_exit_code_script.dart b/tests/standalone/io/sleep_test.dart
similarity index 50%
copy from tests/standalone/io/process_set_exit_code_script.dart
copy to tests/standalone/io/sleep_test.dart
index 9a34f052a14619eff51b43f7b0e620f0ee8dbf41..d953bf9f1a29536b9cc5652ebbb4380f91448304 100644
--- a/tests/standalone/io/process_set_exit_code_script.dart
+++ b/tests/standalone/io/sleep_test.dart
@@ -4,8 +4,16 @@
import "dart:io";
+test(int milliseconds) {
+ var watch = new Stopwatch();
+ watch.start();
+ sleep(new Duration(milliseconds: milliseconds));
Bob Nystrom 2013/04/05 15:51:57 How about a test for passing a zero duration? Nega
Søren Gjesse 2013/04/08 08:05:59 Good point. See https://codereview.chromium.org/13
+ watch.stop();
+ Expect.isTrue(watch.elapsedMilliseconds + 1 >= milliseconds);
+}
+
main() {
- stdout.write("standard out");
- stderr.write("standard error");
- exitCode = 25;
+ test(1);
+ test(10);
+ test(100);
}
« no previous file with comments | « sdk/lib/io/process.dart ('k') | utils/pub/command_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698