mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Reapply "Partial static mode changes for vm-service and tests (part 3)."
Remove use of castTo, which is not yet available in the prebuilt SDK used to build Observatory. Bug: https://github.com/dart-lang/sdk/issues/31587 Change-Id: Ia118710a2c4dca1851935d284e1a78a9c6517256 Reviewed-on: https://dart-review.googlesource.com/34022 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
cf38dfe0e1
commit
a4f3b53fe8
|
@ -76,7 +76,7 @@ _runExtension(
|
|||
SendPort replyPort,
|
||||
Object id,
|
||||
bool trace_service) {
|
||||
var parameters = {};
|
||||
var parameters = <String, String>{};
|
||||
for (var i = 0; i < parameterKeys.length; i++) {
|
||||
parameters[parameterKeys[i]] = parameterValues[i];
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ class ObjectVertex {
|
|||
var doms = _graph._doms;
|
||||
|
||||
var parentId = _id;
|
||||
var domChildren = [];
|
||||
var domChildren = <ObjectVertex>[];
|
||||
|
||||
for (var childId = ROOT; childId <= N; childId++) {
|
||||
if (doms[childId] == parentId) {
|
||||
|
|
|
@ -113,14 +113,14 @@ class DebuggerLocation {
|
|||
|
||||
static Future<List<Script>> _lookupScript(Isolate isolate, String name,
|
||||
{bool allowPrefix: false}) {
|
||||
var pending = [];
|
||||
var pending = <Future>[];
|
||||
for (var lib in isolate.libraries) {
|
||||
if (!lib.loaded) {
|
||||
pending.add(lib.load());
|
||||
}
|
||||
}
|
||||
return Future.wait(pending).then((_) {
|
||||
List matches = [];
|
||||
var matches = <Script>[];
|
||||
for (var lib in isolate.libraries) {
|
||||
for (var script in lib.scripts) {
|
||||
if (allowPrefix) {
|
||||
|
@ -140,7 +140,7 @@ class DebuggerLocation {
|
|||
|
||||
static List<ServiceFunction> _lookupFunction(Isolate isolate, String name,
|
||||
{bool allowPrefix: false}) {
|
||||
var matches = [];
|
||||
var matches = <ServiceFunction>[];
|
||||
for (var lib in isolate.libraries) {
|
||||
assert(lib.loaded);
|
||||
for (var function in lib.functions) {
|
||||
|
@ -163,7 +163,7 @@ class DebuggerLocation {
|
|||
if (isolate == null) {
|
||||
return [];
|
||||
}
|
||||
var pending = [];
|
||||
var pending = <Future>[];
|
||||
for (var lib in isolate.libraries) {
|
||||
assert(lib.loaded);
|
||||
for (var cls in lib.classes) {
|
||||
|
@ -173,7 +173,7 @@ class DebuggerLocation {
|
|||
}
|
||||
}
|
||||
await Future.wait(pending);
|
||||
var matches = [];
|
||||
var matches = <Class>[];
|
||||
for (var lib in isolate.libraries) {
|
||||
for (var cls in lib.classes) {
|
||||
if (allowPrefix) {
|
||||
|
@ -260,7 +260,7 @@ class DebuggerLocation {
|
|||
|
||||
/// Completes a partial source location description.
|
||||
static Future<List<String>> complete(Debugger debugger, String locDesc) {
|
||||
List<Future<List<String>>> pending = [];
|
||||
var pending = <Future<List<String>>>[];
|
||||
var match = partialFunctionMatcher.firstMatch(locDesc);
|
||||
if (match != null) {
|
||||
pending.add(_completeFunction(debugger, match));
|
||||
|
@ -272,7 +272,7 @@ class DebuggerLocation {
|
|||
}
|
||||
|
||||
return Future.wait(pending).then((List<List<String>> responses) {
|
||||
var completions = [];
|
||||
var completions = <String>[];
|
||||
for (var response in responses) {
|
||||
completions.addAll(response);
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ class DebuggerLocation {
|
|||
|
||||
if (qualifier == null) {
|
||||
return _lookupClass(isolate, base, allowPrefix: true).then((classes) {
|
||||
var completions = [];
|
||||
var completions = <String>[];
|
||||
|
||||
// Complete top-level function names.
|
||||
var functions = _lookupFunction(isolate, base, allowPrefix: true);
|
||||
|
@ -306,7 +306,7 @@ class DebuggerLocation {
|
|||
});
|
||||
} else {
|
||||
return _lookupClass(isolate, base, allowPrefix: false).then((classes) {
|
||||
var completions = [];
|
||||
var completions = <String>[];
|
||||
for (var cls in classes) {
|
||||
for (var function in cls.functions) {
|
||||
if (function.kind == M.FunctionKind.constructor) {
|
||||
|
@ -375,7 +375,7 @@ class DebuggerLocation {
|
|||
// The script name is incomplete. Complete it.
|
||||
var scripts =
|
||||
await _lookupScript(debugger.isolate, scriptName, allowPrefix: true);
|
||||
List completions = [];
|
||||
var completions = <String>[];
|
||||
for (var script in scripts) {
|
||||
completions.add(script.name + ':');
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ class DebuggerLocation {
|
|||
if (!lineStrComplete) {
|
||||
// Complete the line.
|
||||
var sharedPrefix = '${script.name}:';
|
||||
List completions = [];
|
||||
var completions = <String>[];
|
||||
var report = await script.isolate
|
||||
.getSourceReport([Isolate.kPossibleBreakpointsReport], script);
|
||||
Set<int> possibleBpts = getPossibleBreakpointLines(report, script);
|
||||
|
@ -410,7 +410,7 @@ class DebuggerLocation {
|
|||
int lineNum = int.parse(lineStr);
|
||||
var scriptLine = script.getLine(lineNum);
|
||||
var sharedPrefix = '${script.name}:${lineStr}:';
|
||||
List completions = [];
|
||||
var completions = <String>[];
|
||||
int maxCol = scriptLine.text.trimRight().runes.length;
|
||||
for (int i = 1; i <= maxCol; i++) {
|
||||
var currentColStr = i.toString();
|
||||
|
|
|
@ -49,7 +49,7 @@ class HeapSnapshot implements M.HeapSnapshot {
|
|||
|
||||
Future<List<MergedVertex>> buildMergedVertices(
|
||||
S.Isolate isolate, ObjectGraph graph, signal) async {
|
||||
final cidToMergedVertex = {};
|
||||
final cidToMergedVertex = <int, MergedVertex>{};
|
||||
|
||||
int count = 0;
|
||||
final Stopwatch watch = new Stopwatch();
|
||||
|
@ -104,7 +104,7 @@ class HeapSnapshot implements M.HeapSnapshot {
|
|||
|
||||
buildOwnershipClasses(S.Isolate isolate, ObjectGraph graph) {
|
||||
var numCids = graph.numCids;
|
||||
var classes = new List();
|
||||
var classes = new List<HeapSnapshotOwnershipClass>();
|
||||
for (var cid = 0; cid < numCids; cid++) {
|
||||
var size = graph.getOwnedByCid(cid);
|
||||
if (size != 0) {
|
||||
|
@ -144,8 +144,8 @@ class HeapSnapshotDominatorNode implements M.HeapSnapshotDominatorNode {
|
|||
if (_preloaded != null) {
|
||||
return new Future.value(_preloaded);
|
||||
} else {
|
||||
return isolate.getObjectByAddress(v.address).then((S.HeapObject obj) {
|
||||
return _preloaded = obj;
|
||||
return isolate.getObjectByAddress(v.address).then((S.ServiceObject obj) {
|
||||
return _preloaded = obj as S.HeapObject;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ abstract class Instance extends Object implements InstanceRef {
|
|||
/// Int32x4List
|
||||
/// Float32x4List
|
||||
/// Float64x2List
|
||||
Iterable<dynamic> get typedElements;
|
||||
List<dynamic> get typedElements;
|
||||
|
||||
/// [optional] The native fields of this Instance.
|
||||
Iterable<NativeField> get nativeFields;
|
||||
|
|
|
@ -134,7 +134,7 @@ class FunctionCallTreeNodeCode {
|
|||
FunctionCallTreeNodeCode(this.code, this.ticks);
|
||||
}
|
||||
|
||||
class FunctionCallTreeNode extends CallTreeNode {
|
||||
class FunctionCallTreeNode extends CallTreeNode<FunctionCallTreeNode> {
|
||||
final ProfileFunction profileFunction;
|
||||
final codes = new List<FunctionCallTreeNodeCode>();
|
||||
int _totalCodeTicks = 0;
|
||||
|
@ -210,7 +210,7 @@ class FunctionCallTreeNode extends CallTreeNode {
|
|||
typedef bool CallTreeNodeFilter(CallTreeNode node);
|
||||
|
||||
/// Build a filter version of a FunctionCallTree.
|
||||
abstract class _FilteredCallTreeBuilder {
|
||||
abstract class _FilteredCallTreeBuilder<NodeT extends CallTreeNode> {
|
||||
/// The filter.
|
||||
final CallTreeNodeFilter filter;
|
||||
|
||||
|
@ -235,14 +235,15 @@ abstract class _FilteredCallTreeBuilder {
|
|||
|
||||
CallTreeNode _findInChildren(CallTreeNode current, CallTreeNode needle) {
|
||||
for (var child in current.children) {
|
||||
if (child.profileData == needle.profileData) {
|
||||
if ((child as CallTreeNode).profileData ==
|
||||
(needle as CallTreeNode).profileData) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
CallTreeNode _copyNode(CallTreeNode node);
|
||||
NodeT _copyNode(NodeT node);
|
||||
|
||||
/// Add all nodes in [_currentPath].
|
||||
FunctionCallTreeNode _addCurrentPath() {
|
||||
|
@ -320,7 +321,8 @@ abstract class _FilteredCallTreeBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
class _FilteredFunctionCallTreeBuilder extends _FilteredCallTreeBuilder {
|
||||
class _FilteredFunctionCallTreeBuilder
|
||||
extends _FilteredCallTreeBuilder<FunctionCallTreeNode> {
|
||||
_FilteredFunctionCallTreeBuilder(
|
||||
CallTreeNodeFilter filter, FunctionCallTree tree)
|
||||
: super(
|
||||
|
@ -329,8 +331,8 @@ class _FilteredFunctionCallTreeBuilder extends _FilteredCallTreeBuilder {
|
|||
new FunctionCallTree(
|
||||
tree.inclusive,
|
||||
new FunctionCallTreeNode(
|
||||
tree.root.profileData,
|
||||
tree.root.count,
|
||||
(tree.root as CallTreeNode).profileData,
|
||||
(tree.root as CallTreeNode).count,
|
||||
tree.root.inclusiveNativeAllocations,
|
||||
tree.root.exclusiveNativeAllocations)));
|
||||
|
||||
|
@ -340,7 +342,8 @@ class _FilteredFunctionCallTreeBuilder extends _FilteredCallTreeBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
class _FilteredCodeCallTreeBuilder extends _FilteredCallTreeBuilder {
|
||||
class _FilteredCodeCallTreeBuilder
|
||||
extends _FilteredCallTreeBuilder<CodeCallTreeNode> {
|
||||
_FilteredCodeCallTreeBuilder(CallTreeNodeFilter filter, CodeCallTree tree)
|
||||
: super(
|
||||
filter,
|
||||
|
@ -359,7 +362,8 @@ class _FilteredCodeCallTreeBuilder extends _FilteredCallTreeBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
class FunctionCallTree extends CallTree implements M.FunctionCallTree {
|
||||
class FunctionCallTree extends CallTree<FunctionCallTreeNode>
|
||||
implements M.FunctionCallTree {
|
||||
FunctionCallTree(bool inclusive, FunctionCallTreeNode root)
|
||||
: super(inclusive, root) {
|
||||
if ((root.inclusiveNativeAllocations != null) &&
|
||||
|
@ -439,7 +443,7 @@ class FunctionCallTree extends CallTree implements M.FunctionCallTree {
|
|||
|
||||
_markFunctionCalls() {
|
||||
for (var child in root.children) {
|
||||
_markFunctionCallsInner(null, child);
|
||||
_markFunctionCallsInner(null, child as FunctionCallTreeNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,8 @@ abstract class ServiceObject {
|
|||
return o1.name.compareTo(o2.name);
|
||||
}
|
||||
|
||||
List removeDuplicatesAndSortLexical(List<ServiceObject> list) {
|
||||
List<T> removeDuplicatesAndSortLexical<T extends ServiceObject>(
|
||||
List<T> list) {
|
||||
return list.toSet().toList()..sort(LexicalSortName);
|
||||
}
|
||||
|
||||
|
@ -451,7 +452,7 @@ abstract class ServiceObjectOwner extends ServiceObject {
|
|||
/// be [loaded].
|
||||
ServiceObject getFromMap(Map map);
|
||||
|
||||
Future<M.Object> invokeRpc(String method, Map params);
|
||||
Future<ServiceObject> invokeRpc(String method, Map params);
|
||||
}
|
||||
|
||||
abstract class Location implements M.Location {
|
||||
|
@ -821,7 +822,7 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
|
|||
Future<Map> invokeRpcRaw(String method, Map params);
|
||||
|
||||
Future<Map> invokeRpcNoUpgrade(String method, Map params) {
|
||||
return invokeRpcRaw(method, params).then((Map response) {
|
||||
return invokeRpcRaw(method, params).then<Map>((Map response) {
|
||||
var map = response;
|
||||
if (Tracer.current != null) {
|
||||
Tracer.current
|
||||
|
@ -832,15 +833,16 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
|
|||
"Response is missing the 'type' field", map);
|
||||
return new Future.error(exception);
|
||||
}
|
||||
return new Future.value(map);
|
||||
return new Future<Map>.value(map);
|
||||
}).catchError((e) {
|
||||
// Errors pass through.
|
||||
return new Future.error(e);
|
||||
return new Future<Map>.error(e);
|
||||
});
|
||||
}
|
||||
|
||||
Future<dynamic> invokeRpc(String method, Map params) {
|
||||
return invokeRpcNoUpgrade(method, params).then((Map response) {
|
||||
Future<ServiceObject> invokeRpc(String method, Map params) {
|
||||
return invokeRpcNoUpgrade(method, params)
|
||||
.then<ServiceObject>((Map response) {
|
||||
var obj = new ServiceObject._fromMap(this, response);
|
||||
if ((obj != null) && obj.canCache) {
|
||||
String objId = obj.id;
|
||||
|
@ -848,7 +850,7 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
|
|||
}
|
||||
return obj;
|
||||
}).catchError((e) {
|
||||
return new Future.error(e);
|
||||
return new Future<ServiceObject>.error(e);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -994,7 +996,7 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
|
|||
|
||||
// Reload all isolates.
|
||||
Future reloadIsolates() {
|
||||
var reloads = [];
|
||||
var reloads = <Future>[];
|
||||
for (var isolate in isolates) {
|
||||
var reload = isolate.reload().catchError((e) {
|
||||
Logger.root.info('Bulk reloading of isolates failed: $e');
|
||||
|
@ -1362,7 +1364,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
|
||||
Future<ServiceMap> getSourceReport(List<String> report_kinds,
|
||||
[Script script, int startPos, int endPos]) {
|
||||
var params = {'reports': report_kinds};
|
||||
var params = <String, dynamic>{'reports': report_kinds};
|
||||
if (script != null) {
|
||||
params['scriptId'] = script.id;
|
||||
}
|
||||
|
@ -1389,7 +1391,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
}
|
||||
return invokeRpc('reloadSources', params).then((result) {
|
||||
_cache.clear();
|
||||
return result;
|
||||
return result as ServiceMap;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1405,10 +1407,10 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
|
||||
/// Fetches and builds the class hierarchy for this isolate. Returns the
|
||||
/// Object class object.
|
||||
Future<Class> getClassHierarchy() {
|
||||
return invokeRpc('getClassList', {})
|
||||
.then(_loadClasses)
|
||||
.then(_buildClassHierarchy);
|
||||
Future<Class> getClassHierarchy() async {
|
||||
var classRefs = await invokeRpc('getClassList', {});
|
||||
var classes = await _loadClasses(classRefs);
|
||||
return _buildClassHierarchy(classes);
|
||||
}
|
||||
|
||||
Future<ServiceObject> getPorts() {
|
||||
|
@ -1422,7 +1424,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
Future<List<Class>> getClassRefs() async {
|
||||
ServiceMap classList = await invokeRpc('getClassList', {});
|
||||
assert(classList.type == 'ClassList');
|
||||
var classRefs = [];
|
||||
var classRefs = <Class>[];
|
||||
for (var cls in classList['classes']) {
|
||||
// Skip over non-class classes.
|
||||
if (cls is Class) {
|
||||
|
@ -1436,7 +1438,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
/// Given the class list, loads each class.
|
||||
Future<List<Class>> _loadClasses(ServiceMap classList) {
|
||||
assert(classList.type == 'ClassList');
|
||||
var futureClasses = [];
|
||||
var futureClasses = <Future<Class>>[];
|
||||
for (var cls in classList['classes']) {
|
||||
// Skip over non-class classes.
|
||||
if (cls is Class) {
|
||||
|
@ -1495,7 +1497,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
return vm.invokeRpcNoUpgrade(method, params);
|
||||
}
|
||||
|
||||
Future<dynamic> invokeRpc(String method, Map params) {
|
||||
Future<ServiceObject> invokeRpc(String method, Map params) {
|
||||
return invokeRpcNoUpgrade(method, params).then((Map response) {
|
||||
return getFromMap(response);
|
||||
});
|
||||
|
@ -1671,7 +1673,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
error = map['error'];
|
||||
|
||||
libraries.clear();
|
||||
libraries.addAll(map['libraries']);
|
||||
for (Library l in map['libraries']) libraries.add(l);
|
||||
libraries.sort(ServiceObject.LexicalSortName);
|
||||
if (savedStartTime == null) {
|
||||
vm._buildIsolateList();
|
||||
|
@ -1679,12 +1681,12 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
|
||||
extensionRPCs.clear();
|
||||
if (map['extensionRPCs'] != null) {
|
||||
extensionRPCs.addAll(map['extensionRPCs']);
|
||||
for (String e in map['extensionRPCs']) extensionRPCs.add(e);
|
||||
}
|
||||
|
||||
threads.clear();
|
||||
if (map['_threads'] != null) {
|
||||
threads.addAll(map['_threads']);
|
||||
for (Thread t in map['_threads']) threads.add(t);
|
||||
}
|
||||
|
||||
int currentZoneHighWatermark = 0;
|
||||
|
@ -1792,7 +1794,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
}
|
||||
}
|
||||
|
||||
Future<ServiceObject> addBreakpoint(Script script, int line, [int col]) {
|
||||
Future<Breakpoint> addBreakpoint(Script script, int line, [int col]) {
|
||||
Map params = {
|
||||
'scriptId': script.id,
|
||||
'line': line,
|
||||
|
@ -1800,11 +1802,11 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
if (col != null) {
|
||||
params['column'] = col;
|
||||
}
|
||||
return invokeRpc('addBreakpoint', params);
|
||||
return invokeRpc('addBreakpoint', params)
|
||||
.then((result) => result as Breakpoint);
|
||||
}
|
||||
|
||||
Future<ServiceObject> addBreakpointByScriptUri(String uri, int line,
|
||||
[int col]) {
|
||||
Future<Breakpoint> addBreakpointByScriptUri(String uri, int line, [int col]) {
|
||||
Map params = {
|
||||
'scriptUri': uri,
|
||||
'line': line.toString(),
|
||||
|
@ -1812,15 +1814,18 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
if (col != null) {
|
||||
params['column'] = col.toString();
|
||||
}
|
||||
return invokeRpc('addBreakpointWithScriptUri', params);
|
||||
return invokeRpc('addBreakpointWithScriptUri', params)
|
||||
.then((result) => result as Breakpoint);
|
||||
}
|
||||
|
||||
Future<ServiceObject> addBreakpointAtEntry(ServiceFunction function) {
|
||||
return invokeRpc('addBreakpointAtEntry', {'functionId': function.id});
|
||||
Future<Breakpoint> addBreakpointAtEntry(ServiceFunction function) {
|
||||
return invokeRpc('addBreakpointAtEntry', {'functionId': function.id})
|
||||
.then((result) => result as Breakpoint);
|
||||
}
|
||||
|
||||
Future<ServiceObject> addBreakOnActivation(Instance closure) {
|
||||
return invokeRpc('_addBreakpointAtActivation', {'objectId': closure.id});
|
||||
Future<Breakpoint> addBreakOnActivation(Instance closure) {
|
||||
return invokeRpc('_addBreakpointAtActivation', {'objectId': closure.id})
|
||||
.then((result) => result as Breakpoint);
|
||||
}
|
||||
|
||||
Future removeBreakpoint(Breakpoint bpt) {
|
||||
|
@ -1864,7 +1869,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
}
|
||||
|
||||
Future<ServiceMap> getStack() {
|
||||
return invokeRpc('getStack', {});
|
||||
return invokeRpc('getStack', {}).then((response) => response as ServiceMap);
|
||||
}
|
||||
|
||||
Future<ObjectStore> getObjectStore() {
|
||||
|
@ -1952,12 +1957,13 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
return invokeRpc('_getInstances', params);
|
||||
}
|
||||
|
||||
Future<ServiceObject> getObjectByAddress(String address, [bool ref = true]) {
|
||||
Future<HeapObject> getObjectByAddress(String address, [bool ref = true]) {
|
||||
Map params = {
|
||||
'address': address,
|
||||
'ref': ref,
|
||||
};
|
||||
return invokeRpc('_getObjectByAddress', params);
|
||||
return invokeRpc('_getObjectByAddress', params)
|
||||
.then((result) => result as HeapObject);
|
||||
}
|
||||
|
||||
final Map<String, ServiceMetric> dartMetrics = <String, ServiceMetric>{};
|
||||
|
@ -1967,7 +1973,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
|
|||
Future<Map<String, ServiceMetric>> _refreshMetrics(
|
||||
String metricType, Map<String, ServiceMetric> metricsMap) {
|
||||
return invokeRpc('_getIsolateMetricList', {'type': metricType})
|
||||
.then((result) {
|
||||
.then((dynamic result) {
|
||||
// Clear metrics map.
|
||||
metricsMap.clear();
|
||||
// Repopulate metrics map.
|
||||
|
@ -2206,7 +2212,7 @@ class ServiceEvent extends ServiceObject {
|
|||
breakpoint = map['breakpoint'];
|
||||
}
|
||||
if (map['pauseBreakpoints'] != null) {
|
||||
pauseBreakpoints = map['pauseBreakpoints'];
|
||||
pauseBreakpoints = new List<Breakpoint>.from(map['pauseBreakpoints']);
|
||||
if (pauseBreakpoints.length > 0) {
|
||||
breakpoint = pauseBreakpoints[0];
|
||||
}
|
||||
|
@ -2389,11 +2395,11 @@ class LibraryDependency implements M.LibraryDependency {
|
|||
|
||||
class Library extends HeapObject implements M.Library {
|
||||
String uri;
|
||||
final dependencies = <LibraryDependency>[];
|
||||
final scripts = <Script>[];
|
||||
final classes = <Class>[];
|
||||
final variables = <Field>[];
|
||||
final functions = <ServiceFunction>[];
|
||||
final List<LibraryDependency> dependencies = <LibraryDependency>[];
|
||||
final List<Script> scripts = <Script>[];
|
||||
final List<Class> classes = <Class>[];
|
||||
final List<Field> variables = <Field>[];
|
||||
final List<ServiceFunction> functions = <ServiceFunction>[];
|
||||
bool _debuggable;
|
||||
bool get debuggable => _debuggable;
|
||||
bool get immutable => false;
|
||||
|
@ -2425,17 +2431,20 @@ class Library extends HeapObject implements M.Library {
|
|||
_loaded = true;
|
||||
_debuggable = map['debuggable'];
|
||||
dependencies.clear();
|
||||
dependencies.addAll(map["dependencies"].map(LibraryDependency._fromMap));
|
||||
for (var dependency in map["dependencies"]) {
|
||||
dependencies.add(LibraryDependency._fromMap(dependency));
|
||||
}
|
||||
scripts.clear();
|
||||
scripts.addAll(removeDuplicatesAndSortLexical(map['scripts']));
|
||||
scripts.addAll(
|
||||
removeDuplicatesAndSortLexical(new List<Script>.from(map['scripts'])));
|
||||
classes.clear();
|
||||
classes.addAll(map['classes']);
|
||||
for (Class c in map['classes']) classes.add(c);
|
||||
classes.sort(ServiceObject.LexicalSortName);
|
||||
variables.clear();
|
||||
variables.addAll(map['variables']);
|
||||
for (Field v in map['variables']) variables.add(v);
|
||||
variables.sort(ServiceObject.LexicalSortName);
|
||||
functions.clear();
|
||||
functions.addAll(map['functions']);
|
||||
for (ServiceFunction f in map['functions']) functions.add(f);
|
||||
functions.sort(ServiceObject.LexicalSortName);
|
||||
}
|
||||
|
||||
|
@ -2520,12 +2529,12 @@ class Class extends HeapObject implements M.Class {
|
|||
bool get hasAllocations => newSpace.notEmpty || oldSpace.notEmpty;
|
||||
bool get hasNoAllocations => newSpace.empty && oldSpace.empty;
|
||||
bool traceAllocations = false;
|
||||
final fields = <Field>[];
|
||||
final functions = <ServiceFunction>[];
|
||||
final List<Field> fields = <Field>[];
|
||||
final List<ServiceFunction> functions = <ServiceFunction>[];
|
||||
|
||||
Class superclass;
|
||||
final interfaces = <Instance>[];
|
||||
final subclasses = <Class>[];
|
||||
final List<Instance> interfaces = <Instance>[];
|
||||
final List<Class> subclasses = <Class>[];
|
||||
|
||||
Instance superType;
|
||||
Instance mixin;
|
||||
|
@ -2572,19 +2581,19 @@ class Class extends HeapObject implements M.Class {
|
|||
isImplemented = map['_implemented'];
|
||||
|
||||
subclasses.clear();
|
||||
subclasses.addAll(map['subclasses']);
|
||||
for (Class c in map['subclasses']) subclasses.add(c);
|
||||
subclasses.sort(ServiceObject.LexicalSortName);
|
||||
|
||||
interfaces.clear();
|
||||
interfaces.addAll(map['interfaces']);
|
||||
for (Instance i in map['interfaces']) interfaces.add(i);
|
||||
interfaces.sort(ServiceObject.LexicalSortName);
|
||||
|
||||
fields.clear();
|
||||
fields.addAll(map['fields']);
|
||||
for (Field f in map['fields']) fields.add(f);
|
||||
fields.sort(ServiceObject.LexicalSortName);
|
||||
|
||||
functions.clear();
|
||||
functions.addAll(map['functions']);
|
||||
for (ServiceFunction f in map['functions']) functions.add(f);
|
||||
functions.sort(ServiceObject.LexicalSortName);
|
||||
|
||||
superclass = map['super'];
|
||||
|
@ -2711,7 +2720,7 @@ M.InstanceKind stringToInstanceKind(String s) {
|
|||
throw new FallThroughError();
|
||||
}
|
||||
|
||||
class Guarded<T> implements M.Guarded<T> {
|
||||
class Guarded<T extends ServiceObject> implements M.Guarded<T> {
|
||||
bool get isValue => asValue != null;
|
||||
bool get isSentinel => asSentinel != null;
|
||||
final Sentinel asSentinel;
|
||||
|
@ -2772,7 +2781,7 @@ class Instance extends HeapObject implements M.Instance {
|
|||
var nativeFields;
|
||||
Iterable<Guarded<HeapObject>> elements; // If a List.
|
||||
Iterable<MapAssociation> associations; // If a Map.
|
||||
Iterable<dynamic> typedElements; // If a TypedData.
|
||||
List<dynamic> typedElements; // If a TypedData.
|
||||
HeapObject referent; // If a MirrorReference.
|
||||
Instance key; // If a WeakProperty.
|
||||
Instance value; // If a WeakProperty.
|
||||
|
@ -2874,9 +2883,11 @@ class Instance extends HeapObject implements M.Instance {
|
|||
twoByteBytecode = map['_twoByteBytecode'];
|
||||
|
||||
if (map['fields'] != null) {
|
||||
fields = map['fields']
|
||||
.map((f) => new BoundField(f['decl'], f['value']))
|
||||
.toList();
|
||||
var fields = new List<BoundField>();
|
||||
for (var f in map['fields']) {
|
||||
fields.add(new BoundField(f['decl'], f['value']));
|
||||
}
|
||||
this.fields = fields;
|
||||
} else {
|
||||
fields = null;
|
||||
}
|
||||
|
@ -2890,8 +2901,11 @@ class Instance extends HeapObject implements M.Instance {
|
|||
// Should be:
|
||||
// elements = map['elements'].map((e) => new Guarded<Instance>(e)).toList();
|
||||
// some times we obtain object that are not InstanceRef
|
||||
elements =
|
||||
map['elements'].map((e) => new Guarded<ServiceObject>(e)).toList();
|
||||
var localElements = new List<Guarded<HeapObject>>();
|
||||
for (var element in map['elements']) {
|
||||
localElements.add(new Guarded<HeapObject>(element));
|
||||
}
|
||||
elements = localElements;
|
||||
} else {
|
||||
elements = null;
|
||||
}
|
||||
|
@ -3003,8 +3017,15 @@ class Context extends HeapObject implements M.Context {
|
|||
return;
|
||||
}
|
||||
|
||||
variables = (map['variables'] ?? const [])
|
||||
.map((element) => new ContextElement(element));
|
||||
if (map['variables'] == null) {
|
||||
variables = <ContextElement>[];
|
||||
} else {
|
||||
var localVariables = new List<ContextElement>();
|
||||
for (var element in map['variables']) {
|
||||
localVariables.add(new ContextElement(element));
|
||||
}
|
||||
variables = localVariables;
|
||||
}
|
||||
|
||||
// We are fully loaded.
|
||||
_loaded = true;
|
||||
|
@ -4043,7 +4064,7 @@ class TypeArguments extends HeapObject implements M.TypeArguments {
|
|||
if (mapIsRef) {
|
||||
return;
|
||||
}
|
||||
types = map['types'];
|
||||
types = new List<Instance>.from(map['types']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4566,7 +4587,11 @@ class Frame extends ServiceObject implements M.Frame {
|
|||
this.function = map['function'];
|
||||
this.location = map['location'];
|
||||
this.code = map['code'];
|
||||
this.variables = map['vars'] ?? [];
|
||||
if (map['vars'] == null) {
|
||||
this.variables = <ServiceMap>[];
|
||||
} else {
|
||||
this.variables = new List<ServiceMap>.from(map['vars']);
|
||||
}
|
||||
}
|
||||
|
||||
M.FrameKind _fromString(String frameKind) {
|
||||
|
|
|
@ -18,17 +18,17 @@ void script() {
|
|||
}
|
||||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) => isolate.rootLibrary.load().then((Library lib) {
|
||||
expect(lib.uri.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.current.instances +
|
||||
fooClass.oldSpace.current.instances,
|
||||
equals(3));
|
||||
});
|
||||
}),
|
||||
(Isolate isolate) async {
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
expect(lib.uri.endsWith('allocations_test.dart'), isTrue);
|
||||
expect(lib.classes.length, equals(1));
|
||||
Class fooClass = await lib.classes.first.load();
|
||||
expect(fooClass.name, equals('Foo'));
|
||||
expect(
|
||||
fooClass.newSpace.current.instances +
|
||||
fooClass.oldSpace.current.instances,
|
||||
equals(3));
|
||||
},
|
||||
];
|
||||
|
||||
main(args) => runIsolateTests(args, tests, testeeBefore: script);
|
||||
|
|
|
@ -3,14 +3,15 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// VMOptions=--error_on_bad_type --error_on_bad_override
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'package:observatory/service_io.dart';
|
||||
import 'package:unittest/unittest.dart';
|
||||
import 'service_test_common.dart';
|
||||
import 'test_helper.dart';
|
||||
|
||||
const int LINE_A = 19;
|
||||
const int LINE_B = 25;
|
||||
const int LINE_A = 20;
|
||||
const int LINE_B = 26;
|
||||
|
||||
foo() {}
|
||||
|
||||
|
@ -34,7 +35,7 @@ testeeDo() {
|
|||
});
|
||||
}
|
||||
|
||||
checkAsyncVarDescriptors(Isolate isolate) async {
|
||||
Future checkAsyncVarDescriptors(Isolate isolate) async {
|
||||
ServiceMap stack = await isolate.getStack();
|
||||
expect(stack.type, equals('Stack'));
|
||||
expect(stack['frames'].length, greaterThanOrEqualTo(1));
|
||||
|
@ -43,7 +44,7 @@ checkAsyncVarDescriptors(Isolate isolate) async {
|
|||
expect(vars, equals('param1 local1')); // no :async_op et al
|
||||
}
|
||||
|
||||
checkAsyncStarVarDescriptors(Isolate isolate) async {
|
||||
Future checkAsyncStarVarDescriptors(Isolate isolate) async {
|
||||
ServiceMap stack = await isolate.getStack();
|
||||
expect(stack.type, equals('Stack'));
|
||||
expect(stack['frames'].length, greaterThanOrEqualTo(1));
|
||||
|
|
|
@ -49,7 +49,7 @@ void testeeDoNamed() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var rootLib = await isolate.rootLibrary.load();
|
||||
Library rootLib = await isolate.rootLibrary.load();
|
||||
|
||||
var breaksHit = 0;
|
||||
|
||||
|
@ -93,7 +93,7 @@ var tests = <IsolateTest>[
|
|||
await cancelFutureSubscription(subscriptionFuture);
|
||||
},
|
||||
(Isolate isolate) async {
|
||||
var rootLib = await isolate.rootLibrary.load();
|
||||
Library rootLib = await isolate.rootLibrary.load();
|
||||
|
||||
var breaksHit = 0;
|
||||
|
||||
|
@ -137,7 +137,7 @@ var tests = <IsolateTest>[
|
|||
await cancelFutureSubscription(subscriptionFuture);
|
||||
},
|
||||
(Isolate isolate) async {
|
||||
var rootLib = await isolate.rootLibrary.load();
|
||||
Library rootLib = await isolate.rootLibrary.load();
|
||||
|
||||
var breaksHit = 0;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ var tests = <IsolateTest>[
|
|||
|
||||
// Add breakpoint
|
||||
(Isolate isolate) async {
|
||||
var rootLib = await isolate.rootLibrary.load();
|
||||
Library rootLib = await isolate.rootLibrary.load();
|
||||
var function =
|
||||
rootLib.functions.singleWhere((f) => f.name == 'testFunction');
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ var tests = <IsolateTest>[
|
|||
|
||||
// Add breakpoints.
|
||||
(Isolate isolate) async {
|
||||
var rootLib = await isolate.rootLibrary.load();
|
||||
Library rootLib = await isolate.rootLibrary.load();
|
||||
var script = rootLib.scripts[0];
|
||||
|
||||
var bpt1 = await isolate.addBreakpoint(script, LINE_A);
|
||||
|
|
|
@ -50,72 +50,61 @@ void script() {
|
|||
}
|
||||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) => isolate.rootLibrary.load().then((Library lib) {
|
||||
Field field = lib.variables.singleWhere((v) => v.name == 'cleanBlock');
|
||||
return field.load().then((_) {
|
||||
return field.staticValue.load().then((Instance block) {
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext, isNull);
|
||||
});
|
||||
});
|
||||
}),
|
||||
(Isolate isolate) => isolate.rootLibrary.load().then((Library lib) {
|
||||
Field field =
|
||||
lib.variables.singleWhere((v) => v.name == 'copyingBlock');
|
||||
return field.load().then((_) {
|
||||
return field.staticValue.load().then((Instance block) {
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext.isContext, isTrue);
|
||||
expect(block.closureContext.length, equals(1));
|
||||
return block.closureContext.load().then((Context ctxt) {
|
||||
expect(ctxt.variables.single.value.asValue.isString, isTrue);
|
||||
expect(ctxt.variables.single.value.asValue.valueAsString,
|
||||
equals('I could be copied into the block'));
|
||||
expect(ctxt.parentContext, isNull);
|
||||
});
|
||||
});
|
||||
});
|
||||
}),
|
||||
(Isolate isolate) => isolate.rootLibrary.load().then((Library lib) {
|
||||
Field field = lib.variables.singleWhere((v) => v.name == 'fullBlock');
|
||||
return field.load().then((_) {
|
||||
return field.staticValue.load().then((Instance block) {
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext.isContext, isTrue);
|
||||
expect(block.closureContext.length, equals(1));
|
||||
return block.closureContext.load().then((Context ctxt) {
|
||||
expect(ctxt.variables.single.value.asValue.isInt, isTrue);
|
||||
expect(ctxt.variables.single.value.asValue.valueAsString,
|
||||
equals('43'));
|
||||
expect(ctxt.parentContext, isNull);
|
||||
});
|
||||
});
|
||||
});
|
||||
}),
|
||||
(Isolate isolate) => isolate.rootLibrary.load().then((Library lib) {
|
||||
Field field =
|
||||
lib.variables.singleWhere((v) => v.name == 'fullBlockWithChain');
|
||||
return field.load().then((_) {
|
||||
return field.staticValue.load().then((Instance block) {
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext.isContext, isTrue);
|
||||
expect(block.closureContext.length, equals(1));
|
||||
return block.closureContext.load().then((Context ctxt) {
|
||||
expect(ctxt.variables.single.value.asValue.isInt, isTrue);
|
||||
expect(ctxt.variables.single.value.asValue.valueAsString,
|
||||
equals('4201'));
|
||||
expect(ctxt.parentContext.isContext, isTrue);
|
||||
expect(ctxt.parentContext.length, equals(1));
|
||||
return ctxt.parentContext.load().then((Context outerCtxt) {
|
||||
expect(outerCtxt.variables.single.value.asValue.isInt, isTrue);
|
||||
expect(outerCtxt.variables.single.value.asValue.valueAsString,
|
||||
equals('421'));
|
||||
expect(outerCtxt.parentContext, isNull);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}),
|
||||
(Isolate isolate) async {
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field field = lib.variables.singleWhere((v) => v.name == 'cleanBlock');
|
||||
await field.load();
|
||||
Instance block = await field.staticValue.load();
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext, isNull);
|
||||
},
|
||||
(Isolate isolate) async {
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field field = lib.variables.singleWhere((v) => v.name == 'copyingBlock');
|
||||
await field.load();
|
||||
Instance block = await field.staticValue.load();
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext.isContext, isTrue);
|
||||
expect(block.closureContext.length, equals(1));
|
||||
Context ctxt = await block.closureContext.load();
|
||||
expect(ctxt.variables.single.value.asValue.isString, isTrue);
|
||||
expect(ctxt.variables.single.value.asValue.valueAsString,
|
||||
equals('I could be copied into the block'));
|
||||
expect(ctxt.parentContext, isNull);
|
||||
},
|
||||
(Isolate isolate) async {
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field field = lib.variables.singleWhere((v) => v.name == 'fullBlock');
|
||||
await field.load();
|
||||
Instance block = await field.staticValue.load();
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext.isContext, isTrue);
|
||||
expect(block.closureContext.length, equals(1));
|
||||
Context ctxt = await block.closureContext.load();
|
||||
expect(ctxt.variables.single.value.asValue.isInt, isTrue);
|
||||
expect(ctxt.variables.single.value.asValue.valueAsString, equals('43'));
|
||||
expect(ctxt.parentContext, isNull);
|
||||
},
|
||||
(Isolate isolate) async {
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field field =
|
||||
lib.variables.singleWhere((v) => v.name == 'fullBlockWithChain');
|
||||
await field.load();
|
||||
Instance block = await field.staticValue.load();
|
||||
expect(block.isClosure, isTrue);
|
||||
expect(block.closureContext.isContext, isTrue);
|
||||
expect(block.closureContext.length, equals(1));
|
||||
Context ctxt = await block.closureContext.load();
|
||||
expect(ctxt.variables.single.value.asValue.isInt, isTrue);
|
||||
expect(ctxt.variables.single.value.asValue.valueAsString, equals('4201'));
|
||||
expect(ctxt.parentContext.isContext, isTrue);
|
||||
expect(ctxt.parentContext.length, equals(1));
|
||||
Context outerCtxt = await ctxt.parentContext.load();
|
||||
expect(outerCtxt.variables.single.value.asValue.isInt, isTrue);
|
||||
expect(
|
||||
outerCtxt.variables.single.value.asValue.valueAsString, equals('421'));
|
||||
expect(outerCtxt.parentContext, isNull);
|
||||
},
|
||||
];
|
||||
|
||||
main(args) => runIsolateTests(args, tests, testeeBefore: script);
|
||||
|
|
|
@ -113,7 +113,7 @@ buildGraph() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
final rootLib = await isolate.rootLibrary.load();
|
||||
final Library rootLib = await isolate.rootLibrary.load();
|
||||
final raw =
|
||||
await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.user, false).last;
|
||||
final snapshot = new HeapSnapshot();
|
||||
|
|
|
@ -113,7 +113,7 @@ buildGraph() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
final rootLib = await isolate.rootLibrary.load();
|
||||
final Library rootLib = await isolate.rootLibrary.load();
|
||||
final raw =
|
||||
await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.vm, false).last;
|
||||
final snapshot = new HeapSnapshot();
|
||||
|
|
|
@ -33,42 +33,39 @@ var tests = <IsolateTest>[
|
|||
hasStoppedAtBreakpoint,
|
||||
|
||||
// Evaluate against library, class, and instance.
|
||||
(Isolate isolate) {
|
||||
return isolate.getStack().then((ServiceMap stack) {
|
||||
// Make sure we are in the right place.
|
||||
expect(stack.type, equals('Stack'));
|
||||
expect(stack['frames'].length, greaterThanOrEqualTo(2));
|
||||
expect(stack['frames'][0].function.name, equals('method'));
|
||||
expect(stack['frames'][0].function.dartOwner.name, equals('MyClass'));
|
||||
(Isolate isolate) async {
|
||||
ServiceMap stack = await isolate.getStack();
|
||||
|
||||
var lib = isolate.rootLibrary;
|
||||
var cls = stack['frames'][0].function.dartOwner;
|
||||
var instance = stack['frames'][0].variables[0]['value'];
|
||||
// Make sure we are in the right place.
|
||||
expect(stack.type, equals('Stack'));
|
||||
expect(stack['frames'].length, greaterThanOrEqualTo(2));
|
||||
expect(stack['frames'][0].function.name, equals('method'));
|
||||
expect(stack['frames'][0].function.dartOwner.name, equals('MyClass'));
|
||||
|
||||
List evals = [];
|
||||
evals.add(lib.evaluate('globalVar + 5').then((result) {
|
||||
print(result);
|
||||
expect(result.valueAsString, equals('105'));
|
||||
}));
|
||||
evals.add(lib.evaluate('globalVar + staticVar + 5').then((result) {
|
||||
expect(result.type, equals('Error'));
|
||||
}));
|
||||
evals.add(cls.evaluate('globalVar + staticVar + 5').then((result) {
|
||||
print(result);
|
||||
expect(result.valueAsString, equals('1105'));
|
||||
}));
|
||||
evals.add(cls.evaluate('this + 5').then((result) {
|
||||
expect(result.type, equals('Error'));
|
||||
}));
|
||||
evals.add(instance.evaluate('this + 5').then((result) {
|
||||
print(result);
|
||||
expect(result.valueAsString, equals('10005'));
|
||||
}));
|
||||
evals.add(instance.evaluate('this + frog').then((result) {
|
||||
expect(result.type, equals('Error'));
|
||||
}));
|
||||
return Future.wait(evals);
|
||||
});
|
||||
var lib = isolate.rootLibrary;
|
||||
var cls = stack['frames'][0].function.dartOwner;
|
||||
var instance = stack['frames'][0].variables[0]['value'];
|
||||
|
||||
dynamic result = await lib.evaluate('globalVar + 5');
|
||||
print(result);
|
||||
expect(result.valueAsString, equals('105'));
|
||||
|
||||
result = await lib.evaluate('globalVar + staticVar + 5');
|
||||
expect(result.type, equals('Error'));
|
||||
|
||||
result = await cls.evaluate('globalVar + staticVar + 5');
|
||||
print(result);
|
||||
expect(result.valueAsString, equals('1105'));
|
||||
|
||||
result = await cls.evaluate('this + 5');
|
||||
expect(result.type, equals('Error'));
|
||||
|
||||
result = await instance.evaluate('this + 5');
|
||||
print(result);
|
||||
expect(result.valueAsString, equals('10005'));
|
||||
|
||||
result = await instance.evaluate('this + frog');
|
||||
expect(result.type, equals('Error'));
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -35,14 +35,14 @@ var tests = <IsolateTest>[
|
|||
expect(stack['frames'].length, greaterThanOrEqualTo(1));
|
||||
expect(stack['frames'][0].function.name, equals('foo'));
|
||||
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
var thing1 =
|
||||
(await lib.variables.singleWhere((v) => v.name == "thing1").load())
|
||||
.staticValue;
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field thing1Field =
|
||||
await lib.variables.singleWhere((v) => v.name == "thing1").load();
|
||||
var thing1 = thing1Field.staticValue;
|
||||
print(thing1);
|
||||
var thing2 =
|
||||
(await lib.variables.singleWhere((v) => v.name == "thing2").load())
|
||||
.staticValue;
|
||||
Field thing2Field =
|
||||
await lib.variables.singleWhere((v) => v.name == "thing2").load();
|
||||
var thing2 = thing2Field.staticValue;
|
||||
print(thing2);
|
||||
|
||||
var result = await isolate
|
||||
|
|
|
@ -17,14 +17,14 @@ testeeMain() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
var thing1 =
|
||||
(await lib.variables.singleWhere((v) => v.name == "thing1").load())
|
||||
.staticValue;
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field thing1Field =
|
||||
await lib.variables.singleWhere((v) => v.name == "thing1").load();
|
||||
var thing1 = thing1Field.staticValue;
|
||||
print(thing1);
|
||||
var thing2 =
|
||||
(await lib.variables.singleWhere((v) => v.name == "thing2").load())
|
||||
.staticValue;
|
||||
Field thing2Field =
|
||||
await lib.variables.singleWhere((v) => v.name == "thing2").load();
|
||||
var thing2 = thing2Field.staticValue;
|
||||
print(thing2);
|
||||
|
||||
var result = await lib.evaluate("x + y", scope: {"x": thing1, "y": thing2});
|
||||
|
|
|
@ -55,7 +55,7 @@ var tests = <IsolateTest>[
|
|||
var fooClass = await getClassFromRootLib(isolate, 'Foo');
|
||||
await fooClass.reload();
|
||||
expect(fooClass.traceAllocations, isTrue);
|
||||
var profileResponse = await fooClass.getAllocationSamples();
|
||||
dynamic profileResponse = await fooClass.getAllocationSamples();
|
||||
expect(profileResponse, isNotNull);
|
||||
expect(profileResponse['type'], equals('_CpuProfile'));
|
||||
await fooClass.setTraceAllocations(false);
|
||||
|
|
|
@ -39,7 +39,7 @@ bool closureMatcher(handler) {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var result = await isolate.invokeRpc('_getPorts', {});
|
||||
dynamic result = await isolate.invokeRpc('_getPorts', {});
|
||||
expect(result['type'], equals('_Ports'));
|
||||
expect(result['ports'], isList);
|
||||
var ports = result['ports'];
|
||||
|
|
|
@ -85,7 +85,7 @@ var tests = <IsolateTest>[
|
|||
expect(msgHandlerObjectId, isNotNull);
|
||||
|
||||
// Get object.
|
||||
var object = await isolate.getObject(msgHandlerObjectId);
|
||||
Instance object = await isolate.getObject(msgHandlerObjectId);
|
||||
expect(object.valueAsString, equals('34'));
|
||||
}
|
||||
];
|
||||
|
|
|
@ -27,11 +27,11 @@ primeTimeline() {
|
|||
Timeline.finishSync();
|
||||
}
|
||||
|
||||
List<Map> filterForDartEvents(List<Map> events) {
|
||||
List filterForDartEvents(List events) {
|
||||
return events.where((event) => event['cat'] == 'Dart').toList();
|
||||
}
|
||||
|
||||
bool eventsContains(List<Map> events, String phase, String name) {
|
||||
bool eventsContains(List events, String phase, String name) {
|
||||
for (Map event in events) {
|
||||
if ((event['ph'] == phase) && (event['name'] == name)) {
|
||||
return true;
|
||||
|
@ -40,7 +40,7 @@ bool eventsContains(List<Map> events, String phase, String name) {
|
|||
return false;
|
||||
}
|
||||
|
||||
int timeOrigin(List<Map> events) {
|
||||
int timeOrigin(List events) {
|
||||
if (events.length == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ int timeOrigin(List<Map> events) {
|
|||
return smallest;
|
||||
}
|
||||
|
||||
int timeDuration(List<Map> events, int timeOrigin) {
|
||||
int timeDuration(List events, int timeOrigin) {
|
||||
if (events.length == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ int timeDuration(List<Map> events, int timeOrigin) {
|
|||
return biggestDuration;
|
||||
}
|
||||
|
||||
void allEventsHaveIsolateNumber(List<Map> events) {
|
||||
void allEventsHaveIsolateNumber(List events) {
|
||||
for (Map event in events) {
|
||||
if (event['ph'] == 'M') {
|
||||
// Skip meta-data events.
|
||||
|
@ -99,7 +99,7 @@ var tests = <VMTest>[
|
|||
expect(result['type'], equals('_Timeline'));
|
||||
expect(result['traceEvents'], new isInstanceOf<List>());
|
||||
final int numEvents = result['traceEvents'].length;
|
||||
List<Map> dartEvents = filterForDartEvents(result['traceEvents']);
|
||||
List dartEvents = filterForDartEvents(result['traceEvents']);
|
||||
expect(dartEvents.length, equals(11));
|
||||
allEventsHaveIsolateNumber(dartEvents);
|
||||
allEventsHaveIsolateNumber(result['traceEvents']);
|
||||
|
@ -121,7 +121,7 @@ var tests = <VMTest>[
|
|||
// Verify that we received fewer events than before.
|
||||
expect(result['traceEvents'].length, lessThan(numEvents));
|
||||
// Verify that we have the same number of Dart events.
|
||||
List<Map> dartEvents2 = filterForDartEvents(result['traceEvents']);
|
||||
List dartEvents2 = filterForDartEvents(result['traceEvents']);
|
||||
expect(dartEvents2.length, dartEvents.length);
|
||||
},
|
||||
];
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
library implicit_getter_setter_test;
|
||||
|
||||
import 'dart:async';
|
||||
import 'package:observatory/service_io.dart';
|
||||
import 'package:unittest/unittest.dart';
|
||||
import 'test_helper.dart';
|
||||
|
@ -18,7 +19,7 @@ script() {
|
|||
}
|
||||
}
|
||||
|
||||
testGetter(Isolate isolate) async {
|
||||
Future testGetter(Isolate isolate) async {
|
||||
Library rootLibrary = await isolate.rootLibrary.load();
|
||||
expect(rootLibrary.classes.length, equals(1));
|
||||
Class classA = await rootLibrary.classes[0].load();
|
||||
|
@ -40,7 +41,7 @@ testGetter(Isolate isolate) async {
|
|||
expect(classDouble.name, equals('_Double'));
|
||||
}
|
||||
|
||||
testSetter(Isolate isolate) async {
|
||||
Future testSetter(Isolate isolate) async {
|
||||
Library rootLibrary = await isolate.rootLibrary.load();
|
||||
expect(rootLibrary.classes.length, equals(1));
|
||||
Class classA = await rootLibrary.classes[0].load();
|
||||
|
|
|
@ -28,8 +28,8 @@ void script() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
var field = lib.variables.where((v) => v.name == 'e').single;
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field field = lib.variables.where((v) => v.name == 'e').single;
|
||||
await field.load();
|
||||
Instance e = field.staticValue;
|
||||
ServiceMap response = await isolate.getInboundReferences(e, 100);
|
||||
|
|
|
@ -13,7 +13,7 @@ import 'dart:convert' deferred as convert;
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
// Use mirrors to shutup the analyzer.
|
||||
mirrors.currentMirrorSystem();
|
||||
importOf(String uri) {
|
||||
|
|
|
@ -27,7 +27,7 @@ void script() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field fooField = lib.variables.singleWhere((v) => v.name == 'foo');
|
||||
await fooField.load();
|
||||
Instance foo = fooField.staticValue;
|
||||
|
@ -38,7 +38,7 @@ var tests = <IsolateTest>[
|
|||
expect(foo.isMirrorReference, isFalse);
|
||||
expect(ref.isMirrorReference, isTrue);
|
||||
expect(ref.referent, isNull);
|
||||
var loadedRef = await ref.load();
|
||||
Instance loadedRef = await ref.load();
|
||||
expect(loadedRef.referent, isNotNull);
|
||||
expect(loadedRef.referent.name, equals('Foo'));
|
||||
expect(loadedRef.referent, equals(foo.clazz));
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// VMOptions=--error_on_bad_type --error_on_bad_override
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'test_helper.dart';
|
||||
|
@ -23,7 +24,7 @@ void script() {
|
|||
print(stackSlot); // Prevent optimizing away the stack slot.
|
||||
}
|
||||
|
||||
checkForStackReferent(Isolate isolate) async {
|
||||
Future checkForStackReferent(Isolate isolate) async {
|
||||
Library corelib =
|
||||
isolate.libraries.singleWhere((lib) => lib.uri == 'dart:core');
|
||||
await corelib.load();
|
||||
|
|
|
@ -26,7 +26,7 @@ doUncaught() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var lib = await isolate.rootLibrary.reload();
|
||||
Library lib = await isolate.rootLibrary.reload();
|
||||
|
||||
var onPaused = null;
|
||||
var onResume = null;
|
||||
|
@ -75,7 +75,7 @@ var tests = <IsolateTest>[
|
|||
await t.future;
|
||||
}
|
||||
|
||||
var res = await fres;
|
||||
dynamic res = await fres;
|
||||
print(res);
|
||||
if (shouldBeCaught) {
|
||||
expect(res.isInstance, isTrue);
|
||||
|
|
|
@ -64,12 +64,12 @@ Future setupProcesses() async {
|
|||
return new Future.value(new ServiceExtensionResponse.result(result));
|
||||
}
|
||||
|
||||
Future<ServiceExtensionResponse> closeStdin(ignored_a, ignored_b) async {
|
||||
Future<ServiceExtensionResponse> closeStdin(ignored_a, ignored_b) {
|
||||
process3.stdin.close();
|
||||
var result = JSON.encode({'type': 'foobar'});
|
||||
var returnValue =
|
||||
new Future.value(new ServiceExtensionResponse.result(result));
|
||||
return process3.exitCode.then((int exit) => returnValue);
|
||||
return process3.exitCode.then<ServiceExtensionResponse>((int exit) {
|
||||
var result = JSON.encode({'type': 'foobar'});
|
||||
return new ServiceExtensionResponse.result(result);
|
||||
});
|
||||
}
|
||||
|
||||
registerExtension('ext.dart.io.cleanup', cleanup);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// VMOptions=--error_on_bad_type --error_on_bad_override
|
||||
|
||||
import 'dart:async';
|
||||
import 'package:observatory/service_io.dart';
|
||||
import 'package:unittest/unittest.dart';
|
||||
import 'test_helper.dart';
|
||||
|
@ -27,16 +28,14 @@ buildGraph() {
|
|||
p1.y = p2.y = new List();
|
||||
}
|
||||
|
||||
getReachableSize(ServiceObject obj) {
|
||||
return obj.isolate.getReachableSize(obj).then((Instance obj) {
|
||||
return int.parse(obj.valueAsString);
|
||||
});
|
||||
Future<int> getReachableSize(ServiceObject obj) async {
|
||||
Instance size = await obj.isolate.getReachableSize(obj);
|
||||
return int.parse(size.valueAsString);
|
||||
}
|
||||
|
||||
getRetainedSize(ServiceObject obj) {
|
||||
return obj.isolate.getRetainedSize(obj).then((Instance obj) {
|
||||
return int.parse(obj.valueAsString);
|
||||
});
|
||||
Future<int> getRetainedSize(ServiceObject obj) async {
|
||||
Instance size = await obj.isolate.getRetainedSize(obj);
|
||||
return int.parse(size.valueAsString);
|
||||
}
|
||||
|
||||
var tests = <IsolateTest>[
|
||||
|
|
|
@ -53,7 +53,7 @@ var tests = <IsolateTest>[
|
|||
stoppedAtLine(LINE_A),
|
||||
(Isolate isolate) async {
|
||||
// We are at our breakpoint with global=100.
|
||||
var result = await isolate.rootLibrary.evaluate('global');
|
||||
Instance result = await isolate.rootLibrary.evaluate('global');
|
||||
print('global is $result');
|
||||
expect(result.type, equals('Instance'));
|
||||
expect(result.valueAsString, equals('100'));
|
||||
|
|
|
@ -79,14 +79,14 @@ var tests = <IsolateTest>[
|
|||
},
|
||||
(Isolate isolate) async {
|
||||
// We are at our breakpoint with global=100.
|
||||
var result = await isolate.rootLibrary.evaluate('global');
|
||||
Instance result = await isolate.rootLibrary.evaluate('global');
|
||||
print('global is $result');
|
||||
expect(result.type, equals('Instance'));
|
||||
expect(result.valueAsString, equals('100'));
|
||||
|
||||
// Rewind the top stack frame.
|
||||
result = await isolate.rewind(1);
|
||||
expect(result['type'], equals('Success'));
|
||||
var result2 = await isolate.rewind(1);
|
||||
expect(result2['type'], equals('Success'));
|
||||
},
|
||||
hasStoppedAtBreakpoint,
|
||||
stoppedAtLine(LINE_B),
|
||||
|
@ -98,52 +98,52 @@ var tests = <IsolateTest>[
|
|||
stoppedAtLine(LINE_A),
|
||||
(Isolate isolate) async {
|
||||
// global still is equal to 100. We did not execute "global++".
|
||||
var result = await isolate.rootLibrary.evaluate('global');
|
||||
Instance result = await isolate.rootLibrary.evaluate('global');
|
||||
print('global is $result');
|
||||
expect(result.type, equals('Instance'));
|
||||
expect(result.valueAsString, equals('100'));
|
||||
|
||||
// Resume again, for fun.
|
||||
result = await isolate.resume();
|
||||
expect(result['type'], equals('Success'));
|
||||
var result2 = await isolate.resume();
|
||||
expect(result2['type'], equals('Success'));
|
||||
},
|
||||
hasStoppedAtBreakpoint,
|
||||
stoppedAtLine(LINE_A),
|
||||
(Isolate isolate) async {
|
||||
// global is now 101.
|
||||
var result = await isolate.rootLibrary.evaluate('global');
|
||||
Instance result = await isolate.rootLibrary.evaluate('global');
|
||||
print('global is $result');
|
||||
expect(result.type, equals('Instance'));
|
||||
expect(result.valueAsString, equals('101'));
|
||||
|
||||
// Rewind up to 'test'/
|
||||
result = await isolate.rewind(3);
|
||||
expect(result['type'], equals('Success'));
|
||||
var result2 = await isolate.rewind(3);
|
||||
expect(result2['type'], equals('Success'));
|
||||
},
|
||||
hasStoppedAtBreakpoint,
|
||||
stoppedAtLine(LINE_D),
|
||||
(Isolate isolate) async {
|
||||
// Reset global to 0 and start again.
|
||||
var result = await isolate.rootLibrary.evaluate('global=0');
|
||||
Instance result = await isolate.rootLibrary.evaluate('global=0');
|
||||
print('set global to $result');
|
||||
expect(result.type, equals('Instance'));
|
||||
expect(result.valueAsString, equals('0'));
|
||||
|
||||
result = await isolate.resume();
|
||||
expect(result['type'], equals('Success'));
|
||||
var result2 = await isolate.resume();
|
||||
expect(result2['type'], equals('Success'));
|
||||
},
|
||||
hasStoppedAtBreakpoint,
|
||||
stoppedAtLine(LINE_A),
|
||||
(Isolate isolate) async {
|
||||
// We are at our breakpoint with global=100.
|
||||
var result = await isolate.rootLibrary.evaluate('global');
|
||||
Instance result = await isolate.rootLibrary.evaluate('global');
|
||||
print('global is $result');
|
||||
expect(result.type, equals('Instance'));
|
||||
expect(result.valueAsString, equals('100'));
|
||||
|
||||
// Rewind the top 2 stack frames.
|
||||
result = await isolate.rewind(2);
|
||||
expect(result['type'], equals('Success'));
|
||||
var result2 = await isolate.rewind(2);
|
||||
expect(result2['type'], equals('Success'));
|
||||
},
|
||||
hasStoppedAtBreakpoint,
|
||||
stoppedAtLine(LINE_C),
|
||||
|
|
|
@ -45,169 +45,81 @@ external_service_disappear_test: Crash # Issue 31587
|
|||
# Issue 31587
|
||||
[ $compiler == dartk && $strong ]
|
||||
add_breakpoint_rpc_kernel_test: CompileTimeError
|
||||
allocations_test: CompileTimeError
|
||||
async_next_test: CompileTimeError
|
||||
async_scope_test: CompileTimeError
|
||||
async_single_step_exception_test: CompileTimeError
|
||||
async_single_step_into_test: CompileTimeError
|
||||
async_single_step_out_test: CompileTimeError
|
||||
async_star_single_step_into_test: CompileTimeError
|
||||
async_star_step_out_test: CompileTimeError
|
||||
async_step_out_test: CompileTimeError
|
||||
auth_token1_test: CompileTimeError
|
||||
auth_token_test: CompileTimeError
|
||||
awaiter_async_stack_contents_test: CompileTimeError
|
||||
async_next_test: RuntimeError
|
||||
async_scope_test: RuntimeError
|
||||
async_single_step_exception_test: RuntimeError
|
||||
async_single_step_into_test: RuntimeError
|
||||
awaiter_async_stack_contents_test: RuntimeError
|
||||
bad_web_socket_address_test: CompileTimeError
|
||||
break_on_activation_test: CompileTimeError
|
||||
break_on_default_constructor_test: CompileTimeError
|
||||
break_on_function_test: CompileTimeError
|
||||
breakpoint_in_parts_class_test: CompileTimeError
|
||||
break_on_function_test: RuntimeError
|
||||
breakpoint_in_parts_class_test: RuntimeError
|
||||
breakpoint_two_args_checked_test: CompileTimeError
|
||||
caching_test: CompileTimeError
|
||||
causal_async_stack_contents_test: CompileTimeError
|
||||
causal_async_stack_presence_test: CompileTimeError
|
||||
causal_async_star_stack_contents_test: CompileTimeError
|
||||
causal_async_star_stack_presence_test: CompileTimeError
|
||||
code_test: CompileTimeError
|
||||
collect_all_garbage_test: CompileTimeError
|
||||
caching_test: RuntimeError
|
||||
causal_async_stack_contents_test: RuntimeError
|
||||
causal_async_stack_presence_test: RuntimeError
|
||||
causal_async_star_stack_contents_test: RuntimeError
|
||||
causal_async_star_stack_presence_test: RuntimeError
|
||||
code_test: RuntimeError
|
||||
command_test: CompileTimeError
|
||||
contexts_test: CompileTimeError
|
||||
coverage_leaf_function_test: CompileTimeError
|
||||
coverage_optimized_function_test: CompileTimeError
|
||||
crash_dump_test: CompileTimeError
|
||||
dart/spawn_infinite_loop_test: RuntimeError
|
||||
debugger_inspect_test: CompileTimeError
|
||||
debugger_location_second_test: CompileTimeError
|
||||
debugger_location_test: CompileTimeError
|
||||
debugging_inlined_finally_test: CompileTimeError
|
||||
debugging_test: CompileTimeError
|
||||
dev_fs_http_put_test: CompileTimeError
|
||||
dev_fs_http_put_weird_char_test: CompileTimeError
|
||||
dev_fs_spawn_test: CompileTimeError
|
||||
dev_fs_test: CompileTimeError
|
||||
dev_fs_uri_test: CompileTimeError
|
||||
dev_fs_weird_char_test: CompileTimeError
|
||||
developer_server_control_test: CompileTimeError
|
||||
developer_service_get_isolate_id_test: CompileTimeError
|
||||
dominator_tree_user_test: CompileTimeError
|
||||
dominator_tree_vm_test: CompileTimeError
|
||||
echo_test: CompileTimeError
|
||||
eval_test: CompileTimeError
|
||||
debugger_location_second_test: RuntimeError
|
||||
debugger_location_test: RuntimeError
|
||||
debugging_inlined_finally_test: RuntimeError
|
||||
debugging_test: RuntimeError
|
||||
dev_fs_spawn_test: RuntimeError
|
||||
developer_service_get_isolate_id_test: RuntimeError
|
||||
external_service_asynchronous_invocation_test: CompileTimeError
|
||||
external_service_disappear_test: CompileTimeError
|
||||
external_service_notification_invocation_test: CompileTimeError
|
||||
external_service_registration_test: CompileTimeError
|
||||
external_service_registration_via_notification_test: CompileTimeError
|
||||
external_service_synchronous_invocation_test: CompileTimeError
|
||||
field_script_test: CompileTimeError
|
||||
file_service_test: CompileTimeError
|
||||
gc_test: CompileTimeError
|
||||
get_allocation_profile_rpc_test: CompileTimeError
|
||||
get_allocation_samples_test: CompileTimeError
|
||||
get_cpu_profile_timeline_rpc_test: CompileTimeError
|
||||
get_flag_list_rpc_test: CompileTimeError
|
||||
get_heap_map_rpc_test: CompileTimeError
|
||||
get_instances_rpc_test: CompileTimeError
|
||||
get_isolate_after_async_error_test: CompileTimeError
|
||||
get_isolate_after_stack_overflow_error_test: CompileTimeError
|
||||
get_isolate_after_sync_error_test: CompileTimeError
|
||||
get_isolate_rpc_test: CompileTimeError
|
||||
get_object_rpc_test: CompileTimeError
|
||||
get_object_store_rpc_test: CompileTimeError
|
||||
get_ports_rpc_test: CompileTimeError
|
||||
get_retained_size_rpc_test: CompileTimeError
|
||||
get_retaining_path_rpc_test: CompileTimeError
|
||||
get_source_report_test: CompileTimeError
|
||||
get_stack_rpc_test: CompileTimeError
|
||||
get_user_level_retaining_path_rpc_test: CompileTimeError
|
||||
get_version_rpc_test: CompileTimeError
|
||||
get_vm_rpc_test: CompileTimeError
|
||||
get_vm_timeline_rpc_test: CompileTimeError
|
||||
get_zone_memory_info_rpc_test: CompileTimeError
|
||||
implicit_getter_setter_test: CompileTimeError
|
||||
inbound_references_test: CompileTimeError
|
||||
instance_field_order_rpc_test: CompileTimeError
|
||||
isolate_lifecycle_test: CompileTimeError
|
||||
get_object_rpc_test: RuntimeError
|
||||
get_object_store_rpc_test: RuntimeError
|
||||
get_stack_rpc_test: RuntimeError
|
||||
issue_25465_test: CompileTimeError
|
||||
issue_27238_test: CompileTimeError
|
||||
issue_27287_test: CompileTimeError
|
||||
issue_30555_test: CompileTimeError
|
||||
local_variable_declaration_test: CompileTimeError
|
||||
logging_test: CompileTimeError
|
||||
malformed_test: CompileTimeError
|
||||
metrics_test: CompileTimeError
|
||||
mirror_references_test: CompileTimeError
|
||||
mixin_break_test: CompileTimeError
|
||||
native_metrics_test: CompileTimeError
|
||||
next_through_assign_call_test: CompileTimeError
|
||||
next_through_assign_int_test: CompileTimeError
|
||||
next_through_call_on_field_in_class_test: CompileTimeError
|
||||
next_through_call_on_field_test: CompileTimeError
|
||||
next_through_call_on_static_field_in_class_test: CompileTimeError
|
||||
next_through_catch_test: CompileTimeError
|
||||
next_through_closure_test: CompileTimeError
|
||||
next_through_create_list_and_map_test: CompileTimeError
|
||||
next_through_for_each_loop_test: CompileTimeError
|
||||
next_through_for_loop_with_break_and_continue_test: CompileTimeError
|
||||
next_through_function_expression_test: CompileTimeError
|
||||
next_through_implicit_call_test: CompileTimeError, RuntimeError # Runtime error on opt counter builder (#31838)
|
||||
next_through_is_and_as_test: CompileTimeError
|
||||
next_through_multi_catch_test: CompileTimeError
|
||||
next_through_new_test: CompileTimeError
|
||||
next_through_operator_bracket_on_super_test: CompileTimeError
|
||||
next_through_operator_bracket_on_this_test: CompileTimeError
|
||||
next_through_operator_bracket_test: CompileTimeError
|
||||
next_through_simple_async_with_returns_test: CompileTimeError
|
||||
next_through_simple_linear_2_test: CompileTimeError
|
||||
next_through_simple_linear_test: CompileTimeError
|
||||
object_graph_stack_reference_test: CompileTimeError
|
||||
object_graph_user_test: CompileTimeError
|
||||
object_graph_vm_test: CompileTimeError
|
||||
observatory_assets_test: CompileTimeError
|
||||
parameters_in_scope_at_entry_test: CompileTimeError
|
||||
pause_idle_isolate_test: CompileTimeError
|
||||
pause_on_exceptions_test: CompileTimeError
|
||||
pause_on_start_and_exit_test: CompileTimeError
|
||||
pause_on_start_then_step_test: CompileTimeError
|
||||
pause_on_unhandled_async_exceptions2_test: CompileTimeError
|
||||
pause_on_unhandled_async_exceptions_test: CompileTimeError
|
||||
pause_on_unhandled_exceptions_test: CompileTimeError
|
||||
positive_token_pos_test: CompileTimeError
|
||||
process_service_test: CompileTimeError
|
||||
reachable_size_test: CompileTimeError
|
||||
regexp_function_test: CompileTimeError
|
||||
regress_28443_test: CompileTimeError
|
||||
regress_28980_test: CompileTimeError
|
||||
reload_sources_test: CompileTimeError
|
||||
rewind_optimized_out_test: CompileTimeError
|
||||
rewind_test: CompileTimeError
|
||||
set_library_debuggable_rpc_test: CompileTimeError
|
||||
set_library_debuggable_test: CompileTimeError
|
||||
set_name_rpc_test: CompileTimeError
|
||||
set_vm_name_rpc_test: CompileTimeError
|
||||
steal_breakpoint_test: CompileTimeError
|
||||
step_into_async_no_await_test: CompileTimeError
|
||||
step_over_await_test: CompileTimeError
|
||||
step_test: CompileTimeError
|
||||
step_through_arithmetic_test: CompileTimeError
|
||||
step_through_constructor_calls_test: CompileTimeError
|
||||
step_through_constructor_test: CompileTimeError
|
||||
step_through_function_2_test: CompileTimeError
|
||||
step_through_function_test: CompileTimeError
|
||||
step_through_getter_test: CompileTimeError
|
||||
step_through_property_get_test: CompileTimeError
|
||||
step_through_property_set_test: CompileTimeError
|
||||
step_through_setter_test: CompileTimeError
|
||||
step_through_switch_test: CompileTimeError
|
||||
step_through_switch_with_continue_test: CompileTimeError
|
||||
string_escaping_test: CompileTimeError
|
||||
tcp_socket_closing_service_test: CompileTimeError
|
||||
tcp_socket_service_test: CompileTimeError
|
||||
type_arguments_test: CompileTimeError
|
||||
typed_data_test: CompileTimeError
|
||||
udp_socket_service_test: CompileTimeError
|
||||
vm_test: CompileTimeError
|
||||
vm_timeline_events_test: CompileTimeError
|
||||
vm_timeline_flags_test: CompileTimeError
|
||||
weak_properties_test: CompileTimeError
|
||||
|
||||
issue_27238_test: RuntimeError
|
||||
issue_27287_test: RuntimeError
|
||||
local_variable_declaration_test: RuntimeError
|
||||
mixin_break_test: RuntimeError
|
||||
next_through_assign_call_test: RuntimeError
|
||||
next_through_assign_int_test: RuntimeError
|
||||
next_through_call_on_field_in_class_test: RuntimeError
|
||||
next_through_call_on_field_test: RuntimeError
|
||||
next_through_call_on_static_field_in_class_test: RuntimeError
|
||||
next_through_catch_test: RuntimeError
|
||||
next_through_closure_test: RuntimeError
|
||||
next_through_create_list_and_map_test: RuntimeError
|
||||
next_through_for_each_loop_test: RuntimeError
|
||||
next_through_for_loop_with_break_and_continue_test: RuntimeError
|
||||
next_through_function_expression_test: RuntimeError
|
||||
next_through_implicit_call_test: RuntimeError
|
||||
next_through_is_and_as_test: RuntimeError
|
||||
next_through_multi_catch_test: RuntimeError
|
||||
next_through_new_test: RuntimeError
|
||||
next_through_operator_bracket_on_super_test: RuntimeError
|
||||
next_through_operator_bracket_on_this_test: RuntimeError
|
||||
next_through_operator_bracket_test: RuntimeError
|
||||
next_through_simple_async_with_returns_test: RuntimeError
|
||||
next_through_simple_linear_2_test: RuntimeError
|
||||
next_through_simple_linear_test: RuntimeError
|
||||
parameters_in_scope_at_entry_test: RuntimeError
|
||||
positive_token_pos_test: RuntimeError
|
||||
regress_28443_test: RuntimeError
|
||||
regress_28980_test: RuntimeError
|
||||
rewind_optimized_out_test: RuntimeError
|
||||
rewind_test: RuntimeError
|
||||
set_library_debuggable_test: RuntimeError
|
||||
steal_breakpoint_test: RuntimeError
|
||||
step_into_async_no_await_test: RuntimeError
|
||||
step_over_await_test: RuntimeError
|
||||
step_through_arithmetic_test: RuntimeError
|
||||
step_through_constructor_calls_test: RuntimeError
|
||||
step_through_constructor_test: RuntimeError
|
||||
step_through_function_2_test: RuntimeError
|
||||
step_through_function_test: RuntimeError
|
||||
step_through_getter_test: RuntimeError
|
||||
step_through_property_get_test: RuntimeError
|
||||
step_through_property_set_test: RuntimeError
|
||||
step_through_setter_test: RuntimeError
|
||||
step_through_switch_test: RuntimeError
|
||||
step_through_switch_with_continue_test: RuntimeError
|
||||
|
|
|
@ -269,7 +269,7 @@ IsolateTest stoppedAtLine(int line) {
|
|||
ServiceMap stack = await isolate.getStack();
|
||||
expect(stack.type, equals('Stack'));
|
||||
|
||||
List<Frame> frames = stack['frames'];
|
||||
List/*<Frame>*/ frames = stack['frames'];
|
||||
expect(frames.length, greaterThanOrEqualTo(1));
|
||||
|
||||
Frame top = frames[0];
|
||||
|
@ -297,7 +297,7 @@ IsolateTest stoppedInFunction(String functionName,
|
|||
ServiceMap stack = await isolate.getStack();
|
||||
expect(stack.type, equals('Stack'));
|
||||
|
||||
List<Frame> frames = stack['frames'];
|
||||
List/*<Frame>*/ frames = stack['frames'];
|
||||
expect(frames.length, greaterThanOrEqualTo(1));
|
||||
|
||||
Frame topFrame = stack['frames'][0];
|
||||
|
@ -387,8 +387,7 @@ Future isolateIsRunning(Isolate isolate) async {
|
|||
|
||||
Future<Class> getClassFromRootLib(Isolate isolate, String className) async {
|
||||
Library rootLib = await isolate.rootLibrary.load();
|
||||
for (var i = 0; i < rootLib.classes.length; i++) {
|
||||
Class cls = rootLib.classes[i];
|
||||
for (Class cls in rootLib.classes) {
|
||||
if (cls.name == className) {
|
||||
return cls;
|
||||
}
|
||||
|
@ -445,7 +444,7 @@ IsolateTest resumeProgramRecordingStops(
|
|||
// We are paused: Resume after recording.
|
||||
ServiceMap stack = await isolate.getStack();
|
||||
expect(stack.type, equals('Stack'));
|
||||
List<Frame> frames = stack['frames'];
|
||||
List/*<Frame>*/ frames = stack['frames'];
|
||||
expect(frames.length, greaterThanOrEqualTo(2));
|
||||
Frame frame = frames[0];
|
||||
String brokeAt = await frame.location.toUserString();
|
||||
|
|
|
@ -9,7 +9,7 @@ import 'test_helper.dart';
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) =>
|
||||
isolate.getTypeArgumentsList(false).then((ServiceMap allTypeArgs) {
|
||||
isolate.getTypeArgumentsList(false).then((dynamic allTypeArgs) {
|
||||
var allTypeArgsTableSize =
|
||||
allTypeArgs['canonicalTypeArgumentsTableSize'];
|
||||
var allTypeArgsTableUsed =
|
||||
|
@ -21,22 +21,23 @@ var tests = <IsolateTest>[
|
|||
allTypeArgsTableSize, greaterThanOrEqualTo(allTypeArgsTableUsed));
|
||||
return isolate
|
||||
.getTypeArgumentsList(true)
|
||||
.then((ServiceMap instantiatedTypeARgs) {
|
||||
.then((dynamic instantiatedTypeArgs) {
|
||||
var instantiatedTypeArgsTableSize =
|
||||
instantiatedTypeARgs['canonicalTypeArgumentsTableSize'];
|
||||
instantiatedTypeArgs['canonicalTypeArgumentsTableSize'];
|
||||
var instantiatedTypeArgsTableUsed =
|
||||
instantiatedTypeARgs['canonicalTypeArgumentsTableUsed'];
|
||||
instantiatedTypeArgs['canonicalTypeArgumentsTableUsed'];
|
||||
// Check size >= used.
|
||||
expect(instantiatedTypeArgsTableSize,
|
||||
greaterThanOrEqualTo(instantiatedTypeArgsTableUsed));
|
||||
// Check that |instantiated| <= |all|
|
||||
var instantiatedTypeArgsList = instantiatedTypeARgs['typeArguments'];
|
||||
var instantiatedTypeArgsList = instantiatedTypeArgs['typeArguments'];
|
||||
expect(instantiatedTypeArgsList, isNotNull);
|
||||
expect(allTypeArgsList.length,
|
||||
greaterThanOrEqualTo(instantiatedTypeArgsList.length));
|
||||
// Check that we can 'get' this object again.
|
||||
var firstType = allTypeArgsList[0];
|
||||
return isolate.getObject(firstType.id).then((TypeArguments type) {
|
||||
return isolate.getObject(firstType.id).then((ServiceObject object) {
|
||||
TypeArguments type = object;
|
||||
expect(firstType.name, type.name);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -79,7 +79,7 @@ void script() {
|
|||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
script();
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
|
||||
// Pre-load all the fields so we don't use await below and get better
|
||||
// stacktraces.
|
||||
|
|
|
@ -17,9 +17,9 @@ primeDartTimeline() {
|
|||
}
|
||||
}
|
||||
|
||||
bool isDart(Map event) => event['cat'] == 'Dart';
|
||||
bool isDart(event) => event['cat'] == 'Dart';
|
||||
|
||||
List<Map> filterEvents(List<Map> events, filter) {
|
||||
List filterEvents(List events, filter) {
|
||||
return events.where(filter).toList();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ primeDartTimeline() {
|
|||
}
|
||||
}
|
||||
|
||||
bool isDart(Map event) => event['cat'] == 'Dart';
|
||||
bool isMetaData(Map event) => event['ph'] == 'M';
|
||||
bool isNotMetaData(Map event) => !isMetaData(event);
|
||||
bool isNotDartAndMetaData(Map event) => !isDart(event) && !isMetaData(event);
|
||||
bool isDart(event) => event['cat'] == 'Dart';
|
||||
bool isMetaData(event) => event['ph'] == 'M';
|
||||
bool isNotMetaData(event) => !isMetaData(event);
|
||||
bool isNotDartAndMetaData(event) => !isDart(event) && !isMetaData(event);
|
||||
|
||||
List<Map> filterEvents(List<Map> events, filter) {
|
||||
List filterEvents(List events, filter) {
|
||||
return events.where(filter).toList();
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ void script() {
|
|||
|
||||
var tests = <IsolateTest>[
|
||||
(Isolate isolate) async {
|
||||
var lib = await isolate.rootLibrary.load();
|
||||
Library lib = await isolate.rootLibrary.load();
|
||||
Field keyField = lib.variables.singleWhere((v) => v.name == 'key');
|
||||
await keyField.load();
|
||||
Instance key = keyField.staticValue;
|
||||
|
|
|
@ -107,7 +107,7 @@ class _FileResourceInfo extends _ReadWriteResourceInfo {
|
|||
openFiles.remove(info.id);
|
||||
}
|
||||
|
||||
static Iterable<Map<String, String>> getOpenFilesList() {
|
||||
static Iterable<Map<String, dynamic>> getOpenFilesList() {
|
||||
return new List.from(openFiles.values.map((e) => e.referenceValueMap));
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ class _ProcessResourceInfo extends _IOResourceInfo {
|
|||
startedProcesses.remove(info.id);
|
||||
}
|
||||
|
||||
static Iterable<Map<String, String>> getStartedProcessesList() =>
|
||||
static Iterable<Map<String, dynamic>> getStartedProcessesList() =>
|
||||
new List.from(startedProcesses.values.map((e) => e.referenceValueMap));
|
||||
|
||||
static Future<ServiceExtensionResponse> getStartedProcesses(
|
||||
|
@ -226,7 +226,7 @@ class _SocketResourceInfo extends _ReadWriteResourceInfo {
|
|||
return '${socket.address.host}:${socket.port}$remote';
|
||||
}
|
||||
|
||||
static Iterable<Map<String, String>> getOpenSocketsList() {
|
||||
static Iterable<Map<String, dynamic>> getOpenSocketsList() {
|
||||
return new List.from(openSockets.values.map((e) => e.referenceValueMap));
|
||||
}
|
||||
|
||||
|
|
|
@ -154,20 +154,18 @@ class Message {
|
|||
// elements in the list are strings, making consumption by C++ simpler.
|
||||
// This has a side effect that boolean literal values like true become 'true'
|
||||
// and thus indistinguishable from the string literal 'true'.
|
||||
List _makeAllString(List list) {
|
||||
List<String> _makeAllString(List list) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
var new_list = new List<String>(list.length);
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if (list[i] is String) {
|
||||
continue;
|
||||
}
|
||||
list[i] = list[i].toString();
|
||||
new_list[i] = list[i].toString();
|
||||
}
|
||||
return list;
|
||||
return new_list;
|
||||
}
|
||||
|
||||
Future<Response> send(SendPort sendPort) {
|
||||
Future<Response> sendToIsolate(SendPort sendPort) {
|
||||
final receivePort = new RawReceivePort();
|
||||
receivePort.handler = (value) {
|
||||
receivePort.close();
|
||||
|
@ -221,11 +219,11 @@ class Message {
|
|||
receivePort.close();
|
||||
_setResponseFromPort(value);
|
||||
};
|
||||
final keys = params.keys.toList(growable: false);
|
||||
final values = params.values.toList(growable: false);
|
||||
var keys = params.keys.toList(growable: false);
|
||||
var values = params.values.toList(growable: false);
|
||||
if (!_methodNeedsObjectParameters(method)) {
|
||||
_makeAllString(keys);
|
||||
_makeAllString(values);
|
||||
keys = _makeAllString(keys);
|
||||
values = _makeAllString(values);
|
||||
}
|
||||
|
||||
final request = new List(6)
|
||||
|
|
|
@ -15,7 +15,7 @@ class RunningIsolate implements MessageRouter {
|
|||
|
||||
Future<Response> routeRequest(Message message) {
|
||||
// Send message to isolate.
|
||||
return message.send(sendPort);
|
||||
return message.sendToIsolate(sendPort);
|
||||
}
|
||||
|
||||
void routeResponse(Message message) {}
|
||||
|
|
Loading…
Reference in a new issue