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

Unified Diff: tests/corelib/stopwatch_test.dart

Issue 11265024: Make methods in Stopwatch getters and rename to be more consistent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 2 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 | « tests/co19/co19-runtime.status ('k') | tools/testing/legpad/legpad.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/stopwatch_test.dart
diff --git a/tests/corelib/stopwatch_test.dart b/tests/corelib/stopwatch_test.dart
index e942ea8ecf7556a9c9caa751e674dfab6b9fafe3..48141a3e6963095ddce60a4a23e54ea1c64d0ee4 100644
--- a/tests/corelib/stopwatch_test.dart
+++ b/tests/corelib/stopwatch_test.dart
@@ -12,36 +12,36 @@ class StopwatchTest {
sw.start();
for (int i = 0; i < 10000; i++) {
parseInt(i.toString());
- if (sw.elapsed() > 0) {
+ if (sw.elapsedTicks > 0) {
break;
}
}
- return sw.elapsed() > 0;
+ return sw.elapsedTicks > 0;
}
static bool checkStopping(Stopwatch sw) {
sw.stop();
- int v1 = sw.elapsed();
+ int v1 = sw.elapsedTicks;
Expect.isTrue(v1 > 0); // Expect a non-zero elapsed time.
Stopwatch sw2 = new Stopwatch(); // Used for verification.
sw2.start();
int sw2LastElapsed = 0;
for (int i = 0; i < 100000; i++) {
parseInt(i.toString());
- int v2 = sw.elapsed();
+ int v2 = sw.elapsedTicks;
if (v1 != v2) {
return false;
}
// If sw2 elapsed twice then sw must have advanced too if it wasn't
// stopped.
- if (sw2LastElapsed > 0 && sw2.elapsed() > sw2LastElapsed) {
+ if (sw2LastElapsed > 0 && sw2.elapsedTicks > sw2LastElapsed) {
break;
}
- sw2LastElapsed = sw2.elapsed();
+ sw2LastElapsed = sw2.elapsedTicks;
}
// The test only makes sense if measureable time elapsed and elapsed time
// on the stopped Stopwatch did not increase.
- Expect.isTrue(sw2.elapsed() > 0);
+ Expect.isTrue(sw2.elapsedTicks > 0);
return true;
}
@@ -50,21 +50,21 @@ class StopwatchTest {
sw.start();
for (int i = 0; i < 100000; i++) {
parseInt(i.toString());
- if (sw.elapsed() > 0) {
+ if (sw.elapsedTicks > 0) {
break;
}
}
sw.stop();
- int initial = sw.elapsed();
+ int initial = sw.elapsedTicks;
sw.start();
for (int i = 0; i < 100000; i++) {
parseInt(i.toString());
- if (sw.elapsed() > initial) {
+ if (sw.elapsedTicks > initial) {
break;
}
}
sw.stop();
- Expect.isTrue(sw.elapsed() > initial);
+ Expect.isTrue(sw.elapsedTicks > initial);
}
static checkReset() {
@@ -72,29 +72,29 @@ class StopwatchTest {
sw.start();
for (int i = 0; i < 100000; i++) {
parseInt(i.toString());
- if (sw.elapsed() > 0) {
+ if (sw.elapsedTicks > 0) {
break;
}
}
sw.stop();
sw.reset();
- Expect.equals(0, sw.elapsed());
+ Expect.equals(0, sw.elapsedTicks);
sw.start();
for (int i = 0; i < 100000; i++) {
parseInt(i.toString());
- if (sw.elapsed() > 0) {
+ if (sw.elapsedTicks > 0) {
break;
}
}
sw.reset();
for (int i = 0; i < 100000; i++) {
parseInt(i.toString());
- if (sw.elapsed() > 0) {
+ if (sw.elapsedTicks > 0) {
break;
}
}
sw.stop();
- Expect.isTrue(sw.elapsed() > 0);
+ Expect.isTrue(sw.elapsedTicks > 0);
}
static testMain() {
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tools/testing/legpad/legpad.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698