Send an event at startup with the protocol version and pid (#17873)

* Send an event at startup with the protocol version and pid

The pid will help with some of the issues of terminate the process when launched through a shell script and the version will allow clients to make decisions about supported features.

I've also bumped the protocol version number for two reasons:

1. This change
2. We didn't increase it when we added the previous emulator commands
This commit is contained in:
Danny Tuppeny
2018-05-28 22:02:53 +01:00
committed by GitHub
parent 514701fe46
commit 24e2b238d4
2 changed files with 14 additions and 3 deletions

View File

@@ -209,7 +209,8 @@ void main() {
notifyingLogger: notifyingLogger,
);
final Map<String, dynamic> response = await responses.stream.first;
final Map<String, dynamic> response =
await responses.stream.skipWhile(_isConnectedEvent).first;
expect(response['event'], 'daemon.showMessage');
expect(response['params'], isMap);
expect(response['params'], containsPair('level', 'warning'));
@@ -249,7 +250,7 @@ void main() {
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
discoverer.addDevice(new MockAndroidDevice());
return responses.stream.first.then((Map<String, dynamic> response) {
return responses.stream.skipWhile(_isConnectedEvent).first.then((Map<String, dynamic> response) {
expect(response['event'], 'device.added');
expect(response['params'], isMap);
@@ -322,6 +323,8 @@ void main() {
bool _notEvent(Map<String, dynamic> map) => map['event'] == null;
bool _isConnectedEvent(Map<String, dynamic> map) => map['event'] == 'daemon.connected';
class MockAndroidWorkflow extends AndroidWorkflow {
MockAndroidWorkflow({ this.canListDevices: true });