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(android): Closing root window from child window causes app exit issues as of 8.0.1 #10988

Merged
merged 2 commits into from Aug 20, 2019

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Jun 21, 2019

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

Summary:
When child window closes the root window, the following regressions occur as of 8.0.1.

  • Closing immediate child window causes app to home-out instead of exiting the app.
  • Opening another child window and then closing it causes app to wrongly exit out.

Close Root Window Test:

  1. Build and run the below code on Android.
  2. Tap on the "Open" button in Window 1.
  3. Note that this closes Window 1 after opening Window 2 in the background.
  4. Tap on the Android "Back" button to exit.
  5. Relaunch the app.
  6. Verify that the splash screen is shown. (App used to resume instead of restarting.)
  7. Tap on the "Open" button in Window 1.
  8. Tap on the "Open" button in Window 2.
  9. Tap on the Android "Back" button in Window 3.
  10. Verify Window 3 closes and you are now back in Window 2. (Used to exit app.)
var window1 = Ti.UI.createWindow({
	title: "Window 1",
	backgroundColor: "white",
});
var openButton = Ti.UI.createButton({
	title: "Open",
});
openButton.addEventListener("click", function() {
	var window2 = Ti.UI.createWindow({
		title: "Window 2",
		backgroundColor: "white",
	});
	var openButton = Ti.UI.createButton({
		title: "Open",
	});
	openButton.addEventListener("click", function() {
		var window3 = Ti.UI.createWindow({
			title: "Window 3",
			backgroundColor: "white",
		});
		var closeButton = Ti.UI.createButton({
			title: "Close",
		});
		closeButton.addEventListener("click", function() {
			window3.close();
		});
		window3.add(closeButton);
		window3.open();
	});
	window2.add(openButton);
	window2.open();
	window1.close();
});
window1.add(openButton);
window1.open();

Window "exitOnClose" Test:

  1. Build and run the below code on Android.
  2. Tap on the Android "Back" button.
  3. Launch the app.
  4. Verify that the splash screen was NOT shown. (This is good. Window's "exitOnClose" was set to false.)
  5. Tap on the "Close Parent" button.
  6. Verify that you were returned to the home screen.
  7. Launch the app.
  8. Verify that the splash screen was shown. (This verifies that changing window's "exitOnClose" dynamically to true works.)
  9. Tap on the "Open Child" button.
  10. Tap on the Android "Back" button.
  11. Verify that the app exits. (This is good. Child window's "exitOnClose" was set true.)
  12. Launch the app.
  13. Verify that the splash screen was shown.
  14. Tap on the "Open Child" button.
  15. Tap on the "Close Child" button.
  16. Verify that the app exits.
var window = Ti.UI.createWindow({
	exitOnClose: false,
});
window.add(Ti.UI.createLabel({ text: "Parent Window" }));
var openButton = Ti.UI.createButton({
	title: "Open Child",
	bottom: "20%",
	left: "4%",
	width: "44%",
});
openButton.addEventListener("click", function() {
	var childWindow = Ti.UI.createWindow({
		exitOnClose: true,
	});
	childWindow.add(Ti.UI.createLabel({ text: "Child Window" }));
	var closeButton = Ti.UI.createButton({
		title: "Close Child",
		bottom: "20%",
	});
	closeButton.addEventListener("click", function() {
		childWindow.close();
	});
	childWindow.add(closeButton);
	childWindow.open();
});
window.add(openButton);
var closeButton = Ti.UI.createButton({
	title: "Close Parent",
	bottom: "20%",
	right: "4%",
	width: "44%",
});
closeButton.addEventListener("click", function() {
	window.exitOnClose = true;
	window.close();
});
window.add(closeButton);
window.open();

…m child window causes app exit issues as of 8.0.1

- Caused immediate child window to home-out instead of exiting app when closed.
- Caused child window's child to wrongly exit app when closed.
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 Jun 22, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖

✅ All tests are passing
Nice one! All 3615 tests are passing.
(There are 464 tests skipped)

Generated by 🚫 dangerJS against 5ad8f24

@keerthi1032
Copy link
Contributor

FR passed. app works as expected with Close Root Window Test and exitOnClose Test. Waiting for 8.1.0.GA release to merge PR

Test Environment:
Operating System
Name = Mac OS X
Version = 10.14.5
Architecture = 64bit
Node.js
Node.js Version = 10.16.0
npm Version = 6.9.0
Titanium CLI
CLI Version = 5.2.1
Titanium SDK
SDK Version = local sdk 8.2.0.v20190621202814 and 8.1.0.v20190725194646.
Device = Oneplus 5T android 9,
EMulator = nexus 6p android 8,pixel android 9

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