[TIMOB-4703] Android: Comparison of proxies for nodes that should be the same sometimes do not work.
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-07-27T09:52:33.000+0000 |
| Affected Version/s | Release 1.8.0 |
| Fix Version/s | Sprint 2011-30, Release 1.8.0 |
| Components | Android |
| Labels | parity |
| Reporter | Bill Dawson |
| Assignee | Vikramjeet Singh |
| Created | 2011-07-18T10:06:36.000+0000 |
| Updated | 2011-09-13T12:33:28.000+0000 |
Description
This could potentially be a drillbit problem (specifically
shouldBe), but I'm assuming it's actually Android.
Drillbit code from xml.js test shows that a node's attribute's ownerElement is not considered the same as the node (which it should be):
var doc = Ti.XML.parseString(this.testSource["nodes.xml"]);
var node = doc.getElementsByTagName("node").item(0);
var attr = node.attributes.item(0);
valueOf(attr.ownerElement).shouldBe(node); // FAILS
Simple failcase app.js (instead of running drillbit):
Titanium.UI.setBackgroundColor('#000'); // Titanium.Network; var win = Titanium.UI.createWindow({ title:'Test', backgroundColor:'#000', exitOnClose: true }); win.open(); var XMLSTRING = '<a b="c"/>'; var doc = Ti.XML.parseString(XMLSTRING); var elem = doc.getElementsByTagName("a").item(0); var attr = elem.attributes.item(0); var equality = (attr.ownerElement == doc.documentElement); if (equality) { alert("Test passed. attr.ownerElement == doc.documentElement"); } else { alert("Test failed. attr.ownerElement != doc.documentElement but it should"); }Code reviewed and tested.
Resolved. Tested On: Mac OSX Lion TiMob: 1.8.0.v20110906155354 TiStud: 1.0.5.201109091616 Devices Used: Android Emulator 2.2 Droid 3 Droid 1