[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[instrumentation_adapter] Add support for running tests with Flutter driver #2050

Merged
merged 3 commits into from
Sep 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reformat
  • Loading branch information
collinjackson committed Sep 9, 2019
commit 04adbcd04f24255205dcbb964b123b15260d5bc2
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class InstrumentationAdapterFlutterBinding
tearDownAll(() async {
await _channel.invokeMethod<void>(
'allTestsFinished', <String, dynamic>{'results': _results});
if (!_allTestsPassed.isCompleted)
_allTestsPassed.complete(true);
if (!_allTestsPassed.isCompleted) _allTestsPassed.complete(true);
});
}

Expand Down Expand Up @@ -52,16 +51,17 @@ class InstrumentationAdapterFlutterBinding
};
break;
case 'get_health':
response = <String, String>{ 'status': 'ok' };
response = <String, String>{'status': 'ok'};
break;
default:
throw UnimplementedError('$command is not implemented');
}
return <String, dynamic> {
'isError' : false,
return <String, dynamic>{
'isError': false,
'response': response,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would this function return "isError": true?

Copy link
Contributor Author
@collinjackson collinjackson Sep 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to attach 'isError': false to the return value or the response will be rejected by FlutterDriver. I thought about returning 'isError': true in the event of test failure, but decided not to for now to match the current behavior running tests under Flutter driver.

}

registerServiceExtension(name: 'driver', callback: callback);
}

Expand Down