| Index: runtime/bin/vmservice/observatory/test/allocations_test.dart
|
| ===================================================================
|
| --- runtime/bin/vmservice/observatory/test/allocations_test.dart (revision 39035)
|
| +++ runtime/bin/vmservice/observatory/test/allocations_test.dart (working copy)
|
| @@ -4,29 +4,31 @@
|
|
|
| library allocations_test;
|
|
|
| -import 'test_helper.dart';
|
| import 'package:observatory/service_io.dart';
|
| import 'package:unittest/unittest.dart';
|
| +import 'test_helper.dart';
|
|
|
| -import 'dart:io';
|
| +class Foo {
|
| +}
|
| +List<Foo> foos;
|
|
|
| -main() {
|
| - String script = 'allocations_script.dart';
|
| - var process = new TestLauncher(script);
|
| - process.launch().then((port) {
|
| - String addr = 'ws://localhost:$port/ws';
|
| - new WebSocketVM(new WebSocketVMTarget(addr)).get('vm')
|
| - .then((VM vm) => vm.isolates.first.load())
|
| - .then((Isolate isolate) => isolate.rootLib.load())
|
| - .then((Library lib) {
|
| - expect(lib.url.endsWith(script), isTrue);
|
| - return lib.classes.first.load();
|
| - })
|
| - .then((Class fooClass) {
|
| - expect(fooClass.name, equals('Foo'));
|
| - expect(fooClass.newSpace.accumulated.instances +
|
| - fooClass.oldSpace.accumulated.instances, equals(3));
|
| - exit(0);
|
| - });
|
| - });
|
| +void script() {
|
| + foos = [new Foo(), new Foo(), new Foo()];
|
| }
|
| +
|
| +var tests = [
|
| +
|
| +(Isolate isolate) =>
|
| + isolate.rootLib.load().then((Library lib) {
|
| + expect(lib.url.endsWith('allocations_test.dart'), isTrue);
|
| + expect(lib.classes.length, equals(1));
|
| + return lib.classes.first.load().then((Class fooClass) {
|
| + expect(fooClass.name, equals('Foo'));
|
| + expect(fooClass.newSpace.accumulated.instances +
|
| + fooClass.oldSpace.accumulated.instances, equals(3));
|
| + });
|
| +}),
|
| +
|
| +];
|
| +
|
| +main(args) => runIsolateTests(args, tests, testeeBefore: script);
|
|
|