Add option to get Dart VM flags from flutter_driver. (#7378)

This commit is contained in:
Michael Goderbauer
2017-01-06 10:56:09 -08:00
committed by GitHub
parent 5b1e7c0a37
commit fd3e0b7e13

View File

@@ -314,6 +314,30 @@ class FlutterDriver {
return BASE64.decode(result['screenshot']);
}
/// Returns the Flags set in the Dart VM as JSON.
///
/// See the complete documentation for `getFlagList` Dart VM service method
/// [here][getFlagList].
///
/// Example return value:
///
/// [
/// {
/// "name": "timeline_recorder",
/// "comment": "Select the timeline recorder used. Valid values: ring, endless, startup, and systrace.",
/// "modified": false,
/// "_flagType": "String",
/// "valueAsString": "ring"
/// },
/// ...
/// ]
///
/// [getFlagList]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#getflaglist
Future<List<Map<String, dynamic>>> getVmFlags() async {
Map<String, dynamic> result = await _peer.sendRequest('getFlagList');
return result['flags'];
}
/// Starts recording performance traces.
Future<Null> startTracing({List<TimelineStream> streams: _defaultStreams}) async {
assert(streams != null && streams.length > 0);