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

Unified Diff: pkg/json_rpc_2/test/server/server_test.dart

Issue 207323004: Make the json_rpc_2 server test dart2js-compatible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/json_rpc_2/test/server/server_test.dart
diff --git a/pkg/json_rpc_2/test/server/server_test.dart b/pkg/json_rpc_2/test/server/server_test.dart
index f1e0af5c7d70fcedc2017ea10c55adbd26e2f06e..fc3adb527efc8783374632b612ba3cf7e614a02e 100644
--- a/pkg/json_rpc_2/test/server/server_test.dart
+++ b/pkg/json_rpc_2/test/server/server_test.dart
@@ -76,7 +76,7 @@ void main() {
'data': {
'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234},
'full': 'FormatException: bad format',
- 'stack': contains('server_test.dart')
+ 'stack': new isInstanceOf<String>()
}
}
}));
@@ -123,17 +123,17 @@ void main() {
});
test("a JSON parse error is rejected", () {
- expect(server.parseRequest('invalid json {'),
- completion(equals(JSON.encode({
- 'jsonrpc': '2.0',
- 'error': {
- 'code': error_code.PARSE_ERROR,
- 'message': "Invalid JSON: Unexpected character at 0: 'invalid json "
- "{'",
- 'data': {'request': 'invalid json {'}
- },
- 'id': null
- }))));
+ return server.parseRequest('invalid json {').then((result) {
+ expect(JSON.decode(result), {
+ 'jsonrpc': '2.0',
+ 'error': {
+ 'code': error_code.PARSE_ERROR,
+ 'message': startsWith("Invalid JSON: "),
+ 'data': {'request': 'invalid json {'}
+ },
+ 'id': null
+ });
+ });
});
});
@@ -189,7 +189,7 @@ void main() {
'data': {
'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234},
'full': 'FormatException: bad format',
- 'stack': contains('server_test.dart')
+ 'stack': new isInstanceOf<String>()
}
}
}));
« 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