[Pkg-mozext-commits] [firebug] 33/55: Enhanced test if result is an XML

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:46:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag firebug-1.10.1
in repository firebug.

commit 8499b5d4d19887fa873db33cb6817d487b179a8b
Author: Sebastian Zartner <sebastianzartner at gmx.de>
Date:   Tue Jul 24 11:24:47 2012 +0200

    Enhanced test if result is an XML
---
 tests/FBTest/content/testResultRep.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/FBTest/content/testResultRep.js b/tests/FBTest/content/testResultRep.js
index 71e439d..a5e2c83 100644
--- a/tests/FBTest/content/testResultRep.js
+++ b/tests/FBTest/content/testResultRep.js
@@ -512,7 +512,15 @@ FBTestApp.TestResultTabView = domplate(
 
     isXml: function(text)
     {
-        return text && text.indexOf("<") == 0;
+        var parser = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser);
+
+        // Create helper root element (for the case where there is no signle root).
+        var tempXml = "<wrapper>" + text + "</wrapper>";
+        var doc = parser.parseFromString(tempXml, "text/xml");
+        var docElem = doc.documentElement;
+        var nsURI = "http://www.mozilla.org/newlayout/xml/parsererror.xml";
+
+        return docElem.namespaceURI != nsURI && docElem.nodeName != "parsererror";
     },
 
     onSwitchView: function(event)
@@ -656,7 +664,7 @@ FBTestApp.TestResult = function(win, pass, msg, expected, result)
     this.fileName = location.substr(location.lastIndexOf("/") + 1);
 
     this.pass = pass ? true : false;
-    this.msg = clean(msg);
+    this.msg = msg;//clean(msg);
 
     // Make sure the following values are strings.
     this.expected = expected ? expected + "" : null;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list