blob: 1c41188767c974ab4839557097a9ea4884b63055 [file] [log] [blame]
// Copyright (c) 2016, 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';
testFunction() async {
var x = 3;
var y = 4;
debugger();
var z = await new Future(() => x + y);
debugger();
return z;
}
var tests = <IsolateTest>[
hasStoppedAtBreakpoint,
(Isolate isolate) async {
// Make sure we are in the right place.
var stack = await isolate.getStack();
var topFrame = 0;
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 16);
Instance result = await isolate.evalFrame(topFrame, "x") as Instance;
print(result);
expect(result.valueAsString, equals("3"));
},
resumeIsolate,
hasStoppedAtBreakpoint,
(Isolate isolate) async {
// Make sure we are in the right place.
var stack = await isolate.getStack();
var topFrame = 0;
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 18);
Instance result = await isolate.evalFrame(topFrame, "z") as Instance;
print(result);
expect(result.valueAsString, equals("7"));
},
resumeIsolate,
];
main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);