| Index: pkg/analysis_server/test/protocol_test.dart
|
| diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
|
| index e4bcb2168a4775fbe24005a6da0da203132ec7d6..bc4016eb361d0c2048207a50f261d10ea6e1d4ba 100644
|
| --- a/pkg/analysis_server/test/protocol_test.dart
|
| +++ b/pkg/analysis_server/test/protocol_test.dart
|
| @@ -149,6 +149,7 @@ class RequestTest {
|
| Request request = new Request.fromString(json);
|
| expect(request.id, equals('one'));
|
| expect(request.method, equals('aMethod'));
|
| + expect(request.clientRequestTime, isNull);
|
| }
|
|
|
| void test_fromJson_invalidId() {
|
| @@ -171,6 +172,25 @@ class RequestTest {
|
| expect(request, isNull);
|
| }
|
|
|
| + void test_fromJson_withBadClientTime() {
|
| + Request original = new Request('one', 'aMethod', null, 347);
|
| + Map<String, Object> map = original.toJson();
|
| + // Insert bad value - should be int but client sent string instead
|
| + map[Request.CLIENT_REQUEST_TIME] = '347';
|
| + String json = JSON.encode(map);
|
| + Request request = new Request.fromString(json);
|
| + expect(request, isNull);
|
| + }
|
| +
|
| + void test_fromJson_withClientTime() {
|
| + Request original = new Request('one', 'aMethod', null, 347);
|
| + String json = JSON.encode(original.toJson());
|
| + Request request = new Request.fromString(json);
|
| + expect(request.id, equals('one'));
|
| + expect(request.method, equals('aMethod'));
|
| + expect(request.clientRequestTime, 347);
|
| + }
|
| +
|
| void test_fromJson_withParams() {
|
| Request original = new Request('one', 'aMethod', {
|
| 'foo': 'bar'
|
| @@ -223,8 +243,7 @@ class ResponseTest {
|
| }
|
|
|
| void test_create_unanalyzedPriorityFiles() {
|
| - Response response =
|
| - new Response.unanalyzedPriorityFiles('0', 'file list');
|
| + Response response = new Response.unanalyzedPriorityFiles('0', 'file list');
|
| expect(response.id, equals('0'));
|
| expect(response.error, isNotNull);
|
| expect(response.toJson(), equals({
|
|
|