Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dirty fix SystemWebViewEngine by using history.back instead of g… #1321

Open
wants to merge 1 commit into
base: ci/connectedAndroidTest
Choose a base branch
from

Conversation

knight9999
Copy link

Platforms affected

android

Motivation and Context

To pass the BackButtonMultipageTest.testViaHref() on Android 11 (SDK30) .

i.e. This PR fix the following error

junit.framework.AssertionFailedError
	at junit.framework.Assert.fail(Assert.java:48)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at junit.framework.Assert.assertTrue(Assert.java:27)
	at org.apache.cordova.unittests.BackButtonMultipageTest$3.run(BackButtonMultipageTest.java:85)

in BackButtonMultipageTest.

Description

if we use the window.location = new_url in javascript and make a page transition,
SDK29 or before => we can go back to previous page by webView.goBack().
SDK30 => we cannot go back to previous page by webView.goBack().

I don't know this is a bug or specification in SDK 30.
Anyway I used history.back() in javascript instead on SDK 30.

Testing

Open the project test/androidx by AndroidStudio,
and execute the BackButtonMultipageTest on Pixel 3 API 30 and API 29 in my local environment.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@knight9999 knight9999 requested a review from erisu August 12, 2021 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant