Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8340] Drillbit UI.Layout failure

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-19T09:57:54.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.1.0, Sprint 2012-07, Release 2.0.1
ComponentsAndroid
Labelsn/a
ReporterHieu Pham
AssigneeHieu Pham
Created2012-03-27T17:01:11.000+0000
Updated2012-04-19T09:57:54.000+0000

Description

Run Drillbit UI.Layout on 3.x device on Rhino a few times. Observe failure Run this code on 3.x:
		// android
                var dpi = Ti.Platform.displayCaps.dpi;

		if (Ti.Platform.osname === 'android') {
			Ti.API.info("should be: " + dpi + ", is " + Ti.UI.convertUnits('1in', Ti.UI.UNIT_PX));
			Ti.API.info("shoulde be 100: " + Ti.UI.convertUnits('100', Ti.UI.UNIT_PX));
			Ti.API.info("should be: " + dpi + ", is " + Ti.UI.convertUnits('25.4mm',Ti.UI.UNIT_PX));
        }
			
	
		
		Ti.API.info("should be 25: " + Ti.UI.convertUnits(dpi.toString(), Ti.UI.UNIT_MM));
		Ti.API.info("should be 3: " +  Ti.UI.convertUnits(dpi.toString(), Ti.UI.UNIT_CM));
		
		Ti.API.info("should be 25: " + Ti.UI.convertUnits(dpi.toString(), Ti.UI.UNIT_MM));
		Ti.API.info("should be 3: " + Ti.UI.convertUnits(dpi.toString(), Ti.UI.UNIT_CM));
		Ti.API.info("should be 1: " + Ti.UI.convertUnits(dpi.toString(), Ti.UI.UNIT_IN));
		
		Ti.API.info("should be 1000: " + Ti.UI.convertUnits('100cm', Ti.UI.UNIT_MM));
		Ti.API.info("should be 254: " + Ti.UI.convertUnits('100in', Ti.UI.UNIT_CM));
		
		Ti.API.info("should be 0: " + Ti.UI.convertUnits('abc', Ti.UI.UNIT_PX));
		
Observe crash in both v8/Rhino

Comments

  1. Allen Yeung 2012-04-06

    When running the code above, you need to run from eclipse on a 3.0 device to trigger the restart caused by android bug2373. This will cause the NPE crash as described in the bug.
  2. Natalie Huynh 2012-04-09

    Tested with 2.0.1.v20120406170211 on LG Slate 3.1 Ran v8/rhino drillbit on version=2.0.1 module_apiversion=2 timestamp=04/09/12 11:28 githash=f64f23f
  3. Wilson Luu 2012-04-19

    Reopening bug to update labels. Note to QE: Test already added. Removing qe-port.

JSON Source