| OLD | NEW |
| 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 /** | 5 /** |
| 6 * Code generation for the file "integration_test_methods.dart". | 6 * Code generation for the file "integration_test_methods.dart". |
| 7 */ | 7 */ |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/codegen/tools.dart'; | 10 import 'package:analyzer/src/codegen/tools.dart'; |
| 11 import 'package:front_end/src/codegen/tools.dart'; | 11 import 'package:front_end/src/codegen/tools.dart'; |
| 12 import 'package:path/path.dart' as path; | 12 import 'package:path/path.dart' as path; |
| 13 | 13 |
| 14 import 'api.dart'; | 14 import 'api.dart'; |
| 15 import 'codegen_dart.dart'; | 15 import 'codegen_dart.dart'; |
| 16 import 'from_html.dart'; | 16 import 'from_html.dart'; |
| 17 import 'to_html.dart'; | 17 import 'to_html.dart'; |
| 18 | 18 |
| 19 final GeneratedFile target = new GeneratedFile( | 19 final GeneratedFile target = |
| 20 'test/integration/support/integration_test_methods.dart', (String pkgPath) { | 20 new GeneratedFile('test/integration/support/integration_test_methods.dart', |
| 21 (String pkgPath) async { |
| 21 CodegenInttestMethodsVisitor visitor = new CodegenInttestMethodsVisitor( | 22 CodegenInttestMethodsVisitor visitor = new CodegenInttestMethodsVisitor( |
| 22 path.basename(pkgPath), readApi(pkgPath)); | 23 path.basename(pkgPath), readApi(pkgPath)); |
| 23 return visitor.collectCode(visitor.visitApi); | 24 return visitor.collectCode(visitor.visitApi); |
| 24 }); | 25 }); |
| 25 | 26 |
| 26 /** | 27 /** |
| 27 * Visitor that generates the code for integration_test_methods.dart | 28 * Visitor that generates the code for integration_test_methods.dart |
| 28 */ | 29 */ |
| 29 class CodegenInttestMethodsVisitor extends DartCodegenVisitor | 30 class CodegenInttestMethodsVisitor extends DartCodegenVisitor |
| 30 with CodeGenerator { | 31 with CodeGenerator { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 writeln('ResponseDecoder decoder = new ResponseDecoder($kind);'); | 266 writeln('ResponseDecoder decoder = new ResponseDecoder($kind);'); |
| 266 writeln("return new $resultClass.fromJson(decoder, 'result', result);"); | 267 writeln("return new $resultClass.fromJson(decoder, 'result', result);"); |
| 267 } else { | 268 } else { |
| 268 writeln('outOfTestExpect(result, isNull);'); | 269 writeln('outOfTestExpect(result, isNull);'); |
| 269 writeln('return null;'); | 270 writeln('return null;'); |
| 270 } | 271 } |
| 271 }); | 272 }); |
| 272 writeln('}'); | 273 writeln('}'); |
| 273 } | 274 } |
| 274 } | 275 } |
| OLD | NEW |