Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new service protocol message names #35482

Merged
merged 2 commits into from Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/flutter_driver/lib/src/driver/driver.dart
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions packages/flutter_driver/test/flutter_driver_test.dart
Expand Up @@ -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>[
Expand Down Expand Up @@ -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>{
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_tools/lib/src/vmservice.dart
Expand Up @@ -948,21 +948,21 @@ 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,
},
);
}

Future<Map<String, dynamic>> getVMTimeline() {
return invokeRpcRaw('_getVMTimeline');
return invokeRpcRaw('getVMTimeline');
}

Future<void> refreshViews({ bool waitForViews = false }) async {
Expand Down