add route information to Flutter.Navigation events (#34508)

* add route information to Flutter.Navigation events

* route can be null; re-work how we send route info to accomidate that
This commit is contained in:
Devon Carew
2019-06-15 20:40:34 -07:00
committed by GitHub
parent dfa39f3ee5
commit 5f521eea22
2 changed files with 51 additions and 14 deletions

View File

@@ -94,9 +94,16 @@ void main() {
final Future<VMExtensionEvent> navigationFuture = navigationEvents.first;
// This tap triggers a navigation event.
device.tap(100, 200);
final VMExtensionEvent navigationEvent = await navigationFuture;
// Validate that there are not any fields.
expect(navigationEvent.data.isEmpty);
// validate the fields
expect(navigationEvent.data['route'] is Map<dynamic, dynamic>);
final Map<dynamic, dynamic> route = navigationEvent.data['route'];
expect(route['description'] is String);
expect(route['settings'] is Map<dynamic, dynamic>);
final Map<dynamic, dynamic> settings = route['settings'];
expect(settings.containsKey('name'));
expect(settings['isInitialRoute'] is bool);
run.stdin.write('q');
final int result = await run.exitCode;