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

Side by Side Diff: test/parse_test.dart

Issue 2380273003: Include more information when deserializing ProgramInfo (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « test/hello_world/hello_world.js.info.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:convert';
6 import 'dart:io';
7
5 import 'package:dart2js_info/info.dart'; 8 import 'package:dart2js_info/info.dart';
6 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
7 10
8 main() { 11 main() {
9 group('parse', () { 12 group('parse', () {
10 test('empty', () { 13 test('hello_world', () {
11 var json = { 14 var helloWorld = new File('test/hello_world/hello_world.js.info.json');
12 'elements': { 15 var json = JSON.decode(helloWorld.readAsStringSync());
13 'library': {}, 16 var decoded = new AllInfoJsonCodec().decode(json);
14 'class': {},
15 'function': {},
16 'field': {},
17 'typedef': {},
18 },
19 'holding': {},
20 'program': {'size': 10},
21 'outputUnits': [],
22 };
23 17
24 expect(new AllInfoJsonCodec().decode(json).program.size, 10); 18 var program = decoded.program;
25 }); 19 expect(program, isNotNull);
20
21 expect(program.entrypoint, isNotNull);
22 expect(program.size, 10124);
23 expect(program.compilationMoment,
24 DateTime.parse("2016-09-30 13:44:11.847439"));
25 expect(program.compilationDuration,
26 new Duration(seconds: 3, microseconds: 717112));
27 expect(program.noSuchMethodEnabled, false);
28 expect(program.minified, false);
29 }, skip: "need to update dart2js first");
26 }); 30 });
27 } 31 }
OLDNEW
« no previous file with comments | « test/hello_world/hello_world.js.info.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698