Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': 'd6e7aacfe6d19c8d478dcf3e315b76720813a417',
'dart_revision': '65376c07234d1df472662d21dff2498ab2d3cdda',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_third_party
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 56dff2126686e1d0cc09e0792dce6a2a
Signature: 890d97116d1c4d016c71fa50db974d98

UNUSED LICENSES:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private String maybeGetInitialRouteFromIntent(Intent intent) {
Uri data = intent.getData();
if (data != null && !data.getPath().isEmpty()) {
String pathAndQuery = data.getPath();
if (!data.getQuery().isEmpty()) {
if (data.getQuery() != null && !data.getQuery().isEmpty()) {
pathAndQuery += "?" + data.getQuery();
}
return pathAndQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,32 @@ public void itForwardsOnRequestPermissionsResultToFlutterEngine() {
.setInitialRoute("/custom/route?query=test");
}

@Test
public void
itSendsInitialRouteFromIntentOnStartIfNoInitialRouteFromActivityAndShouldHandleDeeplinkingNoQueryParameter() {
Intent intent = FlutterActivity.createDefaultIntent(RuntimeEnvironment.application);
intent.setData(Uri.parse("http://myApp/custom/route"));

ActivityController<FlutterActivity> activityController =
Robolectric.buildActivity(FlutterActivity.class, intent);
FlutterActivity flutterActivity = activityController.get();

when(mockHost.getActivity()).thenReturn(flutterActivity);
when(mockHost.getInitialRoute()).thenReturn(null);
when(mockHost.shouldHandleDeeplinking()).thenReturn(true);
// Create the real object that we're testing.
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost);

// --- Execute the behavior under test ---
// The FlutterEngine is setup in onAttach().
delegate.onAttach(RuntimeEnvironment.application);
// Emulate app start.
delegate.onStart();

// Verify that the navigation channel was given the initial route message.
verify(mockFlutterEngine.getNavigationChannel(), times(1)).setInitialRoute("/custom/route");
}

@Test
public void itSendsdefaultInitialRouteOnStartIfNotDeepLinkingFromIntent() {
// Creates an empty intent without launch uri.
Expand Down Expand Up @@ -501,6 +527,25 @@ public void itSendsPushRouteMessageWhenOnNewIntent() {
.pushRoute("/custom/route?query=test");
}

@Test
public void itSendsPushRouteMessageWhenOnNewIntentNoQueryParameter() {
when(mockHost.shouldHandleDeeplinking()).thenReturn(true);
// Create the real object that we're testing.
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost);

// --- Execute the behavior under test ---
// The FlutterEngine is setup in onAttach().
delegate.onAttach(RuntimeEnvironment.application);

Intent mockIntent = mock(Intent.class);
when(mockIntent.getData()).thenReturn(Uri.parse("http://myApp/custom/route"));
// Emulate the host and call the method that we expect to be forwarded.
delegate.onNewIntent(mockIntent);

// Verify that the navigation channel was given the push route message.
verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route");
}

@Test
public void itForwardsOnNewIntentToFlutterEngine() {
// Create the real object that we're testing.
Expand Down