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

Unified Diff: tests/standalone/vmservice/test_helper.dart

Issue 20014002: Provide reasons for expect failures in service test helper. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/standalone/vmservice/multiple_isolate_list_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/vmservice/test_helper.dart
diff --git a/tests/standalone/vmservice/test_helper.dart b/tests/standalone/vmservice/test_helper.dart
index fed4631ceabf1e8c49c41254bbf3ea97f7662c26..1b9efa45dba205c5d1d2d113d73c095cbc87097a 100644
--- a/tests/standalone/vmservice/test_helper.dart
+++ b/tests/standalone/vmservice/test_helper.dart
@@ -33,7 +33,7 @@ abstract class VmServiceRequestHelper {
}
void _requestCompleted(List<int> data, HttpClientResponse response) {
- Expect.equals(200, response.statusCode);
+ Expect.equals(200, response.statusCode, 'Invalid HTTP Status Code');
var replyAsString;
try {
replyAsString = UTF.decodeUtf8(data, 0, null, null);
@@ -49,17 +49,17 @@ abstract class VmServiceRequestHelper {
return;
}
if (reply is! Map) {
- onRequestFailed('Reply was not a map: $reply');
- return;
+ onRequestFailed('Reply was not a map: $reply');
+ return;
}
if (reply['type'] == null) {
- onRequestFailed('Reply does not contain a type key: $reply');
- return;
+ onRequestFailed('Reply does not contain a type key: $reply');
+ return;
}
try {
- onRequestCompleted(reply);
- } catch(e) {
- onRequestFailed('Test callback failed: $e');
+ onRequestCompleted(reply);
+ } catch (e) {
+ onRequestFailed('Test callback failed: $e');
}
}
@@ -127,11 +127,11 @@ class IsolateListTester {
IsolateListTester(this.isolateList) {
// The reply is an IsolateList.
- Expect.equals('IsolateList', isolateList['type']);
+ Expect.equals('IsolateList', isolateList['type'], 'Not an IsolateList.');
}
void checkIsolateCount(int n) {
- Expect.equals(n, isolateList['members'].length);
+ Expect.equals(n, isolateList['members'].length, 'Isolate count not $n');
}
void checkIsolateIdExists(int id) {
@@ -141,7 +141,7 @@ class IsolateListTester {
exists = true;
}
});
- Expect.isTrue(exists);
+ Expect.isTrue(exists, 'No isolate with id: $id');
}
void checkIsolateNameContains(String name) {
@@ -151,7 +151,7 @@ class IsolateListTester {
exists = true;
}
});
- Expect.isTrue(exists);
+ Expect.isTrue(exists, 'No isolate with name: $name');
}
void checkIsolateNamePrefix(int id, String name) {
@@ -159,9 +159,10 @@ class IsolateListTester {
isolateList['members'].forEach((isolate) {
if (isolate['id'] == id) {
exists = true;
- Expect.isTrue(isolate['name'].startsWith(name));
+ Expect.isTrue(isolate['name'].startsWith(name),
+ 'Isolate $id does not have name prefix: $name');
}
});
- Expect.isTrue(exists);
+ Expect.isTrue(exists, 'No isolate with id: $id');
}
}
« no previous file with comments | « tests/standalone/vmservice/multiple_isolate_list_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698