forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate iOS and Android to use pushRouteInformation (flutter#39372)
* Migrate iOS and Android to use pushRouteInformation * revert * fix test
- Loading branch information
Showing
5 changed files
with
41 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,7 +726,7 @@ public void itSendsdefaultInitialRouteOnStartIfNotDeepLinkingFromIntent() { | |
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntent() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntent() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -742,11 +742,11 @@ public void itSendsPushRouteMessageWhenOnNewIntent() { | |
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRoute("/custom/route?query=test"); | ||
.pushRouteInformation("/custom/route?query=test"); | ||
} | ||
|
||
@Test | ||
public void itDoesNotSendPushRouteMessageWhenOnNewIntentIsNonHierarchicalUri() { | ||
public void itDoesNotSendPushRouteInformationMessageWhenOnNewIntentIsNonHierarchicalUri() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -764,11 +764,12 @@ public void itDoesNotSendPushRouteMessageWhenOnNewIntentIsNonHierarchicalUri() { | |
delegate.onNewIntent(mockIntent); | ||
|
||
// Verify that the navigation channel was not given a push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(0)).pushRoute("mailto:[email protected]"); | ||
verify(mockFlutterEngine.getNavigationChannel(), times(0)) | ||
.pushRouteInformation("mailto:[email protected]"); | ||
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntentWithQueryParameterAndFragment() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntentWithQueryParameterAndFragment() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -785,11 +786,11 @@ public void itSendsPushRouteMessageWhenOnNewIntentWithQueryParameterAndFragment( | |
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRoute("/custom/route?query=test#fragment"); | ||
.pushRouteInformation("/custom/route?query=test#fragment"); | ||
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntentWithFragmentNoQueryParameter() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntentWithFragmentNoQueryParameter() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -804,11 +805,12 @@ public void itSendsPushRouteMessageWhenOnNewIntentWithFragmentNoQueryParameter() | |
delegate.onNewIntent(mockIntent); | ||
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route#fragment"); | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRouteInformation("/custom/route#fragment"); | ||
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntentNoQueryParameter() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntentNoQueryParameter() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -823,7 +825,8 @@ public void itSendsPushRouteMessageWhenOnNewIntentNoQueryParameter() { | |
delegate.onNewIntent(mockIntent); | ||
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route"); | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRouteInformation("/custom/route"); | ||
} | ||
|
||
@Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters