37ed87b038
Port the service tests and Observatory to Dart 3. Change-Id: I8a8b20d8f90acd3b5f741c93f10ba99971aa0c52 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154825 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
// 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_script_test;
|
|
|
|
import 'package:observatory/service_io.dart';
|
|
import 'package:test/test.dart';
|
|
import 'test_helper.dart';
|
|
import 'service_test_common.dart';
|
|
|
|
part 'field_script_other.dart';
|
|
|
|
code() {
|
|
print(otherField);
|
|
}
|
|
|
|
var tests = <IsolateTest>[
|
|
hasPausedAtStart,
|
|
(Isolate isolate) async {
|
|
Library lib = await isolate.rootLibrary.load() as Library;
|
|
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);
|
|
}
|