| Index: runtime/observatory/tests/service/field_script_test.dart
|
| diff --git a/runtime/observatory/tests/service/field_script_test.dart b/runtime/observatory/tests/service/field_script_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1e874e81386bc29f3aaffcf341e1711ce99025a4
|
| --- /dev/null
|
| +++ b/runtime/observatory/tests/service/field_script_test.dart
|
| @@ -0,0 +1,42 @@
|
| +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
| +// 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.
|
| +
|
| +library field_scrip_test;
|
| +
|
| +import 'package:observatory/service_io.dart';
|
| +import 'package:unittest/unittest.dart';
|
| +import 'test_helper.dart';
|
| +import 'service_test_common.dart';
|
| +
|
| +part 'field_script_other.dart';
|
| +
|
| +code() {
|
| + print(otherField);
|
| +}
|
| +
|
| +var tests = [
|
| + hasPausedAtStart,
|
| + (Isolate isolate) async {
|
| + Library lib = await isolate.rootLibrary.load();
|
| + var fields = lib.variables;
|
| + expect(fields.length, 2);
|
| + print(lib.variables);
|
| + for(Field f in fields) {
|
| + await f.load();
|
| + String locationString = await f.location.toUserString();
|
| + if (f.name == "tests") {
|
| + expect(locationString, "field_script_test.dart:18:5");
|
| + } else if (f.name == "otherField") {
|
| + expect(locationString, "field_script_other.dart:7:5");
|
| + } else {
|
| + fail("Unexpected field: ${f.name}");
|
| + }
|
| + }
|
| + }
|
| +];
|
| +
|
| +main(args) {
|
| + runIsolateTestsSynchronous(args, tests,
|
| + testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
|
| +}
|
|
|