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

Unified Diff: test/parse_test.dart

Issue 2380273003: Include more information when deserializing ProgramInfo (Closed)
Patch Set: Created 4 years, 3 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 | « test/hello_world/hello_world.js.info.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/parse_test.dart
diff --git a/test/parse_test.dart b/test/parse_test.dart
index e3c6570e39654ce05ff2708fc4c318d9492edb9e..d51f1131708159844959c505f1c32ccfa2c013a4 100644
--- a/test/parse_test.dart
+++ b/test/parse_test.dart
@@ -2,26 +2,30 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'dart:convert';
+import 'dart:io';
+
import 'package:dart2js_info/info.dart';
import 'package:test/test.dart';
main() {
group('parse', () {
- test('empty', () {
- var json = {
- 'elements': {
- 'library': {},
- 'class': {},
- 'function': {},
- 'field': {},
- 'typedef': {},
- },
- 'holding': {},
- 'program': {'size': 10},
- 'outputUnits': [],
- };
+ test('hello_world', () {
+ var helloWorld = new File('test/hello_world/hello_world.js.info.json');
+ var json = JSON.decode(helloWorld.readAsStringSync());
+ var decoded = new AllInfoJsonCodec().decode(json);
+
+ var program = decoded.program;
+ expect(program, isNotNull);
- expect(new AllInfoJsonCodec().decode(json).program.size, 10);
- });
+ expect(program.entrypoint, isNotNull);
+ expect(program.size, 10124);
+ expect(program.compilationMoment,
+ DateTime.parse("2016-09-30 13:44:11.847439"));
+ expect(program.compilationDuration,
+ new Duration(seconds: 3, microseconds: 717112));
+ expect(program.noSuchMethodEnabled, false);
+ expect(program.minified, false);
+ }, skip: "need to update dart2js first");
});
}
« 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