[TIMOB-3058] Android: If heavyweight window's JS code immediately opens a lightweight window, lightweight window is never seen
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T02:00:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M09 |
Components | Android |
Labels | android, defect, lifecycle_refactor, regression, release-1.6.0, reported-1.6.0, rplist |
Reporter | Bill Dawson |
Assignee | Bill Dawson |
Created | 2011-04-15T03:35:46.000+0000 |
Updated | 2011-04-17T02:00:48.000+0000 |
Description
The fail case is the KS -> Controls -> Slider -> Min/Max Range test. When you run it, you only see a black window.
It's a very strangely written test, and I'm pretty sure it's actually a mistake (the way it's written). (Nevertheless, it should -- and did -- work.)
It's strange because when you tap the row to start the test, it opens a new window (as do basically all of our KS tests) using tabgroup.open(win) (thus that new window is heavy). That window has its own url property. And in the JS of that URL, a second window (light) is created and opened in order to display the test. (This second window is obviously totally unnecessary, but anyway...)
The reason we see a blank window is because it's the heavy window that is showing. (The JS for the heavy window does not contain any code that puts a view on the window.) The lightweight window never gets seen. And we can see why in this screen shot of some logcat output that I've annotated:
https://skitch.com/billdawson/rpdeu/projects-grep-137x29">https://skitch.com/billdawson/rpdeu/projects-grep-137x29
So when the lightweight window starts opening, the heavyweight
window hasn't finished opening yet (obviously, since part of the
code running when the heavyweight window opens is to open the
lightweight window.) And when a lightweight window is created
(constructor of TiUIWindow
), it immediately runs
through handleWindowCreated
and
handleBooted
, thus putting out its layout right away.
Meanwhile the heavyweight window has to wait until its
handleBooted
gets called. When it does, the
heavyweight window puts its layout on the
activity, thus hiding the lightweight window's layout.
So the test is bizarre and probably should be changed. But the use case of having a heavy open a light immediately is perhaps valid. Like maybe the heavy's code checks some condition and if it exists they want to popup a light window for a second to display an elaborate message with an OK button that closes the light so its re-shows the heavy.
'N' stuff, and yeah but no but yeah but no.
(from [1e82b2497cc81acafb60841154e3ba1e82744677]) [#3058 state:fixed-in-qa] in TiBaseActivity.onCreate, set the window handler so that any lightweight windows drawn in heavyweight window's JS will be visible. https://github.com/appcelerator/titanium_mobile/commit/1e82b2497cc81acafb60841154e3ba1e82744677"> https://github.com/appcelerator/titanium_mobile/commit/1e82b2497cc8...
[INFO] Titanium SDK version: 1.6.0 (02/08/11 20:55 bd9d124...) galaxy tab (2.2.2) G1 (1.6) Nexus S (2.3) sim 2.1