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

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 16948002: Add correct timing collection for new browser controller (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/browser_controller.dart
===================================================================
--- tools/testing/dart/browser_controller.dart (revision 23952)
+++ tools/testing/dart/browser_controller.dart (working copy)
@@ -446,6 +446,7 @@
Function doneCallback;
String url;
int timeout;
+ Stopwatch stopwatch;
// We store this here for easy access when tests time out (instead of
// capturing this in a closure)
Timer timeoutTimer;
@@ -573,6 +574,8 @@
// replaced.
} else if (status.currentTest != null) {
status.currentTest.timeoutTimer.cancel();
+ status.currentTest.stopwatch.stop();
+
if (status.currentTest.id != testId) {
print("Expected test id ${status.currentTest.id} for"
"${status.currentTest.url}");
@@ -582,7 +585,8 @@
throw("This should never happen, wrong test id");
}
testCache[testId] = status.currentTest.url;
- status.currentTest.doneCallback(output);
+ status.currentTest.doneCallback(output,
+ status.currentTest.stopwatch.elapsed);
status.lastTest = status.currentTest;
status.currentTest = null;
} else {
@@ -643,8 +647,9 @@
}
});
});
-
- status.currentTest.doneCallback("TIMEOUT");
+ status.currentTest.stopwatch.stop();
+ status.currentTest.doneCallback("TIMEOUT",
+ status.currentTest.stopwatch.elapsed);
status.currentTest = null;
}
@@ -674,6 +679,7 @@
Timer timer = new Timer(new Duration(seconds: test.timeout),
() { handleTimeout(status); });
status.currentTest.timeoutTimer = timer;
+ status.currentTest.stopwatch = new Stopwatch()..start();
return test;
}
« no previous file with comments | « no previous file | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698