f247613737
This reverts commit32ed244f63. Reason for revert: Hopefully clear up bot failures Original change's description: > Revert "Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect."" > > This reverts commitd03b7ea721. > > Reason for revert: Hitting assert in VM (https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885275470407956944/+/steps/test_results/0/logs/new_test_failures__logs_/0) > > Original change's description: > > Reland "[ VM / Service ] Migrated Observatory service tests from package:unittest to package:test and package:expect." > > > > This reverts commit01dc1756c4. > > > > Change-Id: I1c9186947af2368ff48c02a392da9ced85770335 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140254 > > Commit-Queue: Ben Konyi <bkonyi@google.com> > > Reviewed-by: Ryan Macnak <rmacnak@google.com> > > TBR=bkonyi@google.com,rmacnak@google.com > > Change-Id: I640adf8e96672476f46fc1f4580a7231b5cfd8fe > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140379 > Reviewed-by: Ben Konyi <bkonyi@google.com> > Commit-Queue: Ben Konyi <bkonyi@google.com> TBR=bkonyi@google.com,rmacnak@google.com Change-Id: I3127f2f39e64e87daa5ae0c02e14cd24cb586f5f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140480 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
73 lines
1.9 KiB
Dart
73 lines
1.9 KiB
Dart
// Copyright (c) 2015, 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.
|
|
|
|
import 'dart:async';
|
|
import 'dart:developer';
|
|
import 'package:observatory/service_io.dart';
|
|
import 'package:test/test.dart';
|
|
import 'service_test_common.dart';
|
|
import 'test_helper.dart';
|
|
|
|
const int LINE_A = 20;
|
|
const int LINE_B = 26;
|
|
|
|
foo() {}
|
|
|
|
doAsync(param1) async {
|
|
var local1 = param1 + 1;
|
|
foo(); // Line A.
|
|
await local1;
|
|
}
|
|
|
|
doAsyncStar(param2) async* {
|
|
var local2 = param2 + 1;
|
|
foo(); // Line B.
|
|
yield local2;
|
|
}
|
|
|
|
testeeDo() {
|
|
debugger();
|
|
|
|
doAsync(1).then((_) {
|
|
doAsyncStar(1).listen((_) {});
|
|
});
|
|
}
|
|
|
|
Future checkAsyncVarDescriptors(Isolate isolate) async {
|
|
ServiceMap stack = await isolate.getStack();
|
|
expect(stack.type, equals('Stack'));
|
|
expect(stack['frames'].length, greaterThanOrEqualTo(1));
|
|
Frame frame = stack['frames'][0];
|
|
var vars = frame.variables.map((v) => v['name']).join(' ');
|
|
expect(vars, equals('param1 local1')); // no :async_op et al
|
|
}
|
|
|
|
Future checkAsyncStarVarDescriptors(Isolate isolate) async {
|
|
ServiceMap stack = await isolate.getStack();
|
|
expect(stack.type, equals('Stack'));
|
|
expect(stack['frames'].length, greaterThanOrEqualTo(1));
|
|
Frame frame = stack['frames'][0];
|
|
var vars = frame.variables.map((v) => v['name']).join(' ');
|
|
expect(vars, equals('param2 local2')); // no :async_op et al
|
|
}
|
|
|
|
var tests = <IsolateTest>[
|
|
hasStoppedAtBreakpoint, // debugger()
|
|
setBreakpointAtLine(LINE_A),
|
|
setBreakpointAtLine(LINE_B),
|
|
resumeIsolate,
|
|
|
|
hasStoppedAtBreakpoint,
|
|
stoppedAtLine(LINE_A),
|
|
checkAsyncVarDescriptors,
|
|
resumeIsolate,
|
|
|
|
hasStoppedAtBreakpoint,
|
|
stoppedAtLine(LINE_B),
|
|
checkAsyncStarVarDescriptors,
|
|
resumeIsolate,
|
|
];
|
|
|
|
main(args) => runIsolateTests(args, tests, testeeConcurrent: testeeDo);
|