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

Side by Side Diff: tests/corelib/stopwatch_test.dart

Issue 12342027: - Give the stop watch more time to tick. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Dart test program for testing stopwatch support. 5 // Dart test program for testing stopwatch support.
6 6
7 library stopwatch_test; 7 library stopwatch_test;
8 8
9 class StopwatchTest { 9 class StopwatchTest {
10 static bool checkTicking(Stopwatch sw) { 10 static bool checkTicking(Stopwatch sw) {
11 Expect.isFalse(sw.isRunning); 11 Expect.isFalse(sw.isRunning);
12 sw.start(); 12 sw.start();
13 Expect.isTrue(sw.isRunning); 13 Expect.isTrue(sw.isRunning);
14 for (int i = 0; i < 10000; i++) { 14 for (int i = 0; i < 1000000; i++) {
15 int.parse(i.toString()); 15 int.parse(i.toString());
16 if (sw.elapsedTicks > 0) { 16 if (sw.elapsedTicks > 0) {
17 break; 17 break;
18 } 18 }
19 } 19 }
20 return sw.elapsedTicks > 0; 20 return sw.elapsedTicks > 0;
21 } 21 }
22 22
23 static bool checkStopping(Stopwatch sw) { 23 static bool checkStopping(Stopwatch sw) {
24 sw.stop(); 24 sw.stop();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 Expect.isTrue(checkTicking(sw)); 117 Expect.isTrue(checkTicking(sw));
118 Expect.isTrue(checkStopping(sw)); 118 Expect.isTrue(checkStopping(sw));
119 checkRestart(); 119 checkRestart();
120 checkReset(); 120 checkReset();
121 } 121 }
122 } 122 }
123 123
124 main() { 124 main() {
125 StopwatchTest.testMain(); 125 StopwatchTest.testMain();
126 } 126 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698