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

Android: WebView null exception fix #10632

Merged
merged 3 commits into from Apr 24, 2019
Merged

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jan 17, 2019

JIRA:
https://jira.appcelerator.org/browse/TIMOB-26993

Note:
This issue was sometimes causing random crashes in our mocha unit test suite below. This solves that issue. And a new unit test is not needed.
https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.webview.test.js

Test:

  1. Build and run the below code on Android.
  2. Tap on the "Open Child" button.
  3. Verify that the WebView displays Google's website zoomed-in.
  4. Tap the Android "Back" button.
  5. Tap on the "Open Child" button again.
  6. Verify that the WebView displays Google's website zoomed-in again.
var parentWindow = Ti.UI.createWindow();
var openButton = Ti.UI.createButton({ title: "Open Child" });
openButton.addEventListener("click", function() {
	var childWindow = Ti.UI.createWindow({ backgroundColor: "white" });
	var webView = Ti.UI.createWebView({
		url: "https://www.google.com",
	});
	webView.addEventListener("load", function() {
		webView.zoomLevel = 3.0;
		childWindow.close();
	});
	childWindow.add(webView);
	childWindow.open();
});
parentWindow.add(openButton);
parentWindow.open();

@build
Copy link
Contributor

build commented Jan 17, 2019

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Warnings
⚠️ There is no linked JIRA ticket in the PR body. Please include the URL of the relevant JIRA ticket. If you need to, you may file a ticket on JIRA
Messages
📖

💾 Here's the generated SDK zipfile.

📖 🎉 Another contribution from our awesome community member, m1ga! Thanks again for helping us make Titanium SDK better. 👍
📖

✅ All tests are passing
Nice one! All 2990 tests are passing.

Generated by 🚫 dangerJS against 0d7dc38

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: PASS

@build
Copy link
Contributor

build commented Apr 23, 2019

Warnings
⚠️ There is no linked JIRA ticket in the PR body. Please include the URL of the relevant JIRA ticket. If you need to, you may file a ticket on JIRA
Messages
📖

💾 Here's the generated SDK zipfile.

📖 🎉 Another contribution from our awesome community member, m1ga! Thanks again for helping us make Titanium SDK better. 👍
📖

✅ All tests are passing
Nice one! All 3795 tests are passing.
(There are 466 tests skipped)

Generated by 🚫 dangerJS against 9520ec6

@lokeshchdhry
Copy link
Contributor

FR Passed.

No crash seen with the fix.

Studio Ver: 5.1.2.201903111843
SDK Ver: 8.1.0 local build
OS Ver: 10.14
Xcode Ver: Xcode 10.1
Appc NPM: 4.2.13
Appc CLI: 7.0.10
Daemon Ver: 1.1.3
Ti CLI Ver: 5.1.1
Alloy Ver: 1.13.9
Node Ver: 8.15.1
NPM Ver: 6.4.1
Java Ver: 10.0.2
Devices: ⇨ google Nexus 5 (Android 6.0.1)
⇨ google Pixel (Android 9)

@lokeshchdhry lokeshchdhry merged commit 527a40f into tidev:master Apr 24, 2019
@m1ga m1ga deleted the webviewZoom branch August 7, 2020 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants