forked from firka/flutter
Use the new service protocol message names (#35482)
* Use the new service protocol message names clearVMTimeline setVMTimelineFlags getVMTimeline getVMTimelineFlags * Fix clearTimeline at another spot.
This commit is contained in:
@@ -136,9 +136,9 @@ class FlutterDriver {
|
||||
_driverId = _nextDriverId++;
|
||||
|
||||
static const String _flutterExtensionMethodName = 'ext.flutter.driver';
|
||||
static const String _setVMTimelineFlagsMethodName = '_setVMTimelineFlags';
|
||||
static const String _getVMTimelineMethodName = '_getVMTimeline';
|
||||
static const String _clearVMTimelineMethodName = '_clearVMTimeline';
|
||||
static const String _setVMTimelineFlagsMethodName = 'setVMTimelineFlags';
|
||||
static const String _getVMTimelineMethodName = 'getVMTimeline';
|
||||
static const String _clearVMTimelineMethodName = 'clearVMTimeline';
|
||||
static const String _collectAllGarbageMethodName = '_collectAllGarbage';
|
||||
|
||||
static int _nextDriverId = 0;
|
||||
|
||||
@@ -369,7 +369,7 @@ void main() {
|
||||
group('clearTimeline', () {
|
||||
test('clears timeline', () async {
|
||||
bool clearWasCalled = false;
|
||||
when(mockPeer.sendRequest('_clearVMTimeline', argThat(equals(<String, dynamic>{}))))
|
||||
when(mockPeer.sendRequest('clearVMTimeline', argThat(equals(<String, dynamic>{}))))
|
||||
.thenAnswer((Invocation invocation) async {
|
||||
clearWasCalled = true;
|
||||
return null;
|
||||
@@ -385,25 +385,25 @@ void main() {
|
||||
setUp(() async {
|
||||
log = <String>[];
|
||||
|
||||
when(mockPeer.sendRequest('_clearVMTimeline', argThat(equals(<String, dynamic>{}))))
|
||||
when(mockPeer.sendRequest('clearVMTimeline', argThat(equals(<String, dynamic>{}))))
|
||||
.thenAnswer((Invocation invocation) async {
|
||||
log.add('clear');
|
||||
return null;
|
||||
});
|
||||
|
||||
when(mockPeer.sendRequest('_setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[all]'}))))
|
||||
when(mockPeer.sendRequest('setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[all]'}))))
|
||||
.thenAnswer((Invocation invocation) async {
|
||||
log.add('startTracing');
|
||||
return null;
|
||||
});
|
||||
|
||||
when(mockPeer.sendRequest('_setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[]'}))))
|
||||
when(mockPeer.sendRequest('setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[]'}))))
|
||||
.thenAnswer((Invocation invocation) async {
|
||||
log.add('stopTracing');
|
||||
return null;
|
||||
});
|
||||
|
||||
when(mockPeer.sendRequest('_getVMTimeline')).thenAnswer((Invocation invocation) async {
|
||||
when(mockPeer.sendRequest('getVMTimeline')).thenAnswer((Invocation invocation) async {
|
||||
log.add('download');
|
||||
return <String, dynamic>{
|
||||
'traceEvents': <dynamic>[
|
||||
@@ -451,19 +451,19 @@ void main() {
|
||||
bool startTracingCalled = false;
|
||||
bool stopTracingCalled = false;
|
||||
|
||||
when(mockPeer.sendRequest('_setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[Dart, GC, Compiler]'}))))
|
||||
when(mockPeer.sendRequest('setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[Dart, GC, Compiler]'}))))
|
||||
.thenAnswer((Invocation invocation) async {
|
||||
startTracingCalled = true;
|
||||
return null;
|
||||
});
|
||||
|
||||
when(mockPeer.sendRequest('_setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[]'}))))
|
||||
when(mockPeer.sendRequest('setVMTimelineFlags', argThat(equals(<String, dynamic>{'recordedStreams': '[]'}))))
|
||||
.thenAnswer((Invocation invocation) async {
|
||||
stopTracingCalled = true;
|
||||
return null;
|
||||
});
|
||||
|
||||
when(mockPeer.sendRequest('_getVMTimeline')).thenAnswer((Invocation invocation) async {
|
||||
when(mockPeer.sendRequest('getVMTimeline')).thenAnswer((Invocation invocation) async {
|
||||
return <String, dynamic>{
|
||||
'traceEvents': <dynamic>[
|
||||
<String, String>{
|
||||
|
||||
@@ -948,13 +948,13 @@ class VM extends ServiceObjectOwner {
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> clearVMTimeline() {
|
||||
return invokeRpcRaw('_clearVMTimeline');
|
||||
return invokeRpcRaw('clearVMTimeline');
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> setVMTimelineFlags(List<String> recordedStreams) {
|
||||
assert(recordedStreams != null);
|
||||
return invokeRpcRaw(
|
||||
'_setVMTimelineFlags',
|
||||
'setVMTimelineFlags',
|
||||
params: <String, dynamic>{
|
||||
'recordedStreams': recordedStreams,
|
||||
},
|
||||
@@ -962,7 +962,7 @@ class VM extends ServiceObjectOwner {
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getVMTimeline() {
|
||||
return invokeRpcRaw('_getVMTimeline');
|
||||
return invokeRpcRaw('getVMTimeline');
|
||||
}
|
||||
|
||||
Future<void> refreshViews({ bool waitForViews = false }) async {
|
||||
|
||||
Reference in New Issue
Block a user