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

Side by Side Diff: pkg/analysis_server/test/domain_analysis_test.dart

Issue 483613006: Allow null as a synonym for {} when decoding JSON objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.domain.analysis; 5 library test.domain.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 group('updateOptions', () { 134 group('updateOptions', () {
135 test('invalid', () { 135 test('invalid', () {
136 var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {OPTIONS: { 136 var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {OPTIONS: {
137 'not-an-option': true 137 'not-an-option': true
138 }}); 138 }});
139 var response = handler.handleRequest(request); 139 var response = handler.handleRequest(request);
140 // Invalid options should be silently ignored. 140 // Invalid options should be silently ignored.
141 expect(response, isResponseSuccess('0')); 141 expect(response, isResponseSuccess('0'));
142 }); 142 });
143 143
144 test('null', () {
145 // null is allowed as a synonym for {}.
146 var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {OPTIONS: null}) ;
147 var response = handler.handleRequest(request);
148 expect(response, isResponseSuccess('0'));
149 });
150
144 // TODO(paulberry): disabled because analyzeAngular is currently not in th e API. 151 // TODO(paulberry): disabled because analyzeAngular is currently not in th e API.
145 // test('valid', () { 152 // test('valid', () {
146 // engine.AnalysisOptions oldOptions = server.contextDirectoryManager.def aultOptions; 153 // engine.AnalysisOptions oldOptions = server.contextDirectoryManager.def aultOptions;
147 // bool analyzeAngular = !oldOptions.analyzeAngular; 154 // bool analyzeAngular = !oldOptions.analyzeAngular;
148 // bool enableDeferredLoading = oldOptions.enableDeferredLoading; 155 // bool enableDeferredLoading = oldOptions.enableDeferredLoading;
149 // var newOptions = new AnalysisOptions(analyzeAngular: analyzeAngular, 156 // var newOptions = new AnalysisOptions(analyzeAngular: analyzeAngular,
150 // enableDeferredLoading: enableDeferredLoading, enableEnums: false); 157 // enableDeferredLoading: enableDeferredLoading, enableEnums: false);
151 // var request = new AnalysisUpdateOptionsParams(newOptions).toRequest('0 '); 158 // var request = new AnalysisUpdateOptionsParams(newOptions).toRequest('0 ');
152 // var response = handler.handleRequest(request); 159 // var response = handler.handleRequest(request);
153 // expect(response, isResponseSuccess('0')); 160 // expect(response, isResponseSuccess('0'));
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 return waitForServerOperationsPerformed(server); 608 return waitForServerOperationsPerformed(server);
602 } 609 }
603 610
604 static String _getCodeString(code) { 611 static String _getCodeString(code) {
605 if (code is List<String>) { 612 if (code is List<String>) {
606 code = code.join('\n'); 613 code = code.join('\n');
607 } 614 }
608 return code as String; 615 return code as String;
609 } 616 }
610 } 617 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | pkg/analysis_server/tool/spec/codegen_dart_protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698