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

TIMOB-4570 fix a mistake inside the drillbit test itself. #300

Merged
merged 2 commits into from
Jul 29, 2011
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions drillbit/tests/xml/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,27 +520,28 @@ describe("Ti.XML tests", {
apiXmlDocumentImportNode: function() {
var doc = Ti.XML.parseString("<a/>");
var otherDoc = Ti.XML.parseString(this.testSource["with_ns.xml"]);
var cakeNode = otherDoc.documentElement.getElementsByTagNameNS("http://example.com", "cake").item(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we assert the length of the node list here? (assert non-null on cakeNode too?)

valueOf(doc.importNode).shouldBeFunction();
// test deep import
var importedNode;
valueOf(function() {
importedNode = doc.importNode(otherDoc.documentElement.firstChild, true);
importedNode = doc.importNode(cakeNode, true);
}).shouldNotThrowException();
valueOf(importedNode.ownerDocument).shouldNotBeNull();
valueOf(importedNode.ownerDocument).shouldBeObject();
valueOf(importedNode.ownerDocument).shouldBe(doc); // fails in Android TIMOB-4703
valueOf(importedNode.ownerDocument).shouldBe(doc);
valueOf(importedNode.parentNode).shouldBeNull();
valueOf(importedNode.hasChildNodes()).shouldBeTrue();
valueOf(importedNode.childNodes.length).shouldBeGreaterThan(0);
valueOf(importedNode.namespaceURI).shouldBe("http://example.com");
// test shallow import
valueOf(function() {
importedNode = doc.importNode(otherDoc.documentElement.firstChild, false);
importedNode = doc.importNode(cakeNode, false);
}).shouldNotThrowException();
valueOf(importedNode.hasChildNodes()).shouldBeFalse();
valueOf(importedNode.ownerDocument).shouldNotBeNull();
valueOf(importedNode.ownerDocument).shouldBeObject();
valueOf(importedNode.ownerDocument).shouldBe(doc); // fails in Android TIMOB-4703
valueOf(importedNode.ownerDocument).shouldBe(doc);
valueOf(importedNode.parentNode).shouldBeNull();
},

Expand Down