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

Side by Side Diff: tests/os/sleep_test.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « tests/os/native_process_test.dart ('k') | tests/pkg/dartino_agent/messages_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'dart:fletch.os' as os; 5 import 'dart:dartino.os' as os;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 8
9 void main() { 9 void main() {
10 // Sleep 200 ms. 10 // Sleep 200 ms.
11 int ms = 200; 11 int ms = 200;
12 Stopwatch stopwatch = new Stopwatch()..start(); 12 Stopwatch stopwatch = new Stopwatch()..start();
13 os.sleep(ms); 13 os.sleep(ms);
14 // There is a chance that it'll resume slightly early on some system, so we 14 // There is a chance that it'll resume slightly early on some system, so we
15 // just ensure that at least 50% of the time is spent sleeping. 15 // just ensure that at least 50% of the time is spent sleeping.
16 int elapsed = stopwatch.elapsedMilliseconds; 16 int elapsed = stopwatch.elapsedMilliseconds;
17 Expect.isTrue(elapsed >= ms ~/ 2, "$elapsed >= ${ms ~/ 2}"); 17 Expect.isTrue(elapsed >= ms ~/ 2, "$elapsed >= ${ms ~/ 2}");
18 } 18 }
OLDNEW
« no previous file with comments | « tests/os/native_process_test.dart ('k') | tests/pkg/dartino_agent/messages_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698