Remove the 'app' domain from flutter daemon (#18873)

* Remove the 'app' domain from flutter daemon

By default the daemon won't register the "app" domain, you need to opt-in (which the 'run' command does, as well as the tests for the app functionality).

Fixes #6658.

* Tweak text

* Put restart/callServiceExtension/stop back into daemon mode

* Add a comment about removing discoverApps
This commit is contained in:
Danny Tuppeny
2018-06-28 16:22:02 +01:00
committed by GitHub
parent 7e4038fe27
commit 108da01310
5 changed files with 11 additions and 137 deletions

View File

@@ -110,27 +110,6 @@ void main() {
});
});
testUsingContext('app.start without a deviceId should report an error', () async {
final DaemonCommand command = new DaemonCommand();
applyMocksToCommand(command);
final StreamController<Map<String, dynamic>> commands = new StreamController<Map<String, dynamic>>();
final StreamController<Map<String, dynamic>> responses = new StreamController<Map<String, dynamic>>();
daemon = new Daemon(
commands.stream,
responses.add,
daemonCommand: command,
notifyingLogger: notifyingLogger
);
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.start' });
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
expect(response['id'], 0);
expect(response['error'], contains('deviceId is required'));
responses.close();
commands.close();
});
testUsingContext('app.restart without an appId should report an error', () async {
final DaemonCommand command = new DaemonCommand();
applyMocksToCommand(command);
@@ -141,7 +120,7 @@ void main() {
commands.stream,
responses.add,
daemonCommand: command,
notifyingLogger: notifyingLogger
notifyingLogger: notifyingLogger,
);
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.restart' });
@@ -162,7 +141,7 @@ void main() {
commands.stream,
responses.add,
daemonCommand: command,
notifyingLogger: notifyingLogger
notifyingLogger: notifyingLogger,
);
commands.add(<String, dynamic>{
@@ -189,7 +168,7 @@ void main() {
commands.stream,
responses.add,
daemonCommand: command,
notifyingLogger: notifyingLogger
notifyingLogger: notifyingLogger,
);
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.stop' });