feat: discover ADB devices from agent management
This commit is contained in:
1 parent
8ecfe880cc
commit
3a7bb071f0
12 files changed
+132
-5
No files matched your search
@@ -37,6 +37,13 @@ class FakeApi implements AgentApi {
|
||||
Future<Object?> request(String agent, JsonMap operation) async {
|
||||
calls.add({...operation, 'agent': agent});
|
||||
return switch (operation['op']) {
|
||||
'devices_discover' => [
|
||||
<String, Object?>{
|
||||
'serial': '192.168.1.2:5555',
|
||||
'state': 'device',
|
||||
'configured': false,
|
||||
},
|
||||
],
|
||||
'config_get' => {'id': agent, 'devices': <Object?>[]},
|
||||
'logs' => {
|
||||
'instance': 'i',
|
||||
@@ -81,6 +88,10 @@ void main() {
|
||||
await m.deviceOperation('device_enable', enabled: false);
|
||||
expect(api.calls.last['id'], 'two-phone');
|
||||
expect(api.calls.last['enabled'], false);
|
||||
await m.discoverDevices();
|
||||
m.chooseDiscovered(m.discoveredDevices.single);
|
||||
expect(m.target, '192.168.1.2:5555');
|
||||
expect(m.adbSerial, isEmpty);
|
||||
await m.readLogs();
|
||||
expect(m.logText, contains('[REDACTED]'));
|
||||
expect(m.logText, isNot(contains('private-token')));
|
||||
|
||||
Reference in new issue
Block a user