зеркало из https://github.com/mozilla/pjs.git
NOT PART OF BUILD, testcase harnish.
This is a big overhaul of buster, moving to rdf controlled trees. The index is now part of the testcases, which makes it easier to keep them up-to-date. I also started improving the support for HTML testcases. Another new feature is the support for saving and loading results. Plus alot of internal cleanup, though there's still more to come.
This commit is contained in:
Родитель
acf63685ee
Коммит
20382fe47f
|
@ -24,8 +24,11 @@
|
|||
// DiffDOM(node1,node2)
|
||||
// ----------------------
|
||||
|
||||
function DiffDOM(node1,node2)
|
||||
var isHTML = false;
|
||||
|
||||
function DiffDOM(node1, node2, aIsHTML)
|
||||
{
|
||||
isHTML = aIsHTML;
|
||||
return DiffNodeAndChildren(node1, node2);
|
||||
}
|
||||
|
||||
|
@ -68,12 +71,19 @@ function DiffNodeAndChildren(node1, node2)
|
|||
return ErrorUp("Different number of attributes", node1, node2);
|
||||
}
|
||||
|
||||
if (node1.nodeName!=node2.nodeName)
|
||||
return ErrorUp("Different node names", node1, node2);
|
||||
if (isHTML) {
|
||||
if (node1.nodeName.toLowerCase()!=node2.nodeName.toLowerCase())
|
||||
return ErrorUp("Different node names", node1, node2);
|
||||
}
|
||||
else {
|
||||
if (node1.nodeName!=node2.nodeName)
|
||||
return ErrorUp("Different node names", node1, node2);
|
||||
}
|
||||
if (node1.nodeValue!=node2.nodeValue)
|
||||
return ErrorUp("Different node values", node1, node2);
|
||||
if (node1.namespaceURI!=node2.namespaceURI)
|
||||
return ErrorUp("Different namespace", node1, node2);
|
||||
if (!isHTML)
|
||||
if (node1.namespaceURI!=node2.namespaceURI)
|
||||
return ErrorUp("Different namespace", node1, node2);
|
||||
if (node1.hasChildNodes() != node2.hasChildNodes())
|
||||
return ErrorUp("Different children", node1, node2);
|
||||
if (node1.childNodes) {
|
||||
|
@ -97,14 +107,14 @@ function ErrorUp(errMsg, node1, node2)
|
|||
if (node1.nodeType == Node.TEXT_NODE)
|
||||
dump("nodeValue: "+node1.nodeValue+"\n");
|
||||
else
|
||||
dump("nodeName: "+node1.nodeName+"\n");
|
||||
dump("nodeName: "+node1.namespaceURI+":"+node1.nodeName+"\n");
|
||||
}
|
||||
if (node2) {
|
||||
dump("Node 2: "+node2+", ");
|
||||
if (node2.nodeType == Node.TEXT_NODE)
|
||||
dump("nodeValue: "+node2.nodeValue+"\n");
|
||||
else
|
||||
dump("nodeName: "+node2.nodeName+"\n");
|
||||
dump("nodeName: "+node2.namespaceURI+":"+node2.nodeName+"\n");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -5,20 +5,18 @@ in http://www.axel.pike.org/mozilla/xalan.tar.gz. Please see the included
|
|||
LICENSE.txt or http://xml.apache.org/dist/LICENSE.txt for terms of
|
||||
distributing those files.
|
||||
|
||||
To use the buster, open buster.xul with a XSLT enabled Mozilla. Warning,
|
||||
it takes quite a while until that page is fully loaded, and due to bug
|
||||
http://bugzilla.mozilla.org/show_bug.cgi?id=70324, we don't have scrolling.
|
||||
You can use regular expressions to narrow the set of tests to run.
|
||||
To use the buster, open buster.xul with a XSLT enabled Mozilla.
|
||||
Open the rdf index file shipped with the test package into the
|
||||
"Xalan index", and the available tests will show up as a tree.
|
||||
Once you have selected the tests you're interested in, press the button
|
||||
"run checked tests", and all the tests will be run.
|
||||
You can save the results into an rdf, and load it for comparison and
|
||||
regression hunting.
|
||||
|
||||
DiffDOM tries to find out, which tests failed, and will DumpDOM both the
|
||||
result and the reference solution. Not all reference solutions load
|
||||
properly, those need manual love.
|
||||
|
||||
All of the code was done sleeping, and is not intended as example of good
|
||||
code. It's for debugging only!
|
||||
|
||||
Good luck and fun
|
||||
|
||||
Axel Hecht <axel@pike.org>
|
|
@ -0,0 +1,127 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT Processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Axel Hecht.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org>
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
const kFTSCID = "@mozilla.org/network/file-transport-service;1";
|
||||
const nsIFileTransportService = Components.interfaces.nsIFileTransportService;
|
||||
const kFileTransportService = doCreate(kFTSCID, nsIFileTransportService);
|
||||
|
||||
var cmdFileController =
|
||||
{
|
||||
supportsCommand: function(aCommand)
|
||||
{
|
||||
switch(aCommand) {
|
||||
case 'cmd_fl_save':
|
||||
case 'cmd_fl_import':
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isCommandEnabled: function(aCommand)
|
||||
{
|
||||
return this.supportsCommand(aCommand);
|
||||
},
|
||||
doCommand: function(aCommand)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
switch(aCommand) {
|
||||
case 'cmd_fl_save':
|
||||
var serial = doCreate(kRDFXMLSerializerID,
|
||||
nsIRDFXMLSerializer);
|
||||
var sink = new Object;
|
||||
sink.content = '';
|
||||
sink.write = function(aContent, aCount)
|
||||
{
|
||||
this.content += aContent;
|
||||
return aCount;
|
||||
};
|
||||
serial.init(view.memoryDataSource);
|
||||
serial.QueryInterface(nsIRDFXMLSource);
|
||||
serial.Serialize(sink);
|
||||
if (!sink.content.length) {
|
||||
return;
|
||||
}
|
||||
// replace NC:succ with NC:orig_succ, so the rdf stuff differs
|
||||
var content = sink.content.replace(/NC:succ/g,"NC:orig_succ");
|
||||
var fp = doCreateRDFFP('Xalan results',
|
||||
nsIFilePicker.modeSave);
|
||||
var res = fp.show();
|
||||
|
||||
if (res == nsIFilePicker.returnOK ||
|
||||
res == nsIFilePicker.returnReplace) {
|
||||
var fl = fp.file;
|
||||
var trans = kFileTransportService.createTransport
|
||||
(fl, 26, // NS_WRONLY + NS_CREATE_FILE + NS_TRUNCATE
|
||||
'w', true);
|
||||
var out = trans.openOutputStream(0, -1, 0);
|
||||
out.write(content, content.length);
|
||||
out.close();
|
||||
delete out;
|
||||
delete trans;
|
||||
fp.file.permissions = 420;
|
||||
}
|
||||
break;
|
||||
case 'cmd_fl_import':
|
||||
var fp = doCreateRDFFP('Previous Xalan results',
|
||||
nsIFilePicker.modeLoad);
|
||||
var res = fp.show();
|
||||
|
||||
if (res == nsIFilePicker.returnOK) {
|
||||
var fl = fp.file;
|
||||
if (view.previousResults) {
|
||||
view.database.RemoveDataSource(view.previousResults);
|
||||
view.previousResults = null;
|
||||
}
|
||||
view.database.RemoveDataSource(view.memoryDataSource);
|
||||
view.previousResults = kRDFSvc.GetDataSource(fp.fileURL.spec);
|
||||
view.database.AddDataSource(view.previousResults);
|
||||
view.database.AddDataSource(view.memoryDataSource);
|
||||
}
|
||||
|
||||
document.getElementById('obs_orig_success')
|
||||
.setAttribute('hidden','false');
|
||||
break;
|
||||
default:
|
||||
alert('Unknown Command'+aCommand);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
registerController(cmdFileController);
|
|
@ -0,0 +1,79 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT Processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Axel Hecht.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org>
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var xalan_field;
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
view.tests_run = document.getElementById("tests_run");
|
||||
view.tests_passed = document.getElementById("tests_passed");
|
||||
view.tests_failed = document.getElementById("tests_failed");
|
||||
view.tests_selected = document.getElementById("tests_selected");
|
||||
view.tree = document.getElementById('out');
|
||||
view.boxObject = view.tree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject);
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
// prune the spurious children of the iframe doc
|
||||
{
|
||||
var iframe = document.getElementById('hiddenHtml').contentDocument;
|
||||
var children = iframe.childNodes;
|
||||
var cn = children.length;
|
||||
for (var i = cn-1; i >=0 ; i--) {
|
||||
if (children[i] != iframe.documentElement)
|
||||
iframe.removeChild(children[i]);
|
||||
}
|
||||
}
|
||||
view.database = view.tree.database;
|
||||
view.builder = view.tree.builder.QueryInterface(nsIXULTemplateBuilder);
|
||||
view.builder.QueryInterface(nsIXULTreeBuilder);
|
||||
runItem.prototype.kDatabase = view.database;
|
||||
xalan_field = document.getElementById("xalan_rdf");
|
||||
var persistedUrl = xalan_field.getAttribute('url');
|
||||
if (persistedUrl) {
|
||||
view.xalan_url = persistedUrl;
|
||||
xalan_field.value = persistedUrl;
|
||||
}
|
||||
view.setDataSource();
|
||||
return true;
|
||||
}
|
||||
|
||||
function onUnload()
|
||||
{
|
||||
if (xalan_field)
|
||||
xalan_field.setAttribute('url', xalan_field.value);
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT Processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Axel Hecht.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org>
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// priviledge shortcut
|
||||
enablePrivilege = netscape.security.PrivilegeManager.enablePrivilege;
|
||||
|
||||
// helper function to shortcut component creation
|
||||
function doCreate(aContract, aInterface)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
return Components.classes[aContract].createInstance(aInterface);
|
||||
}
|
||||
|
||||
// for the items, loading a text file
|
||||
const IOSERVICE_CTRID = "@mozilla.org/network/io-service;1";
|
||||
const nsIIOService = Components.interfaces.nsIIOService;
|
||||
const SIS_CTRID = "@mozilla.org/scriptableinputstream;1"
|
||||
const nsISIS = Components.interfaces.nsIScriptableInputStream;
|
||||
|
||||
// rdf foo, onload handler
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
const kRDFSvcContractID = "@mozilla.org/rdf/rdf-service;1";
|
||||
const kRDFInMemContractID =
|
||||
"@mozilla.org/rdf/datasource;1?name=in-memory-datasource";
|
||||
const kRDFContUtilsID = "@mozilla.org/rdf/container-utils;1";
|
||||
const kRDFXMLSerializerID = "@mozilla.org/rdf/xml-serializer;1";
|
||||
const kIOSvcContractID = "@mozilla.org/network/io-service;1";
|
||||
const kStandardURL = Components.classes["@mozilla.org/network/standard-url;1"];
|
||||
const nsIURL = Components.interfaces.nsIURL;
|
||||
const nsIStandardURL = Components.interfaces.nsIStandardURL;
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
const nsIXULTreeBuilder = Components.interfaces.nsIXULTreeBuilder;
|
||||
const nsIXULTemplateBuilder = Components.interfaces.nsIXULTemplateBuilder;
|
||||
const kIOSvc = Components.classes[kIOSvcContractID]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
const nsIRDFService = Components.interfaces.nsIRDFService;
|
||||
const nsIRDFDataSource = Components.interfaces.nsIRDFDataSource;
|
||||
const nsIRDFResource = Components.interfaces.nsIRDFResource;
|
||||
const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral;
|
||||
const nsIRDFContainerUtils = Components.interfaces.nsIRDFContainerUtils;
|
||||
const nsIRDFXMLSerializer = Components.interfaces.nsIRDFXMLSerializer;
|
||||
const nsIRDFXMLSource = Components.interfaces.nsIRDFXMLSource;
|
||||
const kRDFSvc =
|
||||
Components.classes[kRDFSvcContractID].getService(nsIRDFService);
|
||||
const krTypeCat = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#category");
|
||||
const krTypeName = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#name");
|
||||
const krTypeSucc = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#succ");
|
||||
const krTypePath = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#path");
|
||||
const kGood = kRDFSvc.GetLiteral("yes");
|
||||
const kBad = kRDFSvc.GetLiteral("no");
|
||||
const kMixed = kRDFSvc.GetLiteral("+-");
|
||||
const kContUtils = doCreate(kRDFContUtilsID, nsIRDFContainerUtils);
|
||||
|
||||
function doCreateRDFFP(aTitle, aMode)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var fp = doCreate("@mozilla.org/filepicker;1", nsIFilePicker);
|
||||
fp.init(window, aTitle, aMode);
|
||||
fp.appendFilter('*.rdf', '*.rdf');
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
return fp;
|
||||
}
|
||||
|
||||
function goDoCommand(aCommand)
|
||||
{
|
||||
try {
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var controller =
|
||||
top.document.commandDispatcher.getControllerForCommand(aCommand);
|
||||
if (controller && controller.isCommandEnabled(aCommand))
|
||||
controller.doCommand(aCommand);
|
||||
}
|
||||
catch(e) {
|
||||
dump("An error "+e+" occurred executing the "+aCommand+" command\n");
|
||||
}
|
||||
}
|
||||
|
||||
function registerController(aController)
|
||||
{
|
||||
top.controllers.appendController(aController);
|
||||
}
|
|
@ -0,0 +1,314 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT Processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Axel Hecht.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org>
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var parser = new DOMParser();
|
||||
|
||||
var runQueue =
|
||||
{
|
||||
mArray : new Array(),
|
||||
push : function(aRunItem)
|
||||
{
|
||||
this.mArray.push(aRunItem);
|
||||
},
|
||||
observe : function(aSubject, aTopic, aData)
|
||||
{
|
||||
item = this.mArray.shift();
|
||||
if (item) {
|
||||
item.run(this);
|
||||
}
|
||||
},
|
||||
run : function()
|
||||
{
|
||||
this.observe(null,'','');
|
||||
}
|
||||
}
|
||||
|
||||
var itemCache =
|
||||
{
|
||||
mArray : new Array(),
|
||||
getItem : function(aResource)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
// Directory selected
|
||||
if (kContUtils.IsSeq(runItem.prototype.kDatabase, aResource)) {
|
||||
var aSeq = kContUtils.MakeSeq(runItem.prototype.kDatabase, aResource);
|
||||
dump("sequence: "+aSeq+" with "+aSeq.GetCount()+" elements\n");
|
||||
var child, children = aSeq.GetElements();
|
||||
var m = 0, first;
|
||||
while (children.hasMoreElements()) {
|
||||
m += 1;
|
||||
child = children.getNext();
|
||||
child.QueryInterface(nsIRDFResource);
|
||||
if (!first)
|
||||
first = itemCache.getItem(child);
|
||||
else
|
||||
itemCache.getItem(child);
|
||||
}
|
||||
return first;
|
||||
}
|
||||
var retItem = this.mArray[aResource.Value];
|
||||
if (retItem) {
|
||||
return retItem;
|
||||
}
|
||||
retItem = new runItem(aResource);
|
||||
this.mArray[aResource.Value] = retItem;
|
||||
runQueue.push(retItem);
|
||||
return retItem;
|
||||
},
|
||||
rerunItem : function(aResource, aObserver)
|
||||
{
|
||||
var anItem = new runItem(aResource);
|
||||
this.mArray[aResource.Value] = anItem;
|
||||
anItem.run(aObserver);
|
||||
},
|
||||
observe : function(aSubject, aTopic, aData)
|
||||
{
|
||||
this.mRun += 1;
|
||||
if (aTopic == "success") {
|
||||
if (aData == "yes") {
|
||||
this.mGood += 1;
|
||||
}
|
||||
else {
|
||||
this.mFalse +=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function runItem(aResource)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
this.mResource = aResource;
|
||||
// Directory selected
|
||||
if (kContUtils.IsSeq(this.kDatabase,this.mResource)) {
|
||||
var aSeq = kContUtils.MakeSeq(this.kDatabase,this.mResource);
|
||||
dump("THIS SHOULDN'T HAPPEN\n");
|
||||
var child, children = aSeq.GetElements();
|
||||
var m = 0;
|
||||
while (children.hasMoreElements()) {
|
||||
m += 1;
|
||||
child = children.getNext();
|
||||
child.QueryInterface(nsIRDFResource);
|
||||
itemCache.getItem(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
runItem.prototype =
|
||||
{
|
||||
// RDF resource associated with this test
|
||||
mResource : null,
|
||||
// XML documents for the XSLT transformation
|
||||
mSourceDoc : null,
|
||||
mStyleDoc : null,
|
||||
mResDoc : null,
|
||||
// XML or plaintext document for the reference
|
||||
mRefDoc : null,
|
||||
// bitfield signaling the loaded documents
|
||||
mLoaded : 0,
|
||||
kSource : 1,
|
||||
kStyle : 2,
|
||||
kReference : 4,
|
||||
// a observer, potential argument to run()
|
||||
mObserver : null,
|
||||
mSuccess : null,
|
||||
mMethod : 'xml',
|
||||
// XSLTProcessor, shared by the instances
|
||||
kProcessor : new XSLTProcessor(),
|
||||
kXalan : kStandardURL.createInstance(nsIURL),
|
||||
kDatabase : null,
|
||||
kObservers : new Array(),
|
||||
|
||||
run : function(aObserver)
|
||||
{
|
||||
if (aObserver && typeof(aObserver)=='function' ||
|
||||
(typeof(aObserver)=='object' &&
|
||||
typeof(aObserver.observe)=='function')) {
|
||||
this.mObserver=aObserver;
|
||||
}
|
||||
var name = this.kDatabase.GetTarget(this.mResource, krTypeName, true);
|
||||
if (name) {
|
||||
var cat = this.kDatabase.GetTarget(this.mResource, krTypeCat, true);
|
||||
var path = this.kDatabase.GetTarget(this.mResource, krTypePath, true);
|
||||
cat = cat.QueryInterface(nsIRDFLiteral);
|
||||
name = name.QueryInterface(nsIRDFLiteral);
|
||||
path = path.QueryInterface(nsIRDFLiteral);
|
||||
xalan_fl = this.kXalan.resolve(cat.Value+"/"+path.Value);
|
||||
xalan_ref = this.kXalan.resolve(cat.Value+"-gold/"+path.Value);
|
||||
dump(name.Value+" links to "+xalan_fl+"\n");
|
||||
}
|
||||
// Directory selected
|
||||
if (kContUtils.IsSeq(this.kDatabase,this.mResource)) {
|
||||
return;
|
||||
var aSeq = kContUtils.MakeSeq(this.kDatabase,this.mResource);
|
||||
dump("sequence: "+aSeq+" with "+aSeq.GetCount()+" elements\n");
|
||||
var child, children = aSeq.GetElements();
|
||||
var m = 0;
|
||||
while (children.hasMoreElements()) {
|
||||
m += 1;
|
||||
child = children.getNext();
|
||||
child.QueryInterface(nsIRDFResource);
|
||||
//var aFoo = new runItem(child);
|
||||
}
|
||||
}
|
||||
var refContent = this.loadTextFile(xalan_ref+".out");
|
||||
if (refContent.match(/^<\?xml/)) {
|
||||
this.mRefDoc = parser.parseFromString(refContent, 'text/xml');
|
||||
}
|
||||
else if (refContent.match(/^\s*<html/gi)) {
|
||||
this.mMethod = 'html';
|
||||
var iframe = document.getElementById('hiddenHtml').contentDocument;
|
||||
iframe.documentElement.innerHTML = refContent;
|
||||
//this.mRefDoc = iframe.documentElement.cloneNode(true);
|
||||
this.mRefDoc = iframe;
|
||||
DumpDOM(this.mRefDoc)
|
||||
}
|
||||
this.mSourceDoc = document.implementation.createDocument('', '', null);
|
||||
this.mSourceDoc.addEventListener("load",this.onload(1),false);
|
||||
this.mSourceDoc.load(xalan_fl+".xml");
|
||||
this.mStyleDoc = document.implementation.createDocument('', '', null);
|
||||
this.mStyleDoc.addEventListener("load",this.onload(2),false);
|
||||
this.mStyleDoc.load(xalan_fl+".xsl");
|
||||
},
|
||||
|
||||
// onload handler helper
|
||||
onload : function(file)
|
||||
{
|
||||
var self = this;
|
||||
return function(e)
|
||||
{
|
||||
return self.fileLoaded(file);
|
||||
};
|
||||
},
|
||||
|
||||
fileLoaded : function(mask)
|
||||
{
|
||||
this.mLoaded += mask;
|
||||
if (this.mLoaded < 3) {
|
||||
return;
|
||||
}
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
this.mResDoc = document.implementation.createDocument("", "", null);
|
||||
this.kProcessor.transformDocument(this.mSourceDoc,
|
||||
this.mStyleDoc,
|
||||
this.mResDoc, null);
|
||||
this.mRefDoc.normalize();
|
||||
try {
|
||||
isGood = DiffDOM(this.mResDoc.documentElement,
|
||||
this.mRefDoc.documentElement,
|
||||
this.mMethod == 'html');
|
||||
} catch (e) {
|
||||
isGood = false;
|
||||
};
|
||||
dump("This succeeded. "+isGood+"\n");
|
||||
if (!isGood) {
|
||||
DumpDOM(this.mResDoc);
|
||||
DumpDOM(this.mRefDoc);
|
||||
}
|
||||
isGood = isGood.toString();
|
||||
for (var i=0; i<this.kObservers.length; i++) {
|
||||
var aObs = this.kObservers[i];
|
||||
if (typeof(aObs)=='object' && typeof(aObs.observe)=='function') {
|
||||
aObs.observe(this.mResource, 'success', isGood);
|
||||
}
|
||||
else if (typeof(aObs)=='function') {
|
||||
aObs(this.mResource, 'success', isGood);
|
||||
}
|
||||
}
|
||||
if (this.mObserver) {
|
||||
if (typeof(this.mObserver)=='object') {
|
||||
this.mObserver.observe(this.mResource, 'success', isGood);
|
||||
}
|
||||
else {
|
||||
this.mObserver(this.mResource, 'success', isGood);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
loadTextFile : function(url)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var serv = Components.classes[IOSERVICE_CTRID].
|
||||
getService(nsIIOService);
|
||||
if (!serv) {
|
||||
throw Components.results.ERR_FAILURE;
|
||||
}
|
||||
var chan = serv.newChannel(url, null, null);
|
||||
var instream = doCreate(SIS_CTRID, nsISIS);
|
||||
instream.init(chan.open());
|
||||
|
||||
return instream.read(instream.available());
|
||||
}
|
||||
}
|
||||
|
||||
runItem.prototype.kXalan.QueryInterface(nsIStandardURL);
|
||||
|
||||
var cmdTestController =
|
||||
{
|
||||
supportsCommand: function(aCommand)
|
||||
{
|
||||
switch(aCommand) {
|
||||
case 'cmd_tst_run':
|
||||
case 'cmd_tst_runall':
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isCommandEnabled: function(aCommand)
|
||||
{
|
||||
return this.supportsCommand(aCommand);
|
||||
},
|
||||
doCommand: function(aCommand)
|
||||
{
|
||||
switch(aCommand) {
|
||||
case 'cmd_tst_run':
|
||||
dump("cmd_tst_run\n");
|
||||
break;
|
||||
case 'cmd_tst_runall':
|
||||
dump("cmd_tst_runall\n");
|
||||
var tst_run = document.getElementById('cmd_tst_run');
|
||||
tst_run.doCommand();
|
||||
default:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
registerController(cmdTestController);
|
|
@ -0,0 +1,164 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT Processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Axel Hecht.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2002
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org>
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var view =
|
||||
{
|
||||
onRun : function()
|
||||
{
|
||||
var sels = this.boxObject.selection,a=new Object(),b=new Object(),k;
|
||||
var rowResource, name, path;
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
for (k=0;k<sels.getRangeCount();k++){
|
||||
sels.getRangeAt(k,a,b);
|
||||
for (var l=a.value;l<=b.value;l++) {
|
||||
rowResource = this.builder.getResourceAtIndex(l);
|
||||
itemCache.getItem(rowResource);
|
||||
}
|
||||
}
|
||||
runQueue.run();
|
||||
},
|
||||
displayTest : function()
|
||||
{
|
||||
var current = this.boxObject.selection.currentIndex;
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var rowResource = this.builder.getResourceAtIndex(current);
|
||||
var item = itemCache.getItem(rowResource);
|
||||
DumpDOM(item.mSourceDoc);
|
||||
DumpDOM(item.mStyleDoc);
|
||||
},
|
||||
browseForRDF : function()
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var fp = doCreateRDFFP('Xalan Description File',
|
||||
nsIFilePicker.modeOpen);
|
||||
var res = fp.show();
|
||||
|
||||
if (res == nsIFilePicker.returnOK) {
|
||||
var furl = fp.fileURL;
|
||||
this.setDataSource(fp.fileURL.spec);
|
||||
}
|
||||
},
|
||||
dump_Good : function()
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var enumi = this.database.GetSources(krTypeSucc, kGood, true);
|
||||
var k = 0;
|
||||
while (enumi.hasMoreElements()) {
|
||||
k += 1;
|
||||
dump(enumi.getNext().QueryInterface(nsIRDFResource).Value+"\n");
|
||||
}
|
||||
dump("found "+k+" good tests\n");
|
||||
},
|
||||
prune_ds : function()
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
this.unassert(this.database.GetSources(krTypeSucc, kGood, true),
|
||||
kGood);
|
||||
this.unassert(this.database.GetSources(krTypeSucc, kBad, true),
|
||||
kBad);
|
||||
this.unassert(this.database.GetSources(krTypeSucc, kMixed, true),
|
||||
kMixed);
|
||||
runQueue.mArray = new Array();
|
||||
itemCache.mArray = new Array();
|
||||
},
|
||||
unassert : function(aEnum, aResult)
|
||||
{
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var k = 0, item;
|
||||
while (aEnum.hasMoreElements()) {
|
||||
k += 1;
|
||||
var item = aEnum.getNext();
|
||||
try {
|
||||
item = item.QueryInterface(nsIRDFResource);
|
||||
this.database.Unassert(item, krTypeSucc, aResult, true);
|
||||
} catch (e) {
|
||||
dump("Can't unassert "+item+"\n");
|
||||
}
|
||||
}
|
||||
},
|
||||
setDataSource : function(aSpec)
|
||||
{
|
||||
var baseSpec;
|
||||
if (aSpec) {
|
||||
baseSpec = aSpec;
|
||||
}
|
||||
else {
|
||||
baseSpec = document.getElementById("xalan_rdf").value;
|
||||
}
|
||||
dump(baseSpec+"\n");
|
||||
var currentSources = this.database.GetDataSources();
|
||||
while (currentSources.hasMoreElements()) {
|
||||
var aSrc = currentSources.getNext().
|
||||
QueryInterface(nsIRDFDataSource);
|
||||
this.database.RemoveDataSource(aSrc);
|
||||
}
|
||||
var ds = kRDFSvc.GetDataSource(baseSpec);
|
||||
if (!ds) {
|
||||
alert("Unable do load DataSource: "+baseSpec);
|
||||
return;
|
||||
}
|
||||
view.database.AddDataSource(ds);
|
||||
view.memoryDataSource = doCreate(kRDFInMemContractID,
|
||||
nsIRDFDataSource);
|
||||
if (!view.memoryDataSource) {
|
||||
alert("Unable to create write-protect InMemDatasource,"+
|
||||
" not adding "+ baseSpec);
|
||||
this.database.RemoveDataSource(ds);
|
||||
}
|
||||
view.database.AddDataSource(view.memoryDataSource);
|
||||
view.builder.rebuild();
|
||||
document.getElementById("xalan_rdf").value = baseSpec;
|
||||
runItem.prototype.kXalan.init(runItem.prototype.kXalan.URLTYPE_STANDARD,
|
||||
0, baseSpec, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
function rdfObserve(aSubject, aTopic, aData)
|
||||
{
|
||||
if (aTopic == "success") {
|
||||
if (aData == "true") {
|
||||
view.database.Assert(aSubject, krTypeSucc, kGood, true);
|
||||
}
|
||||
else {
|
||||
view.database.Assert(aSubject, krTypeSucc, kBad, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runItem.prototype.kObservers.push(rdfObserve);
|
|
@ -0,0 +1,38 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Axel Hecht.
|
||||
* Portions created by Axel Hecht are Copyright (C) 2002 Axel Hecht.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org> (Original Author)
|
||||
*/
|
||||
|
||||
|
||||
label.head {
|
||||
padding: 5px;
|
||||
font-size: medium;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
treechildren:-moz-tree-cell(success yes)
|
||||
{
|
||||
background-color: green ;
|
||||
}
|
||||
|
||||
treechildren:-moz-tree-cell(success no)
|
||||
{
|
||||
background-color: red ;
|
||||
}
|
|
@ -22,34 +22,79 @@
|
|||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="txTools.css" type="text/css"?>
|
||||
<?xml-stylesheet href="buster.css" type="text/css"?>
|
||||
<window id="XalanBuster"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="loaderstuff()"
|
||||
onload="onLoad()" onunload="onUnload()"
|
||||
title="Xalan testcase harnish"
|
||||
orient="vertical">
|
||||
<script type="application/x-javascript" src="DiffDOM.js" />
|
||||
<script type="application/x-javascript" src="txTools.js" />
|
||||
<script type="application/x-javascript" src="xulTxTools.js" />
|
||||
<script type="application/x-javascript" src="buster-statics.js" />
|
||||
<script type="application/x-javascript" src="buster-test.js" />
|
||||
<script type="application/x-javascript" src="buster-view.js" />
|
||||
<script type="application/x-javascript" src="buster-handlers.js" />
|
||||
<script type="application/x-javascript" src="result-view.js" />
|
||||
<script type="application/x-javascript" src="buster-files.js" />
|
||||
<script type="application/x-javascript" src="DumpDOM.js" />
|
||||
<script type="application/x-javascript" src="DiffDOM.js" />
|
||||
|
||||
<commands id="busterKing">
|
||||
<commandset id="buster_file_cmds">
|
||||
<command id="cmd_fl_save" oncommand="goDoCommand('cmd_fl_save')" />
|
||||
<command id="cmd_fl_import" oncommand="goDoCommand('cmd_fl_import')"/>
|
||||
</commandset>
|
||||
<commandset id="buster_test_cmds">
|
||||
<command id="cmd_tst_run" oncommand="goDoCommand('cmd_tst_run')" />
|
||||
<command id="cmd_tst_runall" oncommand="goDoCommand('cmd_tst_runall')" />
|
||||
</commandset>
|
||||
</commands>
|
||||
|
||||
<broadcasterset>
|
||||
<broadcaster id="obs_orig_success" hidden="true"/>
|
||||
<broadcaster id="not_yet" disabled="true"/>
|
||||
</broadcasterset>
|
||||
|
||||
|
||||
<menubar>
|
||||
<menu id="busterFile" label="File" accesskey="f">
|
||||
<menupopup id="file-popup">
|
||||
<menuitem label="Save results ..." accesskey="s"
|
||||
observes="cmd_fl_save"/>
|
||||
<menuitem label="Import results ..." accesskey="i"
|
||||
observes="cmd_fl_import"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="busterTests" label="Tests" accesskey="t">
|
||||
<menupopup id="tests-popup">
|
||||
<menuitem label="run a test" accesskey="r"
|
||||
observes="cmd_tst_run"/>
|
||||
<menuitem label="run all tests" accesskey="a"
|
||||
observes="cmd_tst_runall"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<popupset>
|
||||
<popup id="itemcontext">
|
||||
<menuitem label="View Test" oncommand="onNewResultView(event)"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<hbox>
|
||||
<button label="load tests" oncommand="refresh_xalan()" />
|
||||
<button label="check all" oncommand="check(true)" />
|
||||
<button label="uncheck all" oncommand="check(false)" />
|
||||
<button label="invert checks" oncommand="invert_check()" />
|
||||
<button label="hide checked" oncommand="hide_checked(true)" />
|
||||
<button label="hide unchecked" oncommand="hide_checked(false)" />
|
||||
<button label="run checked tests" oncommand="dump_checked()" />
|
||||
<button label="check all" oncommand="check(true)" observes="not_yet"/>
|
||||
<button label="uncheck all" oncommand="check(false)" observes="not_yet"/>
|
||||
<button label="reset success" oncommand="view.prune_ds()" />
|
||||
<button label="run checked tests" oncommand="view.onRun()" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<text value="Xalan base directory: " class="head" />
|
||||
<textbox id="xalan_base" persist="value"/>
|
||||
<button label="browse..." oncommand="browse_base_dir()" />
|
||||
<label value="Xalan index: " class="head"/>
|
||||
<textbox id="xalan_rdf" persist="url" crop="end" size="40"/>
|
||||
<button label="browse..." oncommand="view.browseForRDF()" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<groupbox orient="horizontal"><caption label="search" />
|
||||
<button label="Search for " oncommand="select()"/>
|
||||
<textbox style="width: 10em;" id="search-name" persist="value" /><text value=" in " />
|
||||
<menulist id="search-field" persist="data">
|
||||
<button label="Search for " oncommand="select()" observes="not_yet"/>
|
||||
<textbox style="width: 10em;" id="search-name" persist="value" /><label value=" in " />
|
||||
<menulist id="search-field" persist="data" observes="not_yet">
|
||||
<menupopup>
|
||||
<menuitem value="1" label="Name" />
|
||||
<menuitem value="2" label="Purpose" />
|
||||
|
@ -58,27 +103,99 @@
|
|||
</menulist>
|
||||
</groupbox>
|
||||
<groupbox orient="horizontal"><caption label="select" />
|
||||
<button label="Select from " oncommand="selectRange()"/>
|
||||
<button label="Select from " oncommand="selectRange()" observes="not_yet"/>
|
||||
<textbox style="width: 10em;" id="start-field" persist="value" />
|
||||
<text value=" to " />
|
||||
<label value=" to " />
|
||||
<textbox style="width: 10em;" id="end-field" persist="value" />
|
||||
</groupbox>
|
||||
<spacer flex="1" /></hbox>
|
||||
<hbox><groupbox orient="horizontal"><caption label="stats" />
|
||||
<text value="tests run: "/><text id="tests_run" value="0" />
|
||||
<text value=" tests passed: "/><text id="tests_passed" value="0"/>
|
||||
<text value=" tests failed: "/><text id="tests_failed" value="0"/>
|
||||
<text value=" tests selected: "/><text id="tests_selected" value="0"/>
|
||||
<label value="tests run: "/><label id="tests_run" value="0" />
|
||||
<label value=" tests passed: "/><label id="tests_passed" value="0"/>
|
||||
<label value=" tests failed: "/><label id="tests_failed" value="0"/>
|
||||
<label value=" tests selected: "/><label id="tests_selected" value="0"/>
|
||||
</groupbox>
|
||||
<spacer flex="1" /></hbox>
|
||||
|
||||
<tree id="out" flex="1" onselect="sel_change()">
|
||||
<tree id="out" flex="1" flags="dont-build-content"
|
||||
datasources="rdf:null" ref="urn:root"
|
||||
context="itemcontext">
|
||||
<treecols>
|
||||
<treecol id="name" label="Name" flex="1"/>
|
||||
<treecol id="purp" label="Purpose" flex="2"/>
|
||||
<treecol id="comm" label="Comment" flex="1"/>
|
||||
<treecol id="NameColumn" flex="1" label="Name" sort="?name"
|
||||
primary="true" />
|
||||
<splitter />
|
||||
<treecol id="PurpsColumn" flex="2" label="Purpose" sort="?purp" />
|
||||
<splitter />
|
||||
<treecol id="SuccessColumn" flex="0" label="Success" />
|
||||
<splitter observes="obs_orig_success" />
|
||||
<treecol id="OrigSuccessColumn" flex="0" label="Previously"
|
||||
observes="obs_orig_success" />
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<treeitem uri="?uri" />
|
||||
<member container="?uri" child="?subheading" />
|
||||
<triple subject="?subheading"
|
||||
predicate="http://home.netscape.com/NC-rdf#purp"
|
||||
object="?purp" />
|
||||
</conditions>
|
||||
|
||||
<bindings>
|
||||
<binding subject="?subheading"
|
||||
predicate="http://home.netscape.com/NC-rdf#name"
|
||||
object="?name" />
|
||||
<binding subject="?subheading"
|
||||
predicate="http://home.netscape.com/NC-rdf#succ"
|
||||
object="?succ" />
|
||||
<binding subject="?subheading"
|
||||
predicate="http://home.netscape.com/NC-rdf#orig_succ"
|
||||
object="?orig_succ" />
|
||||
</bindings>
|
||||
|
||||
<action>
|
||||
<treechildren>
|
||||
<treeitem uri="?subheading" >
|
||||
<treerow>
|
||||
<treecell ref="NameColumn" label="?name" />
|
||||
<treecell ref="PurpsColumn" label="?purp" />
|
||||
<treecell ref="SuccessColumn" label="?succ"
|
||||
properties="success ?succ"/>
|
||||
<treecell ref="OrigSuccessColumn" label="?orig_succ"
|
||||
properties="success ?orig_succ"
|
||||
/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</action>
|
||||
</rule>
|
||||
<rule>
|
||||
<conditions>
|
||||
<treeitem uri="?uri" />
|
||||
<member container="?uri" child="?subheading" />
|
||||
</conditions>
|
||||
|
||||
<bindings>
|
||||
<binding subject="?subheading"
|
||||
predicate="http://home.netscape.com/NC-rdf#dir"
|
||||
object="?dir" />
|
||||
<binding subject="?subheading"
|
||||
predicate="http://home.netscape.com/NC-rdf#succ"
|
||||
object="?succ" />
|
||||
</bindings>
|
||||
|
||||
<action>
|
||||
<treechildren>
|
||||
<treeitem uri="?subheading" >
|
||||
<treerow>
|
||||
<treecell ref="NameColumn" label="?dir" />
|
||||
<treecell ref="SuccessColumn" label="?succ" />
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
</tree>
|
||||
<iframe style="visibility:hidden; height:0px;" id="hiddenHtml" />
|
||||
</window>
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
use File::Spec;
|
||||
use File::Glob ':glob';
|
||||
|
||||
my(@chunks);
|
||||
@list = ('conf');
|
||||
go_in('conf', '', 'conf');
|
||||
#exit 0;
|
||||
print '<?xml version="1.0"?>
|
||||
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#">
|
||||
<rdf:Seq about="urn:root">
|
||||
<rdf:li><rdf:Description ID="conf" nc:dir="conf" /></rdf:li>
|
||||
<rdf:li><rdf:Description ID="contrib" nc:dir="contrib" /></rdf:li>
|
||||
<rdf:li><rdf:Description ID="perf" nc:dir="perf" /></rdf:li>
|
||||
</rdf:Seq>
|
||||
';
|
||||
print join('',@chunks);
|
||||
print '</rdf:RDF>
|
||||
';
|
||||
exit 0;
|
||||
|
||||
sub go_in {
|
||||
my($current, $about, $cat) = @_;
|
||||
my (@list, $entry, @subdirs, @files, @purps, $rdf);
|
||||
chdir $current;
|
||||
@list = glob('*');
|
||||
|
||||
LOOP: foreach $entry (@list) {
|
||||
next LOOP if $entry=~/^CVS$/;
|
||||
if (! -d $entry) {
|
||||
if ($entry=~/^($current.*)\.xsl$/) {
|
||||
push(@files, $1);
|
||||
local ($purp);
|
||||
open STYLE, $entry;
|
||||
while (<STYLE>) {
|
||||
if (/<!--\s+Purpose: (.+)\s*-->/) {
|
||||
$purp .= $1;
|
||||
}
|
||||
}
|
||||
$purp=~s/"/'/g; $purp=~s/&/&/g; $purp=~s/</</g;
|
||||
push(@purps, $purp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
push(@subdirs, $entry);
|
||||
}
|
||||
}
|
||||
#print join(" ", @subdirs)."\n";
|
||||
my $topic = $about.$current; $topic=~s/\///g;
|
||||
$rdf = '<rdf:Seq about="#'.$topic."\" >\n";
|
||||
foreach $entry (@subdirs) {
|
||||
my $id = $about.$current.$entry; $id=~s/\///g;
|
||||
$rdf .= "<rdf:li><rdf:Description ID=\"$id\" nc:dir=\"$entry\" /></rdf:li>\n";
|
||||
}
|
||||
for (my $i=0; $i < @files; $i++) {
|
||||
my $uri = $about.$current.'/'.$files[$i];
|
||||
$uri=~s/[^\/]+\///;
|
||||
my $id = $uri; $id=~s/\///g;
|
||||
$rdf .= "<rdf:li><rdf:Description ID=\"$files[$i]\" nc:name=\"$files[$i]\" nc:purp=\"$purps[$i]\" nc:path=\"$uri\" nc:category=\"$cat\"/></rdf:li>\n";
|
||||
}
|
||||
$rdf .= "</rdf:Seq>\n";
|
||||
push(@chunks, $rdf);
|
||||
#print join(" ", @files)."\n";
|
||||
foreach $entry (@subdirs) {
|
||||
go_in($entry, $about.$current.'/', $cat);
|
||||
}
|
||||
chdir File::Spec->updir;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
label.heading {
|
||||
font-size: medium;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button.close {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
iframe {
|
||||
padding-left: 10px;
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT Processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Axel Hecht.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Axel Hecht <axel@pike.org>
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var currentResultItem = new Object();
|
||||
|
||||
function onNewResultView(event)
|
||||
{
|
||||
const db = runItem.prototype.kDatabase;
|
||||
const kXalan = runItem.prototype.kXalan;
|
||||
var index = view.boxObject.selection.currentIndex;
|
||||
enablePrivilege('UniversalXPConnect');
|
||||
var res = view.builder.getResourceAtIndex(index);
|
||||
var name = db.GetTarget(res, krTypeName, true);
|
||||
if (!name) {
|
||||
return false;
|
||||
}
|
||||
var cat = db.GetTarget(res, krTypeCat, true);
|
||||
var path = db.GetTarget(res, krTypePath, true);
|
||||
cat = cat.QueryInterface(nsIRDFLiteral);
|
||||
name = name.QueryInterface(nsIRDFLiteral);
|
||||
path = path.QueryInterface(nsIRDFLiteral);
|
||||
xalan_fl = kXalan.resolve(cat.Value+"/"+path.Value);
|
||||
xalan_ref = kXalan.resolve(cat.Value+"-gold/"+path.Value);
|
||||
currentResultItem.testpath = xalan_fl;
|
||||
currentResultItem.refpath = xalan_ref;
|
||||
dump(name.Value+" links to "+xalan_fl+"\n");
|
||||
var win = window.openDialog('result-view.xul','txBusterResult',
|
||||
'chrome,width=800,height=800,dialog=no',
|
||||
currentResultItem);
|
||||
}
|
||||
|
||||
function onResultViewLoad(event)
|
||||
{
|
||||
var arg = window.arguments[0];
|
||||
document.getElementById('src').setAttribute('src', 'view-source:'+
|
||||
arg.testpath+'.xml');
|
||||
document.getElementById('style').setAttribute('src', 'view-source:'+
|
||||
arg.testpath+'.xsl');
|
||||
document.getElementById('ref').setAttribute('src', arg.refpath+'.out');
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
The contents of this file are subject to the Mozilla Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is mozilla.org.
|
||||
|
||||
The Initial Developer of the Original Code is Axel Hecht.
|
||||
Portions created by Axel Hecht are Copyright (C) 2002 Axel Hecht.
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Axel Hecht <axel@pike.org> (Original Author)
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="result-view.css" type="text/css"?>
|
||||
|
||||
<window id="buster-result-view"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical"
|
||||
onload="onResultViewLoad()">
|
||||
<script type="application/x-javascript" src="DumpDOM.js" />
|
||||
<script type="application/x-javascript" src="buster-statics.js" />
|
||||
<script type="application/x-javascript" src="buster-test.js" />
|
||||
<script type="application/x-javascript" src="result-view.js" />
|
||||
<script>
|
||||
</script>
|
||||
<hbox>
|
||||
<button class="close" label="close this window"
|
||||
oncommand="window.close()" />
|
||||
</hbox>
|
||||
<vbox flex="1">
|
||||
<label class="heading" value="XML Source:" />
|
||||
<iframe flex="1" id="src" />
|
||||
</vbox>
|
||||
<vbox flex="1">
|
||||
<label class="heading" value="XSL Source:" />
|
||||
<iframe flex="1" id="style" />
|
||||
</vbox>
|
||||
<vbox flex="1">
|
||||
<label class="heading" value="Reference Source:" />
|
||||
<iframe flex="1" id="ref" />
|
||||
</vbox>
|
||||
</window>
|
Загрузка…
Ссылка в новой задаче