Bug 600949 - remove unused testing/extensions dir (NPOTB) - r=aaron.train
@ -1,12 +0,0 @@
|
||||
This is the Mozilla Community QA Extension Project.
|
||||
Maintained by: Zach Lipton <zach@zachlipton.com>
|
||||
|
||||
For more details, please see the wiki at:
|
||||
http://wiki.mozilla.org/Litmus:Extension
|
||||
|
||||
License is MPL 2 as described in the various source files.
|
||||
|
||||
MochiKit (c) 2005 Bob Ippolito, Academic Free License.
|
||||
|
||||
Chatzilla (used under MPL 2) is modified slightly to run in a different
|
||||
chrome path to not conflict with standard installations.
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
|
||||
<!--
|
||||
build.xml adapted from Shawn Wilsher's rtse
|
||||
(http://shawnwilsher.com/extensions/rtse/)
|
||||
-->
|
||||
|
||||
<project name="qa" default="createxpi">
|
||||
<tstamp>
|
||||
<format property="build.number" pattern="yyyyMMdd" offset="-1" unit="hour"/>
|
||||
</tstamp>
|
||||
<property name="build.version" value="0.1.${build.number}"/>
|
||||
<target name="createxpi" depends="createjar">
|
||||
<zip destfile="qa.xpi">
|
||||
<zipfileset dir="" includes="chrome/qa.jar"/>
|
||||
<zipfileset dir="" includes="chatzilla.jar"/>
|
||||
<zipfileset dir="" includes="install.rdf"/>
|
||||
<zipfileset dir="" includes="jar-chrome.manifest" fullpath="chrome.manifest"/>
|
||||
<zipfileset dir="" includes="README" />
|
||||
<zipfileset dir="" includes="defaults/**" excludes="**CVS"/>
|
||||
<zipfileset dir="" includes="platform/**" excludes="**CVS"/>
|
||||
<zipfileset dir="" includes="components/chatzilla-service.js" />
|
||||
</zip>
|
||||
</target>
|
||||
<target name="createjar">
|
||||
<zip destfile="chrome/qa.jar">
|
||||
<zipfileset dir="chrome" includes="content/**" excludes="**CVS"/>
|
||||
<zipfileset dir="chrome" includes="skin/**" excludes="**CVS"/>
|
||||
<zipfileset dir="chrome" includes="locale/**" excludes="**CVS"/>
|
||||
</zip>
|
||||
</target>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
content qa chrome/content/
|
||||
skin qa classic/1.0 chrome/skin/
|
||||
locale qa en-US chrome/locale/en-US/
|
||||
|
||||
overlay chrome://browser/content/browser.xul chrome://qa/content/browserOverlays.xul
|
||||
|
||||
content chatzilla_qa jar:chatzilla.jar!/content/chatzilla/
|
||||
skin chatzilla_qa modern/1.0 jar:chatzilla.jar!/skin/modern/chatzilla/
|
||||
locale chatzilla_qa en-US jar:chatzilla.jar!/locale/en-US/chatzilla/
|
||||
content chatzillaservice_qa components/chatzilla-service.js
|
@ -1,6 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
dojo.hostenv.conditionalLoadModule({"common": ["MochiKit.MochiKit"]});
|
||||
dojo.hostenv.moduleLoaded("MochiKit.*");
|
@ -1,45 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var accountCreate = {
|
||||
oldPassword: null, //TODO: is this secure?
|
||||
oldUsername: null,
|
||||
updateFunction : null,
|
||||
loadSetup : function() {
|
||||
document.getElementById('qa-settings-createaccount-frame').src =
|
||||
litmus.baseURL+'extension.cgi?createAccount=1';
|
||||
accountCreate.updateFunction = window.arguments[0];
|
||||
|
||||
accountCreate.oldPassword = qaPref.litmus.getPassword();
|
||||
accountCreate.oldUsername = qaPref.litmus.getUsername();
|
||||
},
|
||||
validateAccount : function() {
|
||||
|
||||
var account = qaSetup.retrieveAccount("qa-settings-createaccount-frame");
|
||||
var uname = account.name;
|
||||
var passwd = account.password;
|
||||
|
||||
|
||||
if (uname == '' || passwd == '') {
|
||||
alert("No username or password has been registered.");
|
||||
return false; //we need better error handling.
|
||||
}
|
||||
|
||||
var location = document.getElementById('qa-settings-createaccount-frame').contentDocument.location + "";
|
||||
if (location.indexOf("createAccount") != -1) {
|
||||
alert("Account not created! You most likely need to click the 'Create Account' button");
|
||||
return false;
|
||||
}
|
||||
|
||||
qaPref.litmus.setPassword(uname, passwd);
|
||||
accountCreate.updateFunction();
|
||||
|
||||
// TODO: ideally we would validate against litmus, but...
|
||||
return true;
|
||||
},
|
||||
|
||||
handleCancel : function() {
|
||||
qaPref.litmus.setPassword(oldUsername, oldPassword);
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
|
||||
- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!DOCTYPE wizard PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://qa/skin/" type="text/css"?>
|
||||
|
||||
<dialog id="account-setup"
|
||||
title="Account Creation"
|
||||
class="color-dialog"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
width="800px"
|
||||
height="400px"
|
||||
onload="accountCreate.loadSetup();"
|
||||
ondialogaccept="return accountCreate.validateAccount();"
|
||||
ondialogcancel=""
|
||||
>
|
||||
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/common.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/accountcreate.js" />
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_qa" src="chrome://qa/locale/qa.properties" />
|
||||
</stringbundleset>
|
||||
|
||||
<vbox id="qa-setup-accountno" style="display: none" width="0px" height="0px" />
|
||||
<html:iframe id="qa-settings-createaccount-frame"
|
||||
height="280"/>
|
||||
|
||||
</dialog>
|
@ -1,62 +0,0 @@
|
||||
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
|
||||
- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://qa/skin/browserOverlays.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/qa.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/notifications.js" />
|
||||
|
||||
<menupopup id="menu_ToolsPopup">
|
||||
<menuitem id="qac-menuitem"
|
||||
insertafter="devToolsSeparator"
|
||||
accesskey="&qacompanionMenu.accesskey;"
|
||||
label="&qacompanionMenu.label;"
|
||||
oncommand="qaMain.openQATool();"/>
|
||||
</menupopup>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbarpanel class="statusbarpanel-iconic" id="qa-statusbar-overlay"
|
||||
onclick="qaMain.openQATool();" />
|
||||
</statusbar>
|
||||
|
||||
<window id="main-window">
|
||||
<vbox id="qa-notify" class="qa-notify" hidden="true">
|
||||
<vbox flex="1" class="qa-notify">
|
||||
<hbox pack="end" align="center">
|
||||
<toolbarbutton class="tabs-closebutton" id="qa-notify-close"
|
||||
oncommand="qaNotifications.showHideNotify(false);" />
|
||||
</hbox>
|
||||
<vbox id="qa-notify-box">
|
||||
<vbox>
|
||||
<label id="qa-notify-inprogress" value="&qa.notification.inprogress;" />
|
||||
<hbox align="center" id="qa-notify-header-box" style="overflow: hidden">
|
||||
<label id="qa-notify-header" value="" />
|
||||
</hbox>
|
||||
<vbox id="qa-notify-event" style="display: none;">
|
||||
<label id="qa-notify-event-datetime" value="" />
|
||||
<label id="qa-notify-event-place" value="" />
|
||||
</vbox>
|
||||
<vbox id="qa-notify-content">
|
||||
<description id="qa-notify-text" />
|
||||
<label id="qa-notify-infolink" class="text-link" href=""
|
||||
value="" />
|
||||
<label id="qa-notify-getstartedlink" class="text-link" href=""
|
||||
value="" style="display: none;" />
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</window>
|
||||
</overlay>
|
@ -1,162 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
const Cr = Components.results;
|
||||
|
||||
var qaTools = {
|
||||
// load a JSON doc into a menulist/menupopup
|
||||
// takes the url to load, the menulist to populate, the name of the method
|
||||
// to use to get the name from the JSON doc, and the name of the method to
|
||||
// use to get the value from the JSON doc, plus an optional callback
|
||||
loadJsonMenu : function(url, menulist, nameMethod, valueMethod, callback) {
|
||||
var d = loadJSONDoc(url);
|
||||
d.addErrback(function (err) {
|
||||
if (err instanceof CancelledError) {
|
||||
return;
|
||||
}
|
||||
dump(err);
|
||||
});
|
||||
d.addCallback(function(obj) {
|
||||
if (obj instanceof Array) {
|
||||
for (var i=0; i<obj.length; i++) {
|
||||
var item = obj[i];
|
||||
if (! item) { continue; }
|
||||
var newitem = menulist.appendItem(item[nameMethod],
|
||||
item[valueMethod]);
|
||||
}
|
||||
} else {
|
||||
var newitem = menulist.appendItem(obj[nameMethod], obj[valueMethod]);
|
||||
}
|
||||
// stash the JSON object in the userData attribute for
|
||||
// later use (e.g. when filtering the list).
|
||||
newitem.userData = item;
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
},
|
||||
fetchFeed : function(url, callback) {
|
||||
var httpRequest = null;
|
||||
function FeedResultListener() {}
|
||||
FeedResultListener.prototype = {
|
||||
handleResult : function(result) {
|
||||
var feed = result.doc;
|
||||
feed.QueryInterface(Ci.nsIFeed);
|
||||
callback(feed);
|
||||
}
|
||||
};
|
||||
|
||||
function infoReceived() {
|
||||
var data = httpRequest.responseText;
|
||||
var ioService = Cc['@mozilla.org/network/io-service;1']
|
||||
.getService(Ci.nsIIOService);
|
||||
var uri = ioService.newURI(url, null, null);
|
||||
if (data.length) {
|
||||
var processor = Cc["@mozilla.org/feed-processor;1"]
|
||||
.createInstance(Ci.nsIFeedProcessor);
|
||||
try {
|
||||
processor.listener = new FeedResultListener;
|
||||
processor.parseFromString(data, uri);
|
||||
} catch(e) {
|
||||
alert("Error parsing feed: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
httpRequest = new XMLHttpRequest();
|
||||
httpRequest.open("GET", url, true);
|
||||
try {
|
||||
httpRequest.onload = infoReceived;
|
||||
httpRequest.send(null);
|
||||
} catch(e) {
|
||||
alert(e);
|
||||
}
|
||||
},
|
||||
httpPostRequest : function (url, data, callback, errback) {
|
||||
// do a xmlhttprequest sending data with the post method
|
||||
var req = getXMLHttpRequest();
|
||||
req.open("POST", url, true);
|
||||
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
req.setRequestHeader("Content-length", data.length);
|
||||
req.setRequestHeader("Connection", "close");
|
||||
req = sendXMLHttpRequest(req, data);
|
||||
req.addErrback(errback);
|
||||
req.addCallback(callback);
|
||||
},
|
||||
showHideLoadingMessage : function(box, bool) {
|
||||
if (bool == true) { // show
|
||||
var loading = document.createElementNS("http://www.w3.org/1999/xhtml", "p");
|
||||
loading.textContent = qaMain.bundle.getString("qa.extension.loading");
|
||||
loading.setAttributeNS("http://www.w3.org/1999/xhtml",
|
||||
"class", "loading_message");
|
||||
box.appendChild(loading);
|
||||
} else { // hide
|
||||
var elements = box.childNodes;
|
||||
for (var i=0; i<elements.length; i++) {
|
||||
if (elements[i] && elements[i].getAttributeNS &&
|
||||
elements[i].getAttributeNS(
|
||||
"http://www.w3.org/1999/xhtml", "class") == "loading_message") {
|
||||
box.removeChild(elements[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
arrayify : function(obj) {
|
||||
if (obj instanceof Array) {
|
||||
return obj;
|
||||
}
|
||||
var newArray = new Array();
|
||||
newArray[0] = obj;
|
||||
return newArray;
|
||||
},
|
||||
writeSafeHTML : function(elementID, htmlstr) {
|
||||
document.getElementById(elementID).textContent = ""; //clear it.
|
||||
var utils = Components.classes["@mozilla.org/parserutils;1"].getService(Components.interfaces.nsIParserUtils);
|
||||
var context = document.getElementById(elementID);
|
||||
var fragment = utils.parseFragment(htmlstr, 0, false, null, context);
|
||||
context.appendChild(fragment);
|
||||
},
|
||||
|
||||
assignLinkHandlers : function(node) {
|
||||
var children = node.getElementsByTagName('a');
|
||||
for (var i = 0; i < children.length; i++)
|
||||
children[i].addEventListener("click", qaTools.handleLink, false);
|
||||
},
|
||||
assignLinkHandler : function(link) {
|
||||
link.addEventListener("click", qaTools.handleLink, false);
|
||||
},
|
||||
handleLink : function(event) {
|
||||
var url = this.href;
|
||||
var type = qaPref.getPref("browser.link.open_external", "int");
|
||||
var where = "tab";
|
||||
if (type == 2) where = "window";
|
||||
|
||||
openUILinkIn(url, where);
|
||||
event.preventDefault(); // prevent it from simply following the href
|
||||
},
|
||||
makeUniqueArray : function(array) {
|
||||
var RV = new Array();
|
||||
for( var i = 0; i < array.length; i++ ) {
|
||||
if( RV.indexOf(array[i]) < 0 ) { RV.push( array[i] ); }
|
||||
}
|
||||
return RV;
|
||||
}
|
||||
};
|
||||
|
||||
function getCleanText(inputText)
|
||||
{
|
||||
inputText = inputText.replace(/@/g,"@");
|
||||
inputText = inputText.replace(/"/g,"\"");
|
||||
inputText = inputText.replace(/</g, "<");
|
||||
inputText = inputText.replace(/>/g, ">");
|
||||
inputText = inputText.replace(/&/g, "&");
|
||||
inputText = inputText.replace(/<[^>]*>/g, "");
|
||||
inputText = inputText.replace(/\s+/g, " ");
|
||||
inputText = inputText.replace(/\n*/g, "");
|
||||
|
||||
return inputText;
|
||||
}
|
@ -1,449 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
||||
|
||||
var litmus = {
|
||||
baseURL : qaPref.getPref(qaPref.prefBase+".litmus.url", "char"),
|
||||
userStats : '',
|
||||
|
||||
getTestcase : function(testcase_id, callback) {
|
||||
litmus.getLitmusJson(testcase_id, callback, "testcase_id=");
|
||||
},
|
||||
getSubgroup : function(subgroupID, callback) {
|
||||
litmus.getLitmusJson(subgroupID, callback, "subgroup_id=");
|
||||
},
|
||||
getTestgroup : function(testgroupID, callback) {
|
||||
litmus.getLitmusJson(testgroupID, callback, "testgroup_id=");
|
||||
},
|
||||
getTestrun : function(testrunID, callback) {
|
||||
litmus.getLitmusJson(testrunID, callback, "test_run_id=");
|
||||
},
|
||||
getTestruns : function(callback) {
|
||||
var s = new Sysconfig();
|
||||
var branch = encodeURIComponent(s.branch);
|
||||
litmus.getLitmusJson("&product_name=Firefox&branch_name=" + branch,
|
||||
callback, "test_runs_by_branch_product_name=1");
|
||||
},
|
||||
getLitmusJson : function(ID, callback, prefix) {
|
||||
var url = litmus.baseURL+'json.cgi?' + prefix + ID;
|
||||
var d = loadJSONDoc(url);
|
||||
d.addBoth(function (res) {
|
||||
d.deferred = null;
|
||||
return res;
|
||||
});
|
||||
d.addCallback(callback);
|
||||
d.addErrback(function (err) {
|
||||
if (err instanceof CancelledError) {
|
||||
return;
|
||||
}
|
||||
dump(err);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
lastTestRunSummary : "",
|
||||
lastTestGroupSummary : "",
|
||||
lastSubgroupObject: null, // these have to be objects to avoid the async call later.
|
||||
lastTestcaseObject: null, // they are saved every time a subgroup or testcase is written to screen
|
||||
lastTestcaseIndex: null,
|
||||
|
||||
preDialogSubgroupObject: null, // saved to be restored in case of Cancel()
|
||||
preDialogTestcaseObject: null,
|
||||
|
||||
dialogActive: false, // we want to keep controls disabled, even if the selection changes.
|
||||
|
||||
storeSubgroup : function(subgroup) {
|
||||
litmus.lastSubgroupObject = subgroup;
|
||||
},
|
||||
storeTestcase : function(testcase) {
|
||||
litmus.lastTestcaseObject = testcase;
|
||||
},
|
||||
|
||||
handleDialog : function() {
|
||||
if ($("qa-testrun-label").label != "") {
|
||||
litmus.lastTestRunSummary = $("qa-testrun-label").label;
|
||||
litmus.lastTestGroupSummary = $("qa-testgroup-label").value;
|
||||
lastTestcaseIndex = $("testlist").selectedIndex;
|
||||
}
|
||||
litmus.preDialogueSubgroupObject = litmus.lastSubgroupObject;
|
||||
litmus.preDialogTestcaseObject = litmus.lastTestcaseObject;
|
||||
litmus.disableAll();
|
||||
litmus.dialogActive = true;
|
||||
var newWindow = window.openDialog('chrome://qa/content/tabs/selecttests.xul', '_blank', 'chrome,all,dialog=yes',
|
||||
litmus.readStateFromPref, litmus.handleDialogCancel, litmus.handleDialogOK);
|
||||
},
|
||||
|
||||
handleDialogCancel : function() {
|
||||
if (litmus.lastTestRunSummary == "") return;
|
||||
|
||||
// this code is v. similar to readStateFromPref, but without an async call.
|
||||
$("qa-testrun-label").label = litmus.lastTestRunSummary;
|
||||
$("qa-testgroup-label").value = litmus.lastTestGroupSummary;
|
||||
litmus.lastSubgroupObject = litmus.preDialogueSubgroupObject;
|
||||
litmus.lastTestcaseObject = litmus.preDialogTestcaseObject;
|
||||
|
||||
if (litmus.lastSubgroupObject != null)
|
||||
litmus.populatePreviewBox(litmus.lastSubgroupObject.testcases);
|
||||
if (litmus.lastTestcaseObject != null) {
|
||||
litmus.populateTestcase(litmus.lastTestcaseObject);
|
||||
}
|
||||
// set the selection without firing an event, which would cause async call
|
||||
$("testlist").setAttribute("suppressonselect", "true");
|
||||
$("testlist").selectedIndex = lastTestcaseIndex;
|
||||
$("testlist").setAttribute("suppressonselect", "false");
|
||||
|
||||
// rewrite the prefs
|
||||
litmus.writeStateToPref(litmus.lastTestRunSummary, litmus.lastTestGroupSummary,
|
||||
litmus.lastSubgroupObject.subgroup_id, lastTestcaseIndex);
|
||||
|
||||
litmus.dialogActive = false;
|
||||
litmus.undisableAll();
|
||||
},
|
||||
|
||||
handleDialogOK : function() {
|
||||
litmus.dialogActive = false;
|
||||
litmus.undisableAll();
|
||||
},
|
||||
|
||||
validateLogin : function(uname, passwd, callback) {
|
||||
var qs = queryString({
|
||||
validate_login: 1,
|
||||
username: uname,
|
||||
password: passwd
|
||||
});
|
||||
qaTools.httpPostRequest(litmus.baseURL+'json.cgi', qs, callback);
|
||||
},
|
||||
postResultXML : function(xml, callback, errback) {
|
||||
var qs = queryString({ data: xml});
|
||||
var fake_callback = function(resp) {
|
||||
// only call callback() if we really had a sucuess. XML
|
||||
// processing errors should result in a call to errback()
|
||||
if ((/^ok/i).exec(resp.responseText)) {
|
||||
callback(resp);
|
||||
} else {
|
||||
errback(resp);
|
||||
}
|
||||
};
|
||||
qaTools.httpPostRequest(litmus.baseURL+'process_test.cgi',
|
||||
qs, fake_callback, errback);
|
||||
},
|
||||
|
||||
currentSubgroupID: null,
|
||||
|
||||
writeStateToPref : function(testrunSummary, testgroupSummary, subgroupID, index) {
|
||||
qaPref.setPref(qaPref.prefBase + ".currentTestcase.testrunSummary", testrunSummary, "char");
|
||||
qaPref.setPref(qaPref.prefBase + ".currentTestcase.testgroupSummary", testgroupSummary, "char");
|
||||
qaPref.setPref(qaPref.prefBase + ".currentTestcase.subgroupId", subgroupID, "int");
|
||||
qaPref.setPref(qaPref.prefBase + ".currentTestcase.testcaseIndex", index, "int");
|
||||
},
|
||||
readStateFromPref : function() {
|
||||
$("qa-testrun-label").label = qaPref.getPref(qaPref.prefBase + ".currentTestcase.testrunSummary", "char");
|
||||
$("qa-testgroup-label").value = qaPref.getPref(qaPref.prefBase + ".currentTestcase.testgroupSummary", "char");
|
||||
litmus.currentSubgroupID = qaPref.getPref(qaPref.prefBase + ".currentTestcase.subgroupId", "int");
|
||||
litmus.disableAll();
|
||||
|
||||
if (litmus.currentSubgroupID != 0)
|
||||
litmus.getSubgroup(litmus.currentSubgroupID, function(subgroup) {litmus.statePopulateFields(subgroup); litmus.undisableAll();});
|
||||
},
|
||||
loadStats : function() {
|
||||
// pull new user statistics from litmus
|
||||
var url = litmus.baseURL+'json.cgi?' + 'user_stats=' + qaPref.litmus.getUsername();
|
||||
var req = loadJSONDoc(url);
|
||||
req.addCallback(function(data) {
|
||||
litmus.userStats = data;
|
||||
litmus.displayStats();
|
||||
});
|
||||
},
|
||||
displayStats : function() {
|
||||
var statbox = $('qa-litmus-stats');
|
||||
if (litmus.userStats != '') {
|
||||
var statline = qaMain.bundle.getFormattedString('qa.extension.litmus.stats',
|
||||
[litmus.userStats.week, litmus.userStats.month, litmus.userStats.alltime]);
|
||||
statbox.value = statline;
|
||||
}
|
||||
},
|
||||
checkRadioButtons : function() {
|
||||
var menu = document.getElementById('testlist');
|
||||
if (menu.selectedIndex == -1) return;
|
||||
var disable = menu.selectedItem.firstChild.getAttribute("checked");
|
||||
document.getElementById("qa-testcase-result").disabled = disable;
|
||||
},
|
||||
|
||||
prevButton : function() {
|
||||
$("testlist").selectedIndex--;
|
||||
},
|
||||
nextButton: function() {
|
||||
// if they selected a result, then submit the result
|
||||
if ($('qa-testcase-result').selectedItem) {
|
||||
litmus.submitResult();
|
||||
}
|
||||
$("testlist").selectedIndex++;
|
||||
},
|
||||
handleSelect : function() {
|
||||
if ($("testlist").selectedIndex == -1)
|
||||
return;
|
||||
|
||||
litmus.disableAll();
|
||||
litmus.getTestcase($("testlist").selectedItem.value, function(testcase) {
|
||||
litmus.populateTestcase(testcase);
|
||||
$('qa-testcase-progress').label =
|
||||
qaMain.bundle.getFormattedString('qa.extension.litmus.progress',
|
||||
[$("testlist").selectedIndex+1, $("testlist").getRowCount()]);
|
||||
litmus.undisableAll();
|
||||
});
|
||||
},
|
||||
populatePreviewBox : function(testcases) {
|
||||
|
||||
var menu = document.getElementById('testlist');
|
||||
if (!menu) return;
|
||||
|
||||
while (menu.firstChild) { // clear menu
|
||||
menu.removeChild(menu.firstChild);
|
||||
};
|
||||
|
||||
for (var i = 0; i < testcases.length; i++) {
|
||||
var row = document.createElement("richlistitem");
|
||||
row.value = testcases[i].testcase_id;
|
||||
|
||||
var checkbox = document.createElement("listcell");
|
||||
checkbox.setAttribute("label", "");
|
||||
checkbox.setAttribute("type", "checkbox");
|
||||
checkbox.setAttribute("disabled", "true");
|
||||
|
||||
var name = document.createElement("listcell");
|
||||
name.setAttribute("label", (i+1) + " -- " + testcases[i].summary);
|
||||
name.setAttribute("crop", "end");
|
||||
name.setAttribute("flex", "1");
|
||||
|
||||
row.appendChild(checkbox);
|
||||
row.appendChild(name);
|
||||
menu.appendChild(row);
|
||||
}
|
||||
|
||||
},
|
||||
populateTestcase : function(testcase) {
|
||||
litmus.lastTestcaseObject = testcase;
|
||||
if (testcase == undefined) {
|
||||
return;
|
||||
}
|
||||
document.getElementById('qa-testcase-id').value = "(" +
|
||||
qaMain.bundle.getString("qa.extension.testcase.head")+testcase.testcase_id + ")";
|
||||
document.getElementById('qa-testcase-summary').value = testcase.summary;
|
||||
|
||||
qaTools.writeSafeHTML('qa-testcase-steps', testcase.steps_formatted);
|
||||
qaTools.writeSafeHTML('qa-testcase-expected', testcase.expected_results_formatted);
|
||||
|
||||
qaTools.assignLinkHandlers($('qa-testcase-steps'));
|
||||
qaTools.assignLinkHandlers($('qa-testcase-expected'));
|
||||
|
||||
if (testcase.regression_bug_id) {
|
||||
bugzilla.loadBug(testcase.regression_bug_id);
|
||||
} else {
|
||||
var bugarray = bugzilla.findBugzillaLinks($("qa-testcase-expected"));
|
||||
if (bugarray.length) {
|
||||
bugzilla.loadBug(bugarray[0]);
|
||||
for (var i = 1; i < bugarray.length; i++) {
|
||||
bugzilla.loadBug(bugarray[i], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
litmus.checkRadioButtons();
|
||||
},
|
||||
populateFields : function(subgroup) {
|
||||
litmus.lastSubgroupObject = subgroup;
|
||||
litmus.populatePreviewBox(subgroup.testcases);
|
||||
$('qa-subgroup-label').value = subgroup.name;
|
||||
$("testlist").selectedIndex = 0;
|
||||
},
|
||||
statePopulateFields : function(subgroup) { //TODO: there's gotta be a better way to do this...
|
||||
litmus.lastSubgroupObject = subgroup;
|
||||
litmus.populatePreviewBox(subgroup.testcases);
|
||||
$('qa-subgroup-label').value = subgroup.name;
|
||||
|
||||
$("testlist").selectedIndex = qaPref.getPref(qaPref.prefBase + ".currentTestcase.testcaseIndex", "int");
|
||||
},
|
||||
disableAll : function() { //
|
||||
$("testlist").disabled = true;
|
||||
$("qa-testcase-result").disabled = true;
|
||||
$("qa-mainwindow-previousButton").disabled = true;
|
||||
$("qa-mainwindow-nextButton").disabled = true;
|
||||
|
||||
},
|
||||
undisableAll : function() {
|
||||
if(litmus.dialogActive) return; // ignore all requests while there is a dialog open
|
||||
|
||||
$("testlist").disabled = false;
|
||||
$("qa-testcase-result").disabled = false;
|
||||
$("qa-mainwindow-previousButton").disabled = false;
|
||||
$("qa-mainwindow-nextButton").disabled = false;
|
||||
|
||||
},
|
||||
submitResult : function() {
|
||||
var rs;
|
||||
var item = $('qa-testcase-result').selectedItem;
|
||||
if (item.id == "qa-testcase-pass") {
|
||||
rs = 'Pass';
|
||||
} else if (item.id == "qa-testcase-fail") {
|
||||
rs = 'Fail';
|
||||
} else if (item.id == "qa-testcase-unclearBroken") {
|
||||
rs = 'Test unclear/broken';
|
||||
} else {
|
||||
// no result selected, so don't submit anything for thes test:
|
||||
return false;
|
||||
}
|
||||
|
||||
var menu = document.getElementById('testlist');
|
||||
|
||||
var l = new LitmusResults({username: qaPref.litmus.getUsername(),
|
||||
password: qaPref.litmus.getPassword(),
|
||||
server: litmus.baseURL});
|
||||
l.sysconfig(new Sysconfig());
|
||||
|
||||
l.addResult(new Result({
|
||||
testid: menu.selectedItem.value,
|
||||
resultstatus: rs,
|
||||
exitstatus: 'Exited Normally',
|
||||
duration: 0,
|
||||
comment: $('qa-testcase-comment').value,
|
||||
isAutomatedResult: 0
|
||||
}));
|
||||
|
||||
var callback = function(resp) {
|
||||
// increment the stat counters:
|
||||
for (var i in litmus.userStats) {
|
||||
litmus.userStats[i]++;
|
||||
}
|
||||
litmus.displayStats();
|
||||
};
|
||||
|
||||
var errback = function(resp) {
|
||||
dump(resp.responseText);
|
||||
};
|
||||
|
||||
litmus.postResultXML(l.toXML(), callback, errback);
|
||||
var item = menu.selectedItem;
|
||||
item.firstChild.setAttribute("checked", "true");
|
||||
return false; // ?? Got rid of strict warning...
|
||||
}
|
||||
};
|
||||
|
||||
// any missing fields will be autodetected
|
||||
function Sysconfig(aProduct, aPlatform, aOpsys, aBranch, aBuildid, aLocale) {
|
||||
this._load('product', aProduct);
|
||||
this._load('platform', aPlatform);
|
||||
this._load('opsys', aOpsys);
|
||||
this._load('branch', aBranch);
|
||||
this._load('buildid', aBuildid);
|
||||
this._load('locale', aLocale);
|
||||
this.populate();
|
||||
}
|
||||
|
||||
Sysconfig.prototype = {
|
||||
product: null,
|
||||
platform: null,
|
||||
opsys: null,
|
||||
branch: null,
|
||||
buildid: null,
|
||||
locale: null,
|
||||
|
||||
// set a field according to the following priorities:
|
||||
// 1. 'setting'
|
||||
// 2. qa.extension.sysconfig.fieldname
|
||||
// 3. null
|
||||
_load: function(fieldname, setting) {
|
||||
if (this[fieldname]) { return }
|
||||
if (setting) {
|
||||
this[fieldname] = setting;
|
||||
return;
|
||||
}
|
||||
var pref = qaPref.getPref(qaPref.prefBase+'.sysconfig.'+fieldname, 'char');
|
||||
if (pref) {
|
||||
this[fieldname] = pref;
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
// if something cannot be autodetected, an exception is thrown
|
||||
// with the name of the missing field
|
||||
populate: function() {
|
||||
var appinfo = Components.classes["@mozilla.org/xre/app-info;1"]
|
||||
.getService(Components.interfaces.nsIXULAppInfo);
|
||||
|
||||
// build id:
|
||||
this.buildid = appinfo.appBuildID;
|
||||
if (! this.buildid) { throw "buildid" }
|
||||
|
||||
// product:
|
||||
if (! this.product) {
|
||||
if (appinfo.ID == FIREFOX_ID) {
|
||||
this.product = 'Firefox';
|
||||
}
|
||||
if (! this.product) { throw "product" }
|
||||
}
|
||||
|
||||
// branch:
|
||||
// people switch branches, so we detect this even though it might
|
||||
// already be set in a pref
|
||||
if ((/^3\.0/).exec(appinfo.version)) {
|
||||
this.branch = '3.0 Branch';
|
||||
} else if ((/^2\.0/).exec(appinfo.version)) {
|
||||
this.branch = '2.0 Branch';
|
||||
} else if ((/^1\.5\./).exec(appinfo.version)) {
|
||||
this.branch = '1.5 Branch';
|
||||
}
|
||||
if (! this.branch) { throw "branch" }
|
||||
|
||||
// platform:
|
||||
if (! this.platform) {
|
||||
if ((/^MacPPC/).exec(navigator.platform)) {
|
||||
this.platform = 'Mac (PPC)';
|
||||
} else if ((/^MacIntel/).exec(navigator.platform)) {
|
||||
this.platform = 'Mac (Intel)';
|
||||
} else if ((/^Win/).exec(navigator.platform)) {
|
||||
this.platform = 'Windows';
|
||||
} else if ((/^Linux/).exec(navigator.platform)) {
|
||||
this.platform = 'Linux';
|
||||
} else if ((/^Solaris/).exec(navigator.platform)) {
|
||||
this.platform = 'Solaris';
|
||||
}
|
||||
if (! this.platform) { throw "platform" }
|
||||
}
|
||||
// opsys
|
||||
if (this.platform == 'Windows') {
|
||||
switch (navigator.oscpu) {
|
||||
case 'Windows NT 5.1':
|
||||
this.opsys = 'Windows XP';
|
||||
break;
|
||||
case 'Windows NT 5.2':
|
||||
this.opsys = 'Windows XP';
|
||||
break;
|
||||
case 'Windows NT 6.0':
|
||||
this.opsys = 'Windows Vista';
|
||||
break;
|
||||
case 'Windows NT 5.0':
|
||||
this.opsys = 'Windows 2000';
|
||||
break;
|
||||
case 'Win 9x 4.90':
|
||||
this.opsys = 'Windows ME';
|
||||
break;
|
||||
case 'Win98':
|
||||
this.opsys = 'Windows 98';
|
||||
break;
|
||||
}
|
||||
} else if (this.platform == 'Linux') {
|
||||
this.opsys = 'Linux';
|
||||
} else if (this.platform == 'Mac (PPC)' || this.platform == 'Mac (Intel)') {
|
||||
// no way to detect the OS on mac, so just assume
|
||||
// it's 10.4. The user can provide the real OS in setup
|
||||
this.opsys = 'Mac OS 10.4';
|
||||
}
|
||||
if (! this.opsys) {throw "opsys" }
|
||||
|
||||
// locale
|
||||
this.locale = navigator.language;
|
||||
if (!this.locale) { throw "locale" }
|
||||
}
|
||||
};
|
@ -1,207 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
// Generate XML result data and submit it to Litmus
|
||||
|
||||
// Note that this is essentially a direct port of the Test::Litmus perl
|
||||
// module. Please see http://search.cpan.org/~zlipton/Test-Litmus-0.03/lib/Test/Litmus.pm
|
||||
// for further information
|
||||
|
||||
// See also the Litmus Web Services Specification at
|
||||
// http://wiki.mozilla.org/Litmus:Web_Services
|
||||
|
||||
const VERSION = '0.0.2';
|
||||
|
||||
/**
|
||||
* Result constructor.
|
||||
*
|
||||
* @param machinename
|
||||
* (optional)
|
||||
* The name of the machine running the tests
|
||||
* @param username
|
||||
* Username of the account submitting results
|
||||
* @param password
|
||||
* Authentication token to be sent to the Litmus server
|
||||
* @param server
|
||||
* (optional)
|
||||
* The server to send results to
|
||||
*/
|
||||
function LitmusResults(a) {
|
||||
this.machinename = a.machinename || '';
|
||||
this.requireField('username', a);
|
||||
this.requireField('password', a);
|
||||
this.server = a.server || 'https://litmus.mozilla.org/process_test.cgi';
|
||||
this.action = 'submit';
|
||||
|
||||
this.results = new Array();
|
||||
this.logs = new Array();
|
||||
}
|
||||
|
||||
LitmusResults.prototype = {
|
||||
// add fieldname to this unless it's missing, at which point we throw an
|
||||
// exception to the caller
|
||||
requireField : function (name, args) {
|
||||
if (args[name] === undefined) {
|
||||
throw "Missing required field in Litmus result submission: "+name;
|
||||
}
|
||||
this[name] = args[name];
|
||||
},
|
||||
sysconfig : function (a) {
|
||||
this.requireField('product', a);
|
||||
this.requireField('platform', a);
|
||||
this.requireField('opsys', a);
|
||||
this.requireField('branch', a);
|
||||
this.requireField('buildid', a);
|
||||
this.requireField('locale', a);
|
||||
this.buildtype = a.buildtype;
|
||||
},
|
||||
addLog : function(log) {
|
||||
this.logs.push(log);
|
||||
},
|
||||
addResult : function(result) {
|
||||
this.results.push(result);
|
||||
},
|
||||
toXML : function() {
|
||||
var d = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'+"\n";
|
||||
d += '<!DOCTYPE litmusresults PUBLIC' +
|
||||
' "-//Mozilla Corporation//Litmus Result Submission DTD//EN/"' +
|
||||
' "https://litmus.mozilla.org/litmus_results.dtd">'+"\n";
|
||||
d += '<litmusresults action="'+this.action+'" useragent="'+
|
||||
'litmusReporter.js/'+VERSION+' ('+this.machinename+')" '+
|
||||
(this.machinename ? 'machinename="'+this.machinename+'">' : '>') +"\n";
|
||||
d += ' <testresults username="'+this.username+'"'+"\n";
|
||||
d += ' authtoken="'+this.password+'"'+"\n";
|
||||
d += ' product="'+this.product+'"'+"\n";
|
||||
d += ' platform="'+this.platform+'"'+"\n";
|
||||
d += ' opsys="'+this.opsys+'"'+"\n";
|
||||
d += ' branch="'+this.branch+'"'+"\n";
|
||||
d += ' buildid="'+this.buildid+'"'+"\n";
|
||||
d += ' locale="'+this.locale+'"';
|
||||
if (this.buildtype) {
|
||||
d += "\n"+' buildtype="'+this.buildtype+'"'+">\n";
|
||||
} else {
|
||||
d += ">\n";
|
||||
}
|
||||
if (this.logs) {
|
||||
if (this.logs instanceof Array) {
|
||||
for(var i=0; i<this.logs.length; i++) {
|
||||
if (this.logs[i] instanceof Log) {
|
||||
d += this.logs[i].toXML();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.logs instanceof Log) {
|
||||
d += this.logs.toXML();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.results) {
|
||||
for(var i=0; i<this.results.length; i++) {
|
||||
d += this.results[i].toXML();
|
||||
}
|
||||
}
|
||||
d += ' </testresults>'+"\n";
|
||||
d += '</litmusresults>'+"\n";
|
||||
return d;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Log constructor.
|
||||
*
|
||||
* @param type
|
||||
* The log type
|
||||
* @param data
|
||||
* The log data to submit
|
||||
*/
|
||||
function Log(a) {
|
||||
this.requireField('type', a);
|
||||
this.requireField('data', a);
|
||||
}
|
||||
|
||||
Log.prototype = {
|
||||
type: null,
|
||||
data: null,
|
||||
requireField : function (name, args) {
|
||||
if (args[name] === undefined) {
|
||||
throw "Missing required field in Litmus result submission: "+name;
|
||||
}
|
||||
this[name] = args[name];
|
||||
},
|
||||
toXML : function () {
|
||||
var d = '<log logtype="'+this.type+'">'+"\n";
|
||||
d += ' <![CDATA['+this.data+']]>'+"\n";
|
||||
d += '</log>'+"\n";
|
||||
return d;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Result constructor.
|
||||
*
|
||||
*/
|
||||
function Result(a) {
|
||||
this.requireField('testid', a);
|
||||
this.requireField('resultstatus', a);
|
||||
this.requireField('exitstatus', a);
|
||||
this.requireField('duration', a);
|
||||
|
||||
// if no timestamp specified, use the current time
|
||||
if (a.timestamp) { this.timestamp = a.timestamp; }
|
||||
else {
|
||||
var d = new Date();
|
||||
this.timestamp=''+d.getFullYear()+leadZero((d.getMonth()+1))+
|
||||
leadZero(d.getDate())+leadZero(d.getHours())+leadZero(d.getMinutes())+
|
||||
leadZero(d.getSeconds());
|
||||
}
|
||||
|
||||
this.comment = a.comment;
|
||||
this.bugnumber = a.bugnumber;
|
||||
this.logs = a.log;
|
||||
this.automated = a.isAutomatedResult ? a.isAutomatedResult : 1;
|
||||
}
|
||||
|
||||
Result.prototype = {
|
||||
requireField : function (name, args) {
|
||||
if (args[name] === undefined) {
|
||||
throw "Missing required field in Litmus result submission: "+name;
|
||||
}
|
||||
this[name] = args[name];
|
||||
},
|
||||
toXML : function() {
|
||||
var d = '<result testid="'+this.testid+'"'+"\n";
|
||||
d += ' is_automated_result="'+this.automated+'"'+"\n";
|
||||
d += ' resultstatus="'+this.resultstatus+'"'+"\n";
|
||||
d += ' exitstatus="'+this.exitstatus+'"'+"\n";
|
||||
d += ' duration="'+this.duration+'"'+"\n";
|
||||
d += ' timestamp="'+this.timestamp+'">'+"\n";
|
||||
|
||||
if (this.comment) {
|
||||
d += ' <comment>'+this.comment+'</comment>'+"\n";
|
||||
}
|
||||
|
||||
if (this.bugnumber) {
|
||||
d += ' <bugnumber>'+this.bugnumber+'</bugnumber>'+"\n";
|
||||
}
|
||||
if (this.logs) {
|
||||
if (this.logs instanceof Array) {
|
||||
for(var i=0; i<this.logs.length; i++) {
|
||||
if (this.logs[i] instanceof Log) {
|
||||
d += this.logs[i].toXML();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.logs instanceof Log) {
|
||||
d += this.logs.toXML();
|
||||
}
|
||||
}
|
||||
}
|
||||
d += '</result>'+"\n";
|
||||
return d;
|
||||
}
|
||||
};
|
||||
|
||||
function leadZero(num) {
|
||||
if (num.toString().length == 1) { return '0'+num }
|
||||
return num;
|
||||
}
|
@ -1,242 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
document.addEventListener('load', function() {
|
||||
window.setInterval(qaNotifications.updateNotificationStore(), 3600000);
|
||||
}, false)
|
||||
|
||||
var qaNotifications = {
|
||||
storageService : Components.classes["@mozilla.org/storage/service;1"]
|
||||
.getService(Ci.mozIStorageService),
|
||||
dbHandle : null,
|
||||
|
||||
openDatabase : function() {
|
||||
var file = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
.get("ProfD", Ci.nsIFile);
|
||||
file.append("mozqa.sqlite");
|
||||
this.dbHandle = this.storageService.openDatabase(file);
|
||||
this.createNotificationTable();
|
||||
},
|
||||
|
||||
closeDatabase : function() {
|
||||
// there's no way to actually close a database, but setting
|
||||
// the db reference to null will cause the db handle to become
|
||||
// elegible for GC which is about as good as it gets
|
||||
dbHandle = null;
|
||||
},
|
||||
|
||||
createNotificationTable : function() {
|
||||
this.db.executeSimpleSQL("CREATE TABLE if not exists notifications ( \
|
||||
id text, \
|
||||
datetime integer, \
|
||||
firstNotification integer, \
|
||||
secondNotification integer, \
|
||||
serializedJSData string)");
|
||||
},
|
||||
|
||||
updateNotificationStore : function() {
|
||||
var req = new XMLHttpRequest();
|
||||
var url = qaPref.getPref('qa.extension.hermes.url', 'char');
|
||||
req.open('GET', url, true);
|
||||
req.onreadystatechange = function(evt) {
|
||||
if (req.readyState == 4 && req.status == 200) {
|
||||
if (req.responseXML.getElementsByTagName('notifications') == null)
|
||||
return;
|
||||
var notifs = req.responseXML.getElementsByTagName('notification');
|
||||
for (var i=0; i<notifs.length; i++) {
|
||||
var notif = notifs[i];
|
||||
notif = new Notification('xml', notif);
|
||||
notif.serializeToDb();
|
||||
}
|
||||
}
|
||||
};
|
||||
req.send(null);
|
||||
},
|
||||
|
||||
checkNotificationStatus : function() {
|
||||
// see if we are elegible for notification:
|
||||
var time = qaPref.getPref(qaPref.prefBase+'.lastNotificationCheckTime', 'int');
|
||||
var interval = qaPref.getPref(qaPref.prefBase+'.minNotificationCheckInterval', 'int');
|
||||
if (time + interval > new Date().valueOf())
|
||||
return; // nothing to see here, try again later
|
||||
|
||||
var sth = this.db.createStatement("SELECT * FROM notifications");
|
||||
var notifications = [];
|
||||
try {
|
||||
while (sth.executeStep()) {
|
||||
notifications.push(new Notification('json', MochiKit.Base.evalJSON(
|
||||
sth.getString(4))));
|
||||
}
|
||||
} finally {
|
||||
sth.reset();
|
||||
}
|
||||
|
||||
if (notifications[0] && notifications[0].okToShow() == true) {
|
||||
notifications[0].displayToBox();
|
||||
$('qa-notify').removeAttribute('hidden');
|
||||
}
|
||||
// reset the interval timer
|
||||
qaPref.setPref(qaPref.prefBase+'.lastNotificationCheckTime', new Date().valueOf(), 'int');
|
||||
},
|
||||
|
||||
showHideNotify: function(bool) {
|
||||
var notify = $('qa-notify');
|
||||
if (bool == true) {
|
||||
notify.removeAttribute("hidden");
|
||||
} else {
|
||||
notify.setAttribute("hidden", "true");
|
||||
}
|
||||
},
|
||||
|
||||
getNotificationSettings : function(bool) {
|
||||
var prefs = qaPref.getPref(qaPref.prefBase+'.notificationSettings', 'char');
|
||||
return prefs.split(",");
|
||||
},
|
||||
};
|
||||
qaNotifications.__defineGetter__('db', function() {
|
||||
if (this.dbHandle != null)
|
||||
return this.dbHandle;
|
||||
else {
|
||||
this.openDatabase();
|
||||
return this.dbHandle;
|
||||
}
|
||||
});
|
||||
|
||||
function Notification() {
|
||||
|
||||
}
|
||||
|
||||
function Notification(type, data) {
|
||||
if (type == 'json') {
|
||||
this.id = data.id;
|
||||
this.notificationClass = data.notificationClass;
|
||||
this.type = data.type;
|
||||
this.headline = data.headline;
|
||||
this.datetime = MochiKit.DateTime.isoTimestamp(data.datetime);
|
||||
this.place = data.place;
|
||||
this.infotext = data.infotext;
|
||||
this.infolinktext = data.infolinktext;
|
||||
this.infolinkhref = data.infolinkhref;
|
||||
this.golinktext = data.golinktext;
|
||||
this.golinkhref = data.golinkhref;
|
||||
} else if (type == 'xml') {
|
||||
var notif = data;
|
||||
this.id = notif.getAttribute('id');
|
||||
this.notificationClass = notif.getAttribute('class');
|
||||
this.type = notif.getAttribute('type');
|
||||
if (notif.getElementsByTagName('headline')[0] != null)
|
||||
this.headline = notif.getElementsByTagName('headline')[0].textContent;
|
||||
|
||||
// eventinfo
|
||||
if (this.notificationClass == 'event') {
|
||||
var eventInfo = notif.getElementsByTagName('eventinfo')[0];
|
||||
this.datetime = MochiKit.DateTime.isoTimestamp(
|
||||
eventInfo.getElementsByTagName('datetime')[0].textContent);
|
||||
this.place = eventInfo.getElementsByTagName('place')[0].textContent;
|
||||
}
|
||||
this.infotext = notif.getElementsByTagName('infotext')[0].textContent;
|
||||
this.infolinktext = notif.getElementsByTagName('infolink')[0].textContent;
|
||||
this.infolinkhref = notif.getElementsByTagName('infolink')[0]
|
||||
.getAttribute('href');
|
||||
this.golinktext = notif.getElementsByTagName('golink')[0].textContent;
|
||||
this.golinkhref = notif.getElementsByTagName('golink')[0]
|
||||
.getAttribute('href');
|
||||
}
|
||||
}
|
||||
|
||||
Notification.prototype = {
|
||||
id : null,
|
||||
notificationClass : null,
|
||||
type : null,
|
||||
headline : null,
|
||||
datetime : null,
|
||||
place : null,
|
||||
infotext : null,
|
||||
infolinktext : null,
|
||||
infolinkhref : null,
|
||||
golinktext : null,
|
||||
golinkhref : null,
|
||||
|
||||
hasHadFirstNotification : false,
|
||||
hasHadSecondNotification : false,
|
||||
serializedJSData : null,
|
||||
|
||||
serializeToDb: function() {
|
||||
var query = qaNotifications.db.createStatement("SELECT id FROM notifications \
|
||||
WHERE id = ?1");
|
||||
query.bindStringParameter(0, this.id);
|
||||
var foundRow;
|
||||
while (query.executeStep()) {
|
||||
foundRow = 1;
|
||||
}
|
||||
query.reset();
|
||||
if (foundRow == 1) { // it's already been inserted, so update
|
||||
return;
|
||||
}
|
||||
|
||||
var sth = qaNotifications.db.createStatement("INSERT into notifications \
|
||||
values (?1, ?2, ?3, ?4, ?5)");
|
||||
sth.bindStringParameter(0, this.id);
|
||||
sth.bindStringParameter(1, this.datetime);
|
||||
sth.bindStringParameter(2, this.hasHadFirstNotification);
|
||||
sth.bindStringParameter(3, this.hasHadSecondNotification);
|
||||
|
||||
// avoid having serialized data inside serialized data:
|
||||
this.serializedJSData = null;
|
||||
var jsData = MochiKit.Base.serializeJSON(this);
|
||||
sth.bindStringParameter(4, jsData);
|
||||
|
||||
sth.execute();
|
||||
},
|
||||
displayToBox : function() {
|
||||
$('qa-notify-header').value=this.headline;
|
||||
|
||||
if ($('qa-notify-text').firstChild)
|
||||
$('qa-notify-text').removeChild($('qa-notify-text').firstChild);
|
||||
$('qa-notify-text').appendChild(document.createTextNode(this.infotext));
|
||||
|
||||
$('qa-notify-infolink').value=this.infolinktext;
|
||||
$('qa-notify-infolink').href=this.infolinkhref;
|
||||
$('qa-notify-infolink').style.display = '';
|
||||
|
||||
if (this.notificationClass == 'event') {
|
||||
var inprogress = 0;
|
||||
$('qa-notify-event-datetime').value=this.datetime;
|
||||
$('qa-notify-event-place').value=this.place;
|
||||
$('qa-notify-event').style.display = '';
|
||||
$('qa-notify-inprogress').style.display = 'none';
|
||||
|
||||
$('qa-notify-getstartedlink').value=this.golinktext;
|
||||
$('qa-notify-getstartedlink').href=this.golinkhref;
|
||||
|
||||
if (inprogress == 1) {
|
||||
$('qa-notify-inprogress').style.display = '';
|
||||
$('qa-notify-getstartedlink').style.display = '';
|
||||
$('qa-notify-infolink').style.display = 'none';
|
||||
}
|
||||
}
|
||||
},
|
||||
okToShow : function() {
|
||||
var prefs = qaNotifications.getNotificationSettings();
|
||||
if (prefs[0] == '1') // all notifications disabled
|
||||
return false;
|
||||
if (this.type == 'testday' && ! prefs[1] == '0')
|
||||
return true;
|
||||
if (this.type == 'bugday' && ! prefs[2] == '0')
|
||||
return true;
|
||||
if (this.type == 'prerelease' && ! prefs[3] == '0')
|
||||
return true;
|
||||
if (this.type == 'news' && ! prefs[4] == '0')
|
||||
return true;
|
||||
if (this.type == 'newbuilds' && ! prefs[5] == '0')
|
||||
return true;
|
||||
if (this.type == 'special' && ! prefs[6] == '0')
|
||||
return true;
|
||||
|
||||
// catch all:
|
||||
return false;
|
||||
}
|
||||
};
|
@ -1,167 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
var qaPref = {
|
||||
litmus : null,
|
||||
prefBase : "qa.extension",
|
||||
|
||||
setPref : function(aName, aValue, aType) {
|
||||
|
||||
var pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
try{
|
||||
if(aType == "bool")
|
||||
pref.setBoolPref(aName, aValue);
|
||||
else if(aType == "int")
|
||||
pref.setIntPref(aName, aValue);
|
||||
else if(aType == "char")
|
||||
pref.setCharPref(aName, aValue);
|
||||
}
|
||||
catch(e){ };
|
||||
},
|
||||
|
||||
getPref : function(aName, aType) {
|
||||
|
||||
var pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
try{
|
||||
var result;
|
||||
if(aType == "bool")
|
||||
result = pref.getBoolPref(aName);
|
||||
else if(aType == "int")
|
||||
result = pref.getIntPref(aName);
|
||||
else if(aType == "char")
|
||||
result = pref.getCharPref(aName);
|
||||
|
||||
return result;
|
||||
}
|
||||
catch(e){
|
||||
if(aType == "bool"){
|
||||
return false;
|
||||
}
|
||||
else if(aType == "int"){
|
||||
return 0;
|
||||
}
|
||||
else if(aType == "char"){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
// public API:
|
||||
// qaPref.litmus.getUsername()
|
||||
// qaPref.litmus.getPassword()
|
||||
// qaPref.litmus.setPassword()
|
||||
// everything else is abstracted away to deal with fx2 vs fx3 changes
|
||||
|
||||
var CC_passwordManager = Components.classes["@mozilla.org/passwordmanager;1"];
|
||||
var CC_loginManager = Components.classes["@mozilla.org/login-manager;1"];
|
||||
|
||||
if (CC_passwordManager != null) { // old-fashioned password manager
|
||||
qaPref.litmus = {
|
||||
passwordName : function() {return "mozqa-extension-litmus-"+litmus.baseURL},
|
||||
|
||||
manager : function() {
|
||||
return Components.classes["@mozilla.org/passwordmanager;1"].
|
||||
getService(Components.interfaces.nsIPasswordManager);
|
||||
},
|
||||
getPasswordObj : function() {
|
||||
var m = this.manager();
|
||||
var e = m.enumerator;
|
||||
|
||||
// iterate through the PasswordManager service to find
|
||||
// our password:
|
||||
var password;
|
||||
while(e.hasMoreElements()) {
|
||||
try {
|
||||
var pass = e.getNext().
|
||||
QueryInterface(Components.interfaces.nsIPassword);
|
||||
if (pass.host == this.passwordName()) {
|
||||
password=pass; // found it
|
||||
return password;
|
||||
}
|
||||
} catch (ex) { return false; }
|
||||
}
|
||||
if (!password) { return false; }
|
||||
return password;
|
||||
},
|
||||
getUsername : function() {
|
||||
var password = this.getPasswordObj();
|
||||
try {
|
||||
return password.user;
|
||||
} catch (ex) { return false; }
|
||||
},
|
||||
getPassword : function() {
|
||||
var password=this.getPasswordObj();
|
||||
try {
|
||||
return password.password;
|
||||
} catch (ex) { return false; }
|
||||
},
|
||||
setPassword : function(username, password) {
|
||||
var m = this.manager();
|
||||
// check to see whether we already have a password stored
|
||||
// for the current baseURL. If we do, remove it before adding
|
||||
// any new passwords:
|
||||
var p;
|
||||
while (p == this.getPasswordObj()) {
|
||||
m.removeUser(p.host, p.user);
|
||||
}
|
||||
m.addUser(this.passwordName(), username, password);
|
||||
}
|
||||
};
|
||||
} else if (CC_loginManager != null) { // use the new login manager interface
|
||||
qaPref.litmus = {
|
||||
manager : function() {
|
||||
return Components.classes["@mozilla.org/login-manager;1"]
|
||||
.getService(Components.interfaces.nsILoginManager);
|
||||
},
|
||||
getUsername : function() {
|
||||
var password = this.getPasswordObj();
|
||||
try {
|
||||
return password.username;
|
||||
} catch (ex) { return false; }
|
||||
},
|
||||
getPassword : function() {
|
||||
var password=this.getPasswordObj();
|
||||
try {
|
||||
return password.password;
|
||||
} catch (ex) { return false; }
|
||||
},
|
||||
setPassword : function(username, password) {
|
||||
// if we already have a password stored, remove it first:
|
||||
var login = this.getPasswordObj();
|
||||
if (login != false) {
|
||||
this.manager().removeLogin(login);
|
||||
}
|
||||
|
||||
var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
|
||||
Components.interfaces.nsILoginInfo,
|
||||
"init");
|
||||
|
||||
// The LoginManager does not like "null" for username/password fields,
|
||||
// So we send in the field names from the XUL.
|
||||
var newLogin = new nsLoginInfo('chrome://qa', null, litmus.baseURL,
|
||||
username, password, "username", "password");
|
||||
try {
|
||||
this.manager().addLogin(newLogin);
|
||||
} catch (err) {
|
||||
alert("ERROR: " + err);
|
||||
}
|
||||
},
|
||||
getPasswordObj: function() {
|
||||
try {
|
||||
var logins = this.manager().findLogins({}, 'chrome://qa',
|
||||
null, litmus.baseURL);
|
||||
if (logins.length > 0 && logins[0] != null)
|
||||
return logins[0];
|
||||
return false;
|
||||
} catch(ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
var qaMain = {
|
||||
htmlNS: "http://www.w3.org/1999/xhtml",
|
||||
|
||||
openQATool : function() {
|
||||
window.open("chrome://qa/content/qa.xul", "_blank",
|
||||
"chrome,all,dialog=no,resizable=yes");
|
||||
},
|
||||
onToolOpen : function() {
|
||||
if (qaPref.getPref(qaPref.prefBase+'.isFirstTime', 'bool') == true) {
|
||||
window.open("chrome://qa/content/setup.xul", "_blank",
|
||||
"chrome,all,dialog=yes");
|
||||
}
|
||||
else {
|
||||
// We need to log the user into litmus
|
||||
var storedLogin = qaPref.litmus.getPasswordObj();
|
||||
this.correctCredentials(storedLogin.username, storedLogin.password, false);
|
||||
}
|
||||
if (qaPref.getPref(qaPref.prefBase + '.currentTestcase.testrunSummary', 'char') != null) {
|
||||
litmus.readStateFromPref();
|
||||
}
|
||||
},
|
||||
onSwitchTab : function() {
|
||||
var newSelection = $('qa_tabrow').selectedItem;
|
||||
|
||||
// user is switching to the prefs tab:
|
||||
if ($('qa_tabrow').selectedItem == $('qa-tabbar-prefs')) {
|
||||
qaPrefsWindow.loadPrefsWindow();
|
||||
} else if ($('qa_tabrow').selectedItem == $('qa-tabbar-bugzilla')) {
|
||||
bugzilla.unhighlightTab();
|
||||
}
|
||||
|
||||
// user is switching away from the prefs tab:
|
||||
if (qaPrefsWindow.lastSelectedTab != null &&
|
||||
qaPrefsWindow.lastSelectedTab == $('qa-tabbar-prefs')) {
|
||||
qaPrefsWindow.savePrefsWindow();
|
||||
}
|
||||
|
||||
qaPrefsWindow.lastSelectedTab = newSelection;
|
||||
},
|
||||
|
||||
correctCredentials : function(username, password,isSecondTry) {
|
||||
var callback = function (resp) {
|
||||
if (resp.responseText == 0) {
|
||||
qaMain.doLogin(isSecondTry);
|
||||
} else {
|
||||
// Then we need to store our validated creds
|
||||
qaPref.litmus.setPassword(username, password);
|
||||
}
|
||||
}
|
||||
|
||||
// First we validate our stored login.
|
||||
litmus.validateLogin(username, password, callback);
|
||||
},
|
||||
|
||||
doLogin : function(isSecondTry) {
|
||||
try {
|
||||
var username = {value: "username"};
|
||||
var password = {value: "password"};
|
||||
var check = {value: "null"};
|
||||
var title = qaMain.bundle.getString("qa.getpassword.title");
|
||||
var msg = "";
|
||||
|
||||
if (!isSecondTry)
|
||||
msg = qaMain.bundle.getString("qa.getpassword.message");
|
||||
else
|
||||
msg = qaMain.bundle.getString("qa.getpassword.tryagainmessage");
|
||||
|
||||
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
var result = prompts.promptUsernameAndPassword(null, title, msg, username,
|
||||
password, null, check);
|
||||
|
||||
this.correctCredentials(username.value, password.value, true);
|
||||
} catch(ex) {
|
||||
alert("ERROR LOGGING IN: " + ex);
|
||||
dump("Error logging in: " + ex);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
qaMain.__defineGetter__("bundle", function(){return $("bundle_qa");});
|
||||
qaMain.__defineGetter__("urlbundle", function(){return $("bundle_urls");});
|
||||
function $() {
|
||||
var elements = new Array();
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = arguments[i];
|
||||
if (typeof element == 'string')
|
||||
element = document.getElementById(element);
|
||||
|
||||
if (arguments.length == 1)
|
||||
return element;
|
||||
|
||||
elements.push(element);
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
|
||||
- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://qa/skin/qa.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://qa/skin/platform.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<?xul-overlay href="chrome://qa/content/tabs/litmus.xul"?>
|
||||
<?xul-overlay href="chrome://qa/content/tabs/settings.xul"?>
|
||||
<?xul-overlay href="chrome://qa/content/tabs/qmo.xul"?>
|
||||
<?xul-overlay href="chrome://qa/content/tabs/chat.xul"?>
|
||||
<?xul-overlay href="chrome://qa/content/tabs/bugzilla.xul"?>
|
||||
<?xul-overlay href="chrome://qa/content/tabs/help.xul"?>
|
||||
|
||||
<window
|
||||
id="qa-mainwindow"
|
||||
title="&qa.mainwindow.title;"
|
||||
width="425px"
|
||||
height="750px"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
onload="qaMain.onToolOpen();">
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_qa" src="chrome://qa/locale/qa.properties" />
|
||||
<stringbundle id="bundle_urls" src="chrome://qa/locale/urls.properties" />
|
||||
</stringbundleset>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/litmusReporter.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/common.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/qa.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/tabs/qmo.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/tabs/bugzilla.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/tabs/bugAccess.js" />
|
||||
|
||||
<script type="application/x-javascript">
|
||||
|
||||
// on load, set an event listener to deal with saving settings when
|
||||
// changing tabs
|
||||
window.addEventListener('load', function() {
|
||||
$('qa_tabrow').addEventListener('select', qaMain.onSwitchTab, false);
|
||||
}, false);
|
||||
</script>
|
||||
|
||||
<tabbox id="qa_tabbox" flex="1" pack="start" >
|
||||
<tabs id="qa_tabrow">
|
||||
<tab id="qa-tabbar-qmo" class="tabbrowser-tab" />
|
||||
<tab label="&qa.litmus.title;" class="tabbrowser-tab" />
|
||||
<tab label="&qa.bugzilla.title;" id="qa-tabbar-bugzilla" class="tabbrowser-tab" />
|
||||
<tab label="&qa.chat.title;" class="tabbrowser-tab" />
|
||||
<spacer id="qa-tabbar-spacer"/>
|
||||
<tab label="&qa.preferences.title;" id="qa-tabbar-prefs" class="tabbrowser-tab" />
|
||||
<tab label="&qa.help.title;" class="tabbrowser-tab" />
|
||||
</tabs>
|
||||
<tabpanels id="qa_tabpanels" flex="1">
|
||||
<tabpanel id="qa-tab-qmo" flex="1"></tabpanel>
|
||||
<tabpanel id="qa-tab-litmus" flex="1"></tabpanel>
|
||||
<tabpanel id="qa-tab-bugzilla" flex="1"></tabpanel>
|
||||
<tabpanel id="qa-tab-chat" flex="1"></tabpanel>
|
||||
<tabpanel id="qa-tab-SPACER" flex="1"></tabpanel>
|
||||
<tabpanel id="qa-tab-settings" flex="1"></tabpanel>
|
||||
<tabpanel id="qa-tab-help" flex="1"></tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
@ -1,236 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
var qaPrefsWindow = {
|
||||
lastSelectedTab : null,
|
||||
|
||||
loadPrefsWindow : function() {
|
||||
prefsTabOpen = true;
|
||||
document.getElementById('qa-preferences-litmus-username').value =
|
||||
qaPref.litmus.getUsername() || '';
|
||||
document.getElementById('qa-preferences-litmus-password').value =
|
||||
qaPref.litmus.getPassword() || '';
|
||||
|
||||
// load notification settings:
|
||||
var prefs = qaPref.getPref(qaPref.prefBase+'.notificationSettings', 'char');
|
||||
prefs = prefs.split(",");
|
||||
var notify = $('qa-prefs-notify').childNodes;
|
||||
var prefCounter = 0;
|
||||
for (var i=0; i<notify.length; i++) {
|
||||
if (notify[i].setChecked != null && notify[i].checked != null) { // it's a checkbox
|
||||
if (prefs[prefCounter] == "1")
|
||||
notify[i].checked = true;
|
||||
else
|
||||
notify[i].checked = false;
|
||||
prefCounter++;
|
||||
}
|
||||
}
|
||||
},
|
||||
savePrefsWindow : function() {
|
||||
// save notification settings
|
||||
var notify = $('qa-prefs-notify').childNodes;
|
||||
var prefs = '';
|
||||
for (var i=0; i<notify.length; i++) {
|
||||
if (notify[i].setChecked != null && (notify[i].checked == true
|
||||
|| notify[i].checked == false)) { // it's a checkbox
|
||||
if (notify[i].checked == false)
|
||||
prefs += '0,';
|
||||
else
|
||||
prefs += '1,';
|
||||
}
|
||||
}
|
||||
prefs = prefs.substring(0, prefs.length-1); // remove the trailing comma
|
||||
qaPref.setPref(qaPref.prefBase+'.notificationSettings', prefs, 'char');
|
||||
|
||||
// save litmus account settings
|
||||
var uname = document.getElementById('qa-preferences-litmus-username').value;
|
||||
var passwd = document.getElementById('qa-preferences-litmus-password').value;
|
||||
|
||||
// if uname and passwd are unchanged, we're done:
|
||||
if (uname == qaPref.litmus.getUsername() &&
|
||||
passwd == qaPref.litmus.getPassword())
|
||||
return;
|
||||
var callback = function(resp) {
|
||||
if (resp.responseText == 0) {
|
||||
alert(document.getElementById("bundle_qa").
|
||||
getString("qa.extension.prefs.loginError"));
|
||||
// snap the tab selection back to prefs:
|
||||
$('qa_tabrow').selectedItem = $('qa-tabbar-prefs');
|
||||
return false;
|
||||
} else {
|
||||
qaPref.litmus.setPassword(uname, passwd);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
litmus.validateLogin(uname, passwd, callback);
|
||||
return false; // not ready to close yet
|
||||
},
|
||||
loadUsernameAndPassword : function() {
|
||||
var uname = document.getElementById('qa-preferences-litmus-username');
|
||||
var passwd = document.getElementById('qa-preferences-litmus-password');
|
||||
|
||||
uname.value = qaPref.litmus.getUsername();
|
||||
passwd.value = qaPref.litmus.getPassword();
|
||||
},
|
||||
createAccount : function() {
|
||||
window.openDialog("chrome://qa/content/accountcreate.xul",
|
||||
"_blank",
|
||||
"chrome,all,dialog=yes",
|
||||
qaPrefsWindow.loadUsernameAndPassword);
|
||||
}
|
||||
};
|
||||
|
||||
var qaSetup = {
|
||||
didSubmitForm : 0,
|
||||
|
||||
hideAccountSettings : function() {
|
||||
var accountyes = document.getElementById('qa-setup-accountyes');
|
||||
var accountno = document.getElementById('qa-setup-accountno');
|
||||
accountyes.style.display = 'none';
|
||||
accountno.style.display = 'none';
|
||||
},
|
||||
loadAccountSettings : function() {
|
||||
var uname = document.getElementById('username');
|
||||
var passwd = document.getElementById('password');
|
||||
uname.value = qaPref.litmus.getUsername() || '';
|
||||
passwd.value = qaPref.litmus.getPassword() || '';
|
||||
if (qaPref.litmus.getUsername()) {
|
||||
document.getElementById("qa-setup-account-haveaccount").selectedIndex=1;
|
||||
document.getElementById('qa-setup-accountyes').style.display = '';
|
||||
}
|
||||
document.getElementById('qa-setup-createaccount-iframe').src =
|
||||
litmus.baseURL+'extension.cgi?createAccount=1';
|
||||
},
|
||||
|
||||
accountSetting : function(yesno) {
|
||||
var accountyes = document.getElementById('qa-setup-accountyes');
|
||||
var accountno = document.getElementById('qa-setup-accountno');
|
||||
qaSetup.hideAccountSettings();
|
||||
if (yesno == '0') {
|
||||
accountno.style.display = '';
|
||||
} else {
|
||||
accountyes.style.display = '';
|
||||
}
|
||||
},
|
||||
retrieveAccount : function(frameid, loadingid) {
|
||||
var page = document.getElementById(frameid).contentDocument;
|
||||
if (!page) {
|
||||
alert("create account page is missing");
|
||||
return false;
|
||||
}
|
||||
if (page.wrappedJSObject == null)
|
||||
page.wrappedJSObject = page;
|
||||
if (page.forms[0] && page.forms[0].wrappedJSObject == null)
|
||||
page.forms[0].wrappedJSObject = page.forms[0];
|
||||
|
||||
if (loadingid && page.location == litmus.baseURL+'extension.cgi?createAccount=1'
|
||||
&& qaSetup.didSubmitForm==0) {
|
||||
document.getElementById('loadingid').value =
|
||||
document.getElementById("bundle_qa").getString("qa.extension.prefs.loadingMsg");
|
||||
page.forms[0].wrappedJSObject.submit();
|
||||
qaSetup.didSubmitForm = 1;
|
||||
setTimeout("qaSetup.validateAccount()", 5000);
|
||||
return false;
|
||||
}
|
||||
if (qaSetup.didSubmitForm == 1 && ! page.forms ||
|
||||
! page.forms[0].wrappedJSObject ||
|
||||
! page.forms[0].wrappedJSObject.email &&
|
||||
! page.forms[0].wrappedJSObject.email.value)
|
||||
{qaSetup.didSubmitForm = 2;
|
||||
setTimeout("qaSetup.validateAccount()", 4000);
|
||||
return false;}
|
||||
var e = '';
|
||||
var p = '';
|
||||
if (page.forms && page.forms[0].wrappedJSObject &&
|
||||
page.forms[0].wrappedJSObject.email &&
|
||||
page.forms[0].wrappedJSObject.email.value)
|
||||
{ e=page.forms[0].wrappedJSObject.email.value }
|
||||
if (page.forms && page.forms[0].wrappedJSObject &&
|
||||
page.forms[0].wrappedJSObject.password &&
|
||||
page.forms[0].wrappedJSObject.password.value)
|
||||
{ p=page.forms[0].wrappedJSObject.password.value }
|
||||
|
||||
return { name : e, password : p};
|
||||
},
|
||||
validateAccount : function() {
|
||||
if (document.getElementById('qa-setup-accountno').style.display == '') {
|
||||
var account = qaSetup.retrieveAccount("qa-setup-createaccount-iframe", "qa-setup-accountconfirmloading");
|
||||
document.getElementById('username').value = account.name;
|
||||
document.getElementById('password').value = account.password;
|
||||
}
|
||||
|
||||
document.getElementById('qa-setup-accountconfirmloading').value =
|
||||
document.getElementById("bundle_qa").getString("qa.extension.prefs.loadingMsg");
|
||||
|
||||
var uname = document.getElementById('username').value;
|
||||
var passwd = document.getElementById('password').value;
|
||||
|
||||
var callback = function(resp) {
|
||||
if (resp.responseText != 1) { // failure
|
||||
alert(document.getElementById("bundle_qa").
|
||||
getString("qa.extension.prefs.loginError"));
|
||||
document.getElementById('qa-setup-accountconfirmloading').value = null;
|
||||
return false;
|
||||
} else { // all's well
|
||||
qaPref.litmus.setPassword(uname, passwd);
|
||||
document.getElementById('qa-setup-accountconfirmloading').value = null;
|
||||
document.getElementById('qa-setup').pageIndex++; // advance
|
||||
return true;
|
||||
}
|
||||
}
|
||||
litmus.validateLogin(uname, passwd, callback);
|
||||
return false; // not ready to advance yet
|
||||
},
|
||||
|
||||
loadSysconfig : function() {
|
||||
$('qa-setup-sysconfig-loading').value =
|
||||
$("bundle_qa").getString("qa.extension.sysconfig.loadingMsg");
|
||||
var guessInfo = function() {
|
||||
var sysconfig;
|
||||
try {
|
||||
sysconfig = new Sysconfig();
|
||||
} catch (ex) {}
|
||||
var platItems = $('qa-setup-platform').menupopup.childNodes;
|
||||
for (var i=0; i<platItems.length; i++) {
|
||||
if (sysconfig.platform && platItems[i].label == sysconfig.platform)
|
||||
$('qa-setup-platform').selectedIndex = i;
|
||||
}
|
||||
var opsysItems = $('qa-setup-opsys').menupopup.childNodes;
|
||||
for (var i=0; i<opsysItems.length; i++) {
|
||||
if (sysconfig.opsys && opsysItems[i].label == sysconfig.opsys)
|
||||
$('qa-setup-opsys').selectedIndex = i;
|
||||
}
|
||||
$('qa-setup-sysconfig-loading').value = '';
|
||||
};
|
||||
|
||||
qaTools.loadJsonMenu(litmus.baseURL+"/json.cgi?platforms=1",
|
||||
$('qa-setup-platform'), 'name', 'name');
|
||||
qaTools.loadJsonMenu(litmus.baseURL+"/json.cgi?opsyses=1",
|
||||
$('qa-setup-opsys'), 'name', 'name', guessInfo);
|
||||
},
|
||||
|
||||
validateSysconfig : function() {
|
||||
var sysconfig;
|
||||
try {
|
||||
sysconfig = new Sysconfig();
|
||||
} catch (ex) {}
|
||||
|
||||
// only set prefs for things which differ from the automatically
|
||||
// detected sysconfig for forward-compatibility
|
||||
if (! sysconfig.platform == $('qa-setup-platform').selectedItem.label) {
|
||||
qaPref.setPref(qaPref.prefBase+'.sysconfig.platform',
|
||||
$('qa-setup-platform').selectedItem.label, 'char');
|
||||
}
|
||||
if (! sysconfig.opsys == $('qa-setup-opsys').selectedItem.label) {
|
||||
qaPref.setPref(qaPref.prefBase+'.sysconfig.opsys',
|
||||
$('qa-setup-opsys').selectedItem.label, 'char');
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
finish : function() {
|
||||
qaPref.setPref(qaPref.prefBase+'.isFirstTime', false, 'bool');
|
||||
}
|
||||
};
|
@ -1,103 +0,0 @@
|
||||
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
|
||||
- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://qa/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<wizard
|
||||
id="qa-setup"
|
||||
title="&qa.setup.title;"
|
||||
height="600"
|
||||
width="500"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_qa" src="chrome://qa/locale/qa.properties" />
|
||||
</stringbundleset>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/common.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
|
||||
|
||||
<wizardpage pageid="welcome" label="&qa.setup.welcomeheader;">
|
||||
<description>&qa.setup.welcometext;</description>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage pageid="about" label="&qa.setup.aboutheader;">
|
||||
<description>&qa.setup.abouttext;</description>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage pageid="account" label="&qa.setup.accountheader;"
|
||||
onpageshow="qaSetup.loadAccountSettings(); qaSetup.accountSetting('0');"
|
||||
onpageadvanced="return qaSetup.validateAccount();">
|
||||
<description>&qa.setup.accounttext;</description>
|
||||
<spacer height="20px" />
|
||||
<label value="&qa.setup.haveaccount;"/>
|
||||
<radiogroup id="qa-setup-account-haveaccount">
|
||||
<radio selected="true" value="0" label="&qa.setup.accountno;" oncommand="qaSetup.accountSetting('0');"/>
|
||||
<radio selected="false" value="1" label="&qa.setup.accountyes;" oncommand="qaSetup.accountSetting('1');"/>
|
||||
</radiogroup>
|
||||
<spacer height="20px" />
|
||||
|
||||
<vbox id="qa-setup-accountyes" style="display: none;">
|
||||
<description>&qa.setup.accountyes.enterinfo;</description>
|
||||
<groupbox>
|
||||
<hbox>
|
||||
<label control="username" value="&qa.preferences.litmus.username;" width="60px"/>
|
||||
<textbox id="username" size="35" width="250px"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label control="password" value="&qa.preferences.litmus.password;" width="60px"/>
|
||||
<textbox id="password" type="password" size="35" width="250px"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<label id="qa-setup-accountconfirmloading"/>
|
||||
</vbox>
|
||||
|
||||
<vbox id="qa-setup-accountno" style="display: none;">
|
||||
<description>&qa.setup.accountno.text;</description>
|
||||
<html:iframe id="qa-setup-createaccount-iframe"
|
||||
height="250" width="300" scrolling="auto"/>
|
||||
</vbox>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage pageid="sysconfig" onpageshow="qaSetup.loadSysconfig();"
|
||||
label="&qa.setup.sysconfig.header;"
|
||||
onpageadvanced="return qaSetup.validateSysconfig();">
|
||||
<vbox>
|
||||
<description>&qa.setup.sysconfig.text;</description>
|
||||
<spacer height="20px" />
|
||||
<label id="qa-setup-sysconfig-loading"/>
|
||||
<spacer height="10px" />
|
||||
<hbox>
|
||||
<label control="qa-setup-platform" value="&qa.setup.sysconfig.platform;" width="100px"/>
|
||||
<menulist id="qa-setup-platform">
|
||||
<menupopup>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label control="qa-setup-opsys" value="&qa.setup.sysconfig.opsys;" width="100px"/>
|
||||
<menulist id="qa-setup-opsys">
|
||||
<menupopup>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<spacer height="20px" />
|
||||
</vbox>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage pageid="finish" onpageshow="qaSetup.finish();" label="&qa.setup.finish.header;">
|
||||
<description>&qa.setup.accountdone;</description>
|
||||
</wizardpage>
|
||||
|
||||
</wizard>
|
@ -1,306 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
//bugAccess Class
|
||||
//used to comunicate with the bugzilla server, this will eventually be
|
||||
//an interface so the webservices version can be pluged in here if the
|
||||
//bugzilla instance supports it. Right now the http/xml version is used
|
||||
|
||||
|
||||
function bugAccess()
|
||||
{
|
||||
var onloadBugList;
|
||||
var onloadBugSpecs;
|
||||
var onloadBugSearch;
|
||||
var onloadBugSave;
|
||||
var onloadLogin;
|
||||
|
||||
this.getBugSpecs = function(inputId,inUrl,onloadFunc)
|
||||
{
|
||||
if(onloadFunc!=undefined)
|
||||
{
|
||||
onloadBugSpecs = onloadFunc;
|
||||
}else
|
||||
alert("ERROR: getBugList called without function parameter");
|
||||
var url = inUrl+"show_bug.cgi?ctype=xml&id=";
|
||||
//get bug id and create URL
|
||||
url += inputId;
|
||||
|
||||
//TODO: need pop alert if connect can't be made(onerror)
|
||||
var xmlHttp=new XMLHttpRequest();
|
||||
xmlHttp.open("GET", url, true);
|
||||
|
||||
|
||||
var req=new XMLHttpRequest();
|
||||
req.open("GET", url, true);
|
||||
var callback = this.parseBugSpecs;
|
||||
req.onreadystatechange = function (aEvt) {
|
||||
if (req.readyState == 4) {
|
||||
if(req.status == 200) {
|
||||
// alert(req.responseXML);
|
||||
callback(req);
|
||||
}else
|
||||
alert("Error loading page\n");
|
||||
}
|
||||
};
|
||||
req.send(null);
|
||||
|
||||
|
||||
// leave true for Gecko
|
||||
xmlHttp.send(null);
|
||||
|
||||
//xmlHttp.onload=this.parseBugSpecs;
|
||||
}
|
||||
//parse individual bug page
|
||||
this.parseBugSpecs = function(e)
|
||||
{
|
||||
var bugInfo = new Object();
|
||||
//var xml = e.target.responseXML;
|
||||
var xml = e.responseXML;
|
||||
// alert(xml);
|
||||
|
||||
if(xml.getElementsByTagName("bug")[0].getAttribute("error")!=null)
|
||||
{
|
||||
alert("The requested bug was: "+ xml.getElementsByTagName("bug")[0].getAttribute("error"));
|
||||
bugInfo["id"] = "";
|
||||
bugInfo["title"] = "";
|
||||
bugInfo["status"] = "";
|
||||
bugInfo["info"] = "";
|
||||
|
||||
}else
|
||||
{
|
||||
bugInfo["id"] = xml.getElementsByTagName("bug_id")[0].firstChild.data;
|
||||
bugInfo["title"] = xml.getElementsByTagName("short_desc")[0].firstChild.data;
|
||||
bugInfo["status"] = xml.getElementsByTagName("bug_status")[0].firstChild.data
|
||||
if (xml.getElementsByTagName("resolution").length)
|
||||
bugInfo["status"] += "--" + xml.getElementsByTagName("resolution")[0].firstChild.data;
|
||||
bugInfo["info"] = xml.getElementsByTagName("short_desc")[0].firstChild.data + "\n\n"
|
||||
+ xml.getElementsByTagName("thetext")[0].firstChild.data;
|
||||
}
|
||||
|
||||
onloadBugSpecs(bugInfo);
|
||||
}
|
||||
|
||||
this.setBugListOnloadFunc = function(onloadFunc){onloadBugList = onloadFunc;}
|
||||
|
||||
this.setBugSearchOnloadFunc = function(onloadFunc){onloadBugSearch = onloadFunc;}
|
||||
|
||||
// get list of bugs html page
|
||||
this.getBugList = function(inURL, params, mode)
|
||||
{
|
||||
var xmlHttp=new XMLHttpRequest();
|
||||
xmlHttp.open("GET", inURL+"/buglist.cgi?"+params, true);
|
||||
|
||||
dump("searching: " + inURL+"/buglist.cgi?"+params);
|
||||
// leave true for Gecko
|
||||
xmlHttp.send(null);
|
||||
if(mode == 1)//list mode
|
||||
xmlHttp.onload=this.parseBugList;
|
||||
else if(mode == 0)//search mode
|
||||
xmlHttp.onload=this.parseBugSearch;
|
||||
}
|
||||
|
||||
|
||||
this.parseBugList = function(e)
|
||||
{
|
||||
var bugData = parseList(e.target.responseText);
|
||||
onloadBugList(bugData);
|
||||
}
|
||||
|
||||
this.parseBugSearch = function(e)
|
||||
{
|
||||
var bugData = parseList(e.target.responseText);
|
||||
onloadBugSearch(bugData);
|
||||
}
|
||||
|
||||
this.writeBugToBugzilla = function(inUrl,bugSpec,fn)
|
||||
{
|
||||
onloadBugSave=fn;
|
||||
|
||||
var names = new Array(bugSpecs.getFieldTotal());
|
||||
names[0]="id";
|
||||
names[1]="product";
|
||||
names[2]="component";
|
||||
names[3]="status";
|
||||
names[4]="resolution";
|
||||
names[5]="assigned_to";
|
||||
names[6]="rep_platform";
|
||||
names[7]="op_sys";
|
||||
names[8]="version";
|
||||
names[9]="priority";
|
||||
names[10]="bug_severity";
|
||||
names[11]="target_milestone";
|
||||
names[12]="reporter";
|
||||
names[13]="qa_contact";
|
||||
names[14]="bug_file_loc";
|
||||
names[15]="short_desc";
|
||||
|
||||
var fieldCount = bugSpecs.getFieldTotal();
|
||||
var varString="";
|
||||
|
||||
for(i=0;i<fieldCount-1;i++)
|
||||
{
|
||||
if(names[i]!="reporter")
|
||||
varString+=names[i]+"="+bugSpec.getSpec(i)+"&";
|
||||
}
|
||||
|
||||
varString+="longdesclength=&knob="+bugSpec.getKnob();
|
||||
|
||||
|
||||
var xmlHttp=new XMLHttpRequest();
|
||||
|
||||
xmlHttp.open("POST", inUrl+"/process_bug.cgi",true);
|
||||
|
||||
xmlHttp.setRequestHeader("Method", "POST "+inUrl+"/process_bug.cgi"+" HTTP/1.1");
|
||||
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
|
||||
|
||||
|
||||
xmlHttp.send(varString);
|
||||
//xmlHttp.onreadystatechange = this.writeBugToBugzillaStatus;
|
||||
xmlHttp.onload = this.writeBugToBugzillaReturnStatus;
|
||||
}
|
||||
|
||||
this.writeBugToBugzillaReturnStatus = function(e)
|
||||
{
|
||||
if (e.target.readyState == 4)
|
||||
{
|
||||
|
||||
if (e.target.status == 200)
|
||||
{
|
||||
var start;//will hold first pos of error search string from responce text if its an error page
|
||||
//window._content.document.write("<b> the responce status is: </b>"+self.xmlHttp.status+"<br/>");
|
||||
if(e.target.responseText.indexOf('name="Bugzilla_login">')!=-1)
|
||||
{
|
||||
//login page returned which means user isn't logged in
|
||||
alert("Your not logged in to this instance of bugzilla");
|
||||
}else if(e.target.responseText.indexOf('Bug processed')!=-1)
|
||||
{
|
||||
var success = "Changes Made";
|
||||
|
||||
alert(success);
|
||||
}else if((start = e.target.responseText.indexOf('<td bgcolor="#ff0000">'))!=-1)
|
||||
{
|
||||
//error was received
|
||||
var error = "Error: "+e.target.responseText.substring(start,e.target.responseText.indexOf('</td>'));
|
||||
error = error.replace(/\n|\t|/g,"");
|
||||
error = error.replace(/<[^>]+>/g,"");
|
||||
error = getCleanText(error);
|
||||
alert(error);
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
alert("Connection failed! possible network error");
|
||||
}
|
||||
|
||||
onloadBugSave();
|
||||
|
||||
}else
|
||||
{
|
||||
//at one of the load phases before 4
|
||||
alert("load phase: "+e.target.readyState);
|
||||
}
|
||||
}
|
||||
|
||||
this.loginToBugzilla = function(inUrl, user, passwd, fn)
|
||||
{
|
||||
onloadLogin = fn;
|
||||
|
||||
var varString = "&Bugzilla_login="+user+"&Bugzilla_password="+passwd;
|
||||
|
||||
var xmlHttp=new XMLHttpRequest();
|
||||
|
||||
xmlHttp.open("POST", inUrl+"/index.cgi?GoAheadAndLogIn=1",true);
|
||||
|
||||
xmlHttp.setRequestHeader("Method", "POST "+inUrl+"/index.cgi"+" HTTP/1.1");
|
||||
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
|
||||
|
||||
xmlHttp.send(varString);
|
||||
xmlHttp.onload = this.loginToBugzillaStatus;
|
||||
|
||||
}
|
||||
|
||||
this.loginToBugzillaStatus = function(e)
|
||||
{
|
||||
//1 - success, -1 - failure, 0 - error unknown state
|
||||
var rc=0;
|
||||
|
||||
var start;//will hold first pos of error search string from responce text if its an error page
|
||||
if(e.target.responseText.indexOf('href="relogin.cgi"')!=-1)//success
|
||||
{
|
||||
//success
|
||||
rc=1;
|
||||
alert("Login successful");
|
||||
|
||||
}else if(e.target.responseText.toLowerCase().indexOf('invalid username or password')!=-1)//failure
|
||||
{
|
||||
rc=-1;
|
||||
alert("Bugzilla reported that your user name or password was invalid please verify");
|
||||
}
|
||||
|
||||
onloadLogin(rc);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Kludge: couldn't find this fn when inside bugAccess for some reason ahould be moved to bug access class
|
||||
//parse list of bugs html page and return array with ids and descriptions
|
||||
function parseList(xmlHttp)
|
||||
{
|
||||
var beginLoc=0;
|
||||
var endLoc=0;
|
||||
var id;
|
||||
var summary;
|
||||
|
||||
bugData=new Array();
|
||||
//dump(xmlHttp);
|
||||
// Ideally, we'd load the contents of xmlHttp into a document node and do
|
||||
// XPATH queries to get these rather than this brute force parsing, but there
|
||||
// isn't a very clean way to load text/HTML into a document (bug 102699).
|
||||
// So, for now, be sure that we are beginning in the right part of the page,
|
||||
// And not catching bugzilla maintenance bug references in the header.
|
||||
// So we look for the bugs table, i.e. this line:
|
||||
// <table class="bz_buglist sortable" ...> We set that to our end, so that
|
||||
// the beginLoc is set properly the first time through the loop.
|
||||
endLoc = xmlHttp.search(/<table class=\"bz_buglist sortable\"/);
|
||||
if (endLoc <= 0) {
|
||||
// You should never see this, but if you do, then that means the format
|
||||
// of the bugzilla page has changed and we want to return rather than go
|
||||
// into an infinite loop.
|
||||
alert("ERROR: No Bugs Found.");
|
||||
return bugData;
|
||||
}
|
||||
|
||||
for(var i = 0;(beginLoc = xmlHttp.indexOf('show_bug.cgi?id',endLoc)) != -1; i++)
|
||||
{
|
||||
endLoc = xmlHttp.indexOf('"',beginLoc);
|
||||
beginLoc = xmlHttp.indexOf('=',beginLoc);
|
||||
|
||||
id=xmlHttp.substring(beginLoc+1, endLoc);
|
||||
|
||||
|
||||
//move past other entries to get to summary
|
||||
var curLoc=endLoc;
|
||||
|
||||
endLoc = xmlHttp.indexOf('</tr>',endLoc);
|
||||
endLoc = xmlHttp.lastIndexOf('</td>',endLoc);
|
||||
beginLoc = xmlHttp.lastIndexOf("<td >",endLoc);
|
||||
if(beginLoc==-1)
|
||||
{
|
||||
beginLoc = xmlHttp.lastIndexOf("<td>",endLoc);//other option
|
||||
}
|
||||
|
||||
summary = xmlHttp.substring(beginLoc, endLoc);
|
||||
|
||||
summary = getCleanText(summary);
|
||||
bugData[i] = new Array(2);
|
||||
bugData[i][0] = id;
|
||||
bugData[i][1] = summary;
|
||||
//alert("loop:" + i);
|
||||
}
|
||||
//alert("end loop:" + bugData, bugData.length);
|
||||
return bugData;
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var bugzilla = {
|
||||
trunkVersion : "3.0",
|
||||
baseURL : qaPref.getPref(qaPref.prefBase+".bugzilla.url", "char"),
|
||||
sysconfig: null,
|
||||
bugReader : null,
|
||||
doSearch : function() {
|
||||
|
||||
var words = $("qa-bugzilla-input-keywords").value;
|
||||
var bugId = $("qa-bugzilla-input-id").value;
|
||||
|
||||
if ($("qa-bugzilla-radio-words").selected) { // keyword search
|
||||
|
||||
if ($("qa-bugzilla-input-os").checked && words.indexOf("os:") == -1) {
|
||||
if (bugzilla.sysconfig == null) bugzilla.sysconfig = new Sysconfig();
|
||||
words += " os:" + bugzilla.sysconfig.opsys.substr(0,3);
|
||||
}
|
||||
if ($("qa-bugzilla-input-version").checked && words.indexOf("version:") == -1) {
|
||||
if (bugzilla.sysconfig == null) bugzilla.sysconfig = new Sysconfig();
|
||||
var branch = bugzilla.sysconfig.branch.substr(0,3);
|
||||
if (branch.indexOf(bugzilla.trunkVersion) != -1) branch = "Trunk";
|
||||
|
||||
words += " version:" + branch;
|
||||
}
|
||||
|
||||
bugzilla.loadBugGroup(words);
|
||||
} else { //id search
|
||||
bugzilla.loadBug(bugId);
|
||||
}
|
||||
},
|
||||
showRecent : function() {
|
||||
$("qa-bugzilla-input-radiogroup").selectedItem = $("qa-bugzilla-radio-words");
|
||||
bugzilla.disableOther();
|
||||
bugzilla.loadBugGroup("product=Core&product=Firefox&product=Mozilla+Application+Suite&product=Thunderbird&product=Toolkit"
|
||||
+"&bug_status=UNCONFIRMED,NEW,ASSIGNED,REOPENED,RESOLVED&chfield=%5BBug%20creation%5D&chfieldfrom=-24h"
|
||||
, true);
|
||||
},
|
||||
loadBugGroup : function (param, detailsearch) {
|
||||
var callback = function(bugarray) { // bugarray is a 2d array with id and summaries
|
||||
|
||||
var menu = document.getElementById('bugSearchList');
|
||||
while (menu.getRowCount()) { // clear menu
|
||||
menu.removeItemAt(0);
|
||||
};
|
||||
|
||||
for (var i = 0; i < bugarray.length; i++) {
|
||||
var row = document.createElement("listitem");
|
||||
row.value = bugarray[i][0];
|
||||
var number = document.createElement("listcell");
|
||||
number.setAttribute("label", bugarray[i][0]);
|
||||
var name = document.createElement("listcell");
|
||||
name.setAttribute("label", bugarray[i][1]);
|
||||
name.setAttribute("crop", "end");
|
||||
name.setAttribute("flex", "1");
|
||||
row.appendChild(number);
|
||||
row.appendChild(name);
|
||||
menu.appendChild(row);
|
||||
}
|
||||
|
||||
if(bugarray.length) menu.selectedIndex = 0;
|
||||
|
||||
$("qa-bugzilla-input-keywords").value = param;
|
||||
if ($('qa_tabrow').selectedItem != $('qa-tabbar-bugzilla')) {
|
||||
bugzilla.highlightTab();
|
||||
}
|
||||
}
|
||||
|
||||
if (bugzilla.bugReader == null) bugzilla.bugReader = new bugAccess();
|
||||
bugzilla.bugReader.setBugSearchOnloadFunc(callback);
|
||||
|
||||
if (detailsearch) bugzilla.bugReader.getBugList(bugzilla.baseURL, "buglist.cgi?="+param, 0);
|
||||
else bugzilla.bugReader.getBugList(bugzilla.baseURL, "quicksearch="+param, 0);
|
||||
},
|
||||
loadBug : function (bugId, preserveCurrent) {
|
||||
var callback = function(bugObj) {
|
||||
// menu
|
||||
var menu = document.getElementById('bugSearchList');
|
||||
while (menu.getRowCount() && !preserveCurrent) { // clear menu
|
||||
menu.removeItemAt(0);
|
||||
};
|
||||
|
||||
var row = document.createElement("listitem");
|
||||
row.value = bugObj["id"];
|
||||
var number = document.createElement("listcell");
|
||||
number.setAttribute("label", bugObj["id"]);
|
||||
var name = document.createElement("listcell");
|
||||
name.setAttribute("label", bugObj["title"]);
|
||||
name.setAttribute("crop", "end");
|
||||
row.appendChild(number);
|
||||
row.appendChild(name);
|
||||
menu.appendChild(row);
|
||||
|
||||
// summary
|
||||
$("qa-bugzilla-input-id").value = $("qa-bugzilla-output-id").value = bugObj["id"];
|
||||
$("qa-bugzilla-output-status").value = bugObj["status"];
|
||||
$("qa-bugzilla-output-summary").value = bugObj["info"];
|
||||
|
||||
qaTools.assignLinkHandlers($("qa-bugzilla-output-summary"));
|
||||
|
||||
if ($('qa_tabrow').selectedItem != $('qa-tabbar-bugzilla')) {
|
||||
bugzilla.highlightTab();
|
||||
}
|
||||
}
|
||||
if (bugzilla.bugReader == null) bugzilla.bugReader = new bugAccess();
|
||||
bugzilla.bugReader.getBugSpecs(bugId, bugzilla.baseURL, callback);
|
||||
},
|
||||
disableOther : function() {
|
||||
if ($("qa-bugzilla-radio-words").selected) {
|
||||
$("qa-bugzilla-input-keywords").disabled = false;
|
||||
$("qa-bugzilla-input-os").disabled = false;
|
||||
$("qa-bugzilla-input-version").disabled = false;
|
||||
$("qa-bugzilla-input-id").disabled = true;
|
||||
} else {
|
||||
$("qa-bugzilla-input-id").disabled = false;
|
||||
$("qa-bugzilla-input-keywords").disabled = true;
|
||||
$("qa-bugzilla-input-os").disabled = true;
|
||||
$("qa-bugzilla-input-version").disabled = true;
|
||||
}
|
||||
},
|
||||
handleSelect : function() {
|
||||
var menu = $('bugSearchList');
|
||||
if (menu.selectedItem.value == $("qa-bugzilla-output-id").value) return;
|
||||
|
||||
var callback = function(bugObj) {
|
||||
$("qa-bugzilla-output-id").value = bugObj["id"];
|
||||
$("qa-bugzilla-output-status").value = bugObj["status"];
|
||||
$("qa-bugzilla-output-summary").value = bugObj["info"];
|
||||
}
|
||||
if (bugzilla.bugReader == null) bugzilla.bugReader = new bugAccess();
|
||||
bugzilla.bugReader.getBugSpecs(menu.selectedItem.value, bugzilla.baseURL, callback);
|
||||
},
|
||||
highlightTab : function() {
|
||||
$('qa-tabbar-bugzilla').className = "tabbrowser-tab highlight";
|
||||
},
|
||||
unhighlightTab : function() {
|
||||
$('qa-tabbar-bugzilla').className = "tabbrowser-tab";
|
||||
},
|
||||
openInBugzilla : function() {
|
||||
if ($("qa-bugzilla-output-id").value == "") {
|
||||
alert("no value");
|
||||
return;
|
||||
}
|
||||
var url = bugzilla.baseURL + "show_bug.cgi?id=" + $("qa-bugzilla-output-id").value;
|
||||
|
||||
var type = qaPref.getPref("browser.link.open_external", "int");
|
||||
var where = "tab";
|
||||
if (type == 2) where = "window";
|
||||
|
||||
openUILinkIn(url, where);
|
||||
},
|
||||
findBugzillaLinks : function(node) { // assumes HTML-ns node
|
||||
var RV = new Array();
|
||||
var innerstr = node.innerHTML;
|
||||
|
||||
var prefix = "show_bug.cgi?id=";
|
||||
var index = innerstr.indexOf(prefix);
|
||||
dump(innerstr);
|
||||
if (index == -1) {
|
||||
//TODO: search for "bug"? is that too broad?
|
||||
} else {
|
||||
while(index != -1) {
|
||||
RV.push(innerstr.substr(index+prefix.length,6));
|
||||
dump(RV.length + " found so far, current index: " + index+ " \n");
|
||||
index = innerstr.indexOf(prefix, index + 1);
|
||||
}
|
||||
}
|
||||
return qaTools.makeUniqueArray(RV);
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa-bz-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<tabpanel id="qa-tab-bugzilla">
|
||||
<vbox flex="1">
|
||||
<groupbox>
|
||||
<caption label="Bug Search" />
|
||||
<radiogroup id = "qa-bugzilla-input-radiogroup"
|
||||
onselect="bugzilla.disableOther()">
|
||||
<hbox>
|
||||
<radio class="bug-search" selected="true" id="qa-bugzilla-radio-id"
|
||||
label="Bug Id:" />
|
||||
<textbox id="qa-bugzilla-input-id" width="75px" />
|
||||
<spacer width="5px" />
|
||||
<radio class="bug-search" id="qa-bugzilla-radio-words"
|
||||
label="Keywords:" />
|
||||
<textbox disabled="true" id="qa-bugzilla-input-keywords" flex="1" />
|
||||
</hbox>
|
||||
</radiogroup>
|
||||
<spacer height="5px" />
|
||||
<hbox>
|
||||
<label value="Filter by my:" />
|
||||
<checkbox id="qa-bugzilla-input-os" label="Operating System" />
|
||||
<spacer width="5px" />
|
||||
<checkbox id="qa-bugzilla-input-version" label="Product Version" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button style="margin-left: 50px;" label="Find!" oncommand="bugzilla.doSearch(); "/>
|
||||
<button label="Show all bugs filed today" oncommand="bugzilla.showRecent()"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<listbox id="bugSearchList" onselect="bugzilla.handleSelect();"
|
||||
seltype="single" height="120px">
|
||||
<listhead>
|
||||
<listheader width="75px" label="Id"/>
|
||||
<listheader label="Summary"/>
|
||||
</listhead>
|
||||
|
||||
<listcols>
|
||||
<listcol/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
</listbox>
|
||||
|
||||
<groupbox flex="1">
|
||||
<caption label= "Bug Summary" />
|
||||
<hbox>
|
||||
<label>Bug Id:</label>
|
||||
<textbox style="color:black" id="qa-bugzilla-output-id"
|
||||
width="75px" disabled="true"/>
|
||||
<spacer width="5px" />
|
||||
<label>Status:</label>
|
||||
<textbox style="color:black" id="qa-bugzilla-output-status"
|
||||
disabled="true" flex="1" />
|
||||
</hbox>
|
||||
|
||||
<textbox style="color:black" id="qa-bugzilla-output-summary"
|
||||
multiline="true" disabled="true" flex="1" />
|
||||
|
||||
<hbox>
|
||||
<button style="margin-left: 50px;" label="Show in Bugzilla"
|
||||
oncommand="bugzilla.openInBugzilla();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
</overlay>
|
@ -1,65 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa-qmo-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
|
||||
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://chatzillaservice_qa/content/chatzilla-service.js" />
|
||||
<script type="application/x-javascript" >
|
||||
window.addEventListener('load', function() {
|
||||
qaTools.assignLinkHandler($("qa-chat-imo"));
|
||||
qaTools.assignLinkHandler($("qa-chat-irchelp"));
|
||||
}, false);
|
||||
</script>
|
||||
|
||||
<tabpanel id="qa-tab-chat">
|
||||
<vbox flex="1">
|
||||
<groupbox>
|
||||
<caption label="&qa.chat.introtitle;" />
|
||||
<description>&qa.chat.intro;</description>
|
||||
<spacer style="height: 1em;" />
|
||||
<description>&qa.chat.intro2;</description>
|
||||
</groupbox>
|
||||
|
||||
<groupbox flex="1">
|
||||
<caption label="&qa.chat.howdoItitle;" />
|
||||
<hbox>
|
||||
<vbox>
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" id="qa-chat-howto">
|
||||
<ul>
|
||||
<li><a id="qa-chat-imo" href="&qa.chat.howdoI.imourl;" target="_blank">
|
||||
&qa.chat.howdoI.imo;</a>
|
||||
</li>
|
||||
<li><a id="qa-chat-irchelp" href="&qa.chat.howdoI.irchelpurl;" target="_blank">
|
||||
&qa.chat.howdoI.irchelp;</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<button style="margin-left: 50px;"
|
||||
oncommand="openQAChat();" label="&qa.chat.howdoI.joinnow;" />
|
||||
<spacer flex="1" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
function openQAChat() {
|
||||
spawnChatZilla('irc://irc.mozilla.org/qa', 0);
|
||||
}
|
||||
</script>
|
||||
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
|
||||
</overlay>
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa-help-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://qa/content/tabs/qa.js" />
|
||||
<tabpanel id="qa-tab-help">
|
||||
<vbox flex="1">
|
||||
<groupbox>
|
||||
<caption label="&qa.help.helptitle;" />
|
||||
<description>&qa.help.intro;</description>
|
||||
</groupbox>
|
||||
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
|
||||
</overlay>
|
@ -1,92 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- -*- Mode: HTML -*- -->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
<!ENTITY % xhtmlDTD SYSTEM "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> %xhtmlDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa-litmus-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<tabpanel id="qa-tab-litmus" onload="litmus.readStateFromPref();">
|
||||
|
||||
<vbox flex="1" >
|
||||
<groupbox>
|
||||
<caption label="" id="qa-testrun-label"/>
|
||||
<hbox>
|
||||
<vbox>
|
||||
<label value="" id="qa-testgroup-label" style="font-weight: bold;" crop="end"/>
|
||||
<label value="" id="qa-subgroup-label" style="font-weight: bold;" crop="end"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<button label="&qa.litmus.selecttests;" oncommand="litmus.handleDialog()"/>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<richlistbox id="testlist" onselect="litmus.handleSelect();" seltype="single" height="110px">
|
||||
<listcols>
|
||||
<listcol/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<richlistitem label="&qa.litmus.testlist.initiallabel;"/>
|
||||
</richlistbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="" id="qa-testcase-progress"/>
|
||||
<hbox flex="1">
|
||||
<label id="qa-testcase-summary" value="" style="font-weight: bold;" crop="end" flex="1"/>
|
||||
<label id="qa-testcase-id" value="&qa.litmus.testlist.initialdescription;" crop="end" flex="1"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox flex="4" minheight="100px">
|
||||
<caption label="&qa.testcase.steps;" />
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="overflow: auto;"
|
||||
id="qa-testcase-steps" class="list" flex="1" minheight="100px"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox flex="3" minheight="75px">
|
||||
<caption label="&qa.testcase.expected;" />
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="overflow: auto;"
|
||||
id="qa-testcase-expected" class="list" flex="1" minheight="75px"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="Test Result:" />
|
||||
<hbox flex="1">
|
||||
<vbox>
|
||||
<radiogroup id="qa-testcase-result">
|
||||
<radio id="qa-testcase-pass" label="&qa.testcase.result.pass;"/>
|
||||
<radio id="qa-testcase-fail" label="&qa.testcase.result.fail;"/>
|
||||
<radio id="qa-testcase-unclearBroken" label="&qa.testcase.result.unclearbroken;"/>
|
||||
</radiogroup>
|
||||
</vbox>
|
||||
<vbox flex="1">
|
||||
<hbox>
|
||||
<label value="Comment (optional): "/>
|
||||
<textbox id="qa-testcase-comment" flex="1"/>
|
||||
</hbox>
|
||||
<spacer flex="1"/>
|
||||
<hbox>
|
||||
<button style="margin-left: 50px;" id="qa-mainwindow-previousButton" label="Previous"
|
||||
oncommand="litmus.prevButton()"/>
|
||||
<button id="qa-mainwindow-nextButton" label="Next (Submit)" oncommand="litmus.nextButton()"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="My Test Stats" />
|
||||
<label id="qa-litmus-stats" value=""/>
|
||||
<script type="application/x-javascript">
|
||||
this.addEventListener('load', litmus.loadStats, false);
|
||||
</script>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
</overlay>
|
@ -1,120 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var qmo = {
|
||||
populateFields : function() {
|
||||
qmo.populateForumPosts();
|
||||
qmo.populateEvents();
|
||||
qmo.populateQMONews();
|
||||
qmo.populateHowHelp();
|
||||
},
|
||||
populateForumPosts : function() {
|
||||
var numPosts = 5; // show top 5 topics
|
||||
var postBox = $('qa-qmo-forumposts');
|
||||
qaTools.showHideLoadingMessage(postBox, true);
|
||||
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.forum_topics");
|
||||
var callback = function(feed) {
|
||||
var items = feed.items;
|
||||
qaTools.showHideLoadingMessage(postBox, false);
|
||||
if (items.length < numPosts)
|
||||
numPosts=items.length;
|
||||
for (var i=0; i<numPosts; i++) {
|
||||
var item = items.queryElementAt(i, Ci.nsIFeedEntry);
|
||||
if (item != null) {
|
||||
qmo.populateLinkBox(postBox,
|
||||
[{text : item.title.plainText(), url : item.link.resolve("")}]);
|
||||
}
|
||||
}
|
||||
};
|
||||
qaTools.fetchFeed(url, callback);
|
||||
},
|
||||
populateEvents : function() {
|
||||
var numEvents = 5; // show 5 events
|
||||
var eventBox = $('qa-qmo-events');
|
||||
qaTools.showHideLoadingMessage(eventBox, true);
|
||||
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.upcomingEvents");
|
||||
var callback = function(feed) {
|
||||
var items = feed.items;
|
||||
qaTools.showHideLoadingMessage(eventBox, false);
|
||||
if (items.length < numEvents)
|
||||
numEvents=items.length;
|
||||
for (var i=0; i<numEvents; i++) {
|
||||
var item = items.queryElementAt(i, Ci.nsIFeedEntry);
|
||||
if (item != null) {
|
||||
qmo.populateLinkBox(eventBox,
|
||||
[{text : item.title.plainText(), url : item.link.resolve("")}]);
|
||||
}
|
||||
}
|
||||
};
|
||||
qaTools.fetchFeed(url, callback);
|
||||
},
|
||||
populateQMONews : function() {
|
||||
var box = $('qa-qmo-latest');
|
||||
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.news");
|
||||
qaTools.showHideLoadingMessage(box, true);
|
||||
var callback = function(feed) {
|
||||
var items = feed.items;
|
||||
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
|
||||
qaTools.showHideLoadingMessage(box, false);
|
||||
if (item != null) { // just grab the first item
|
||||
var content = item.summary;
|
||||
var fragment = content.createDocumentFragment(box);
|
||||
|
||||
box.appendChild(fragment);
|
||||
}
|
||||
qaTools.assignLinkHandlers(box);
|
||||
}
|
||||
qaTools.fetchFeed(url, callback);
|
||||
},
|
||||
populateHowHelp : function() {
|
||||
var box = $('qa-qmo-help');
|
||||
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.howhelp");
|
||||
qaTools.showHideLoadingMessage(box, true);
|
||||
var callback = function(feed) {
|
||||
var items = feed.items;
|
||||
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
|
||||
qaTools.showHideLoadingMessage(box, false);
|
||||
if (item != null) { // just grab the first item
|
||||
var content = item.summary;
|
||||
var fragment = content.createDocumentFragment(box);
|
||||
|
||||
box.appendChild(fragment);
|
||||
}
|
||||
qaTools.assignLinkHandlers(box);
|
||||
}
|
||||
qaTools.fetchFeed(url, callback);
|
||||
},
|
||||
populateLinkBox : function(box, links, chars) {
|
||||
var list = box.childNodes[1];
|
||||
for (var i=0; i<links.length; i++) {
|
||||
var elem = list.appendChild(document.createElementNS(qaMain.htmlNS,"li"));
|
||||
var a = elem.appendChild(document.createElementNS(qaMain.htmlNS,"a"));
|
||||
|
||||
// limit text to chars characters:
|
||||
var text = links[i].text;
|
||||
if (chars && chars>0 && text.length > chars) {
|
||||
a.setAttribute("tooltiptext", text);
|
||||
text = text.substring(0, chars-3)+"...";
|
||||
}
|
||||
|
||||
a.textContent = text;
|
||||
a.href = links[i].url;
|
||||
qaTools.assignLinkHandler(a);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function $() {
|
||||
var elements = new Array();
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = arguments[i];
|
||||
if (typeof element == 'string')
|
||||
element = document.getElementById(element);
|
||||
if (arguments.length == 1)
|
||||
return element;
|
||||
|
||||
elements.push(element);
|
||||
}
|
||||
return elements;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa-qmo-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
|
||||
|
||||
<script type="application/x-javascript">
|
||||
window.addEventListener('load', qmo.populateFields, false)
|
||||
</script>
|
||||
|
||||
<tabpanel id="qa-tab-qmo">
|
||||
<vbox flex="1">
|
||||
<hbox>
|
||||
<html:a href="http://quality.mozilla.org" target="blank">
|
||||
<image src='chrome://qa/skin/qmo-badge.png'
|
||||
style='max-width: 75px; max-height: 31px;
|
||||
margin-top: 3px; margin-left: 3px;' />
|
||||
</html:a>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<groupbox>
|
||||
<caption label="&qa.qmo.help;" />
|
||||
<div xmlns="http://www.w3.org/1999/xhtml"
|
||||
id="qa-qmo-help" crop="end">
|
||||
</div>
|
||||
</groupbox>
|
||||
<groupbox flex="1">
|
||||
<caption label="&qa.qmo.events;" />
|
||||
<div xmlns="http://www.w3.org/1999/xhtml"
|
||||
id="qa-qmo-events" flex="1" crop="end">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</groupbox>
|
||||
</hbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&qa.qmo.forumposts;" />
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" id="qa-qmo-forumposts" crop="end" flex="1">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="qa-qmo-latestbox" flex="1">
|
||||
<caption label="&qa.qmo.thelatest;" />
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" id="qa-qmo-latest" crop="end" flex="1" overflow="auto">
|
||||
</div>
|
||||
</groupbox>
|
||||
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
|
||||
</overlay>
|
@ -1,103 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
var updateFunction;
|
||||
var handleCancel;
|
||||
var handleOK;
|
||||
var sTestrunsWrapper; // an array of things that are kind of like testruns,
|
||||
// but w/o important fields.
|
||||
//returned by "test_runs_by_branch_product_name="
|
||||
|
||||
var sTestrun; // actual testrun
|
||||
var sTestgroup;
|
||||
function handleLoad() {
|
||||
|
||||
if (window.arguments.length > 0) {
|
||||
updateFunction = window.arguments[0]; // parent window passes in a function to update itself with data
|
||||
handleCancel = window.arguments[1]; // parent window passes in a function to restore state if dialog canceled
|
||||
handleOK = window.arguments[2]; // you get the idea
|
||||
}
|
||||
litmus.getTestruns(populateTestRuns);
|
||||
}
|
||||
|
||||
function handleRunSelect() {
|
||||
var id = $("qa-st-testrun").selectedItem.getAttribute("value");
|
||||
if (id == "") return;
|
||||
// oddly, this check doesn't seem necessary in the other handlers...
|
||||
litmus.getTestrun(id, populateTestGroups);
|
||||
}
|
||||
|
||||
function handleTestgroupSelect() {
|
||||
var id = document.getElementById("qa-st-testgroup").selectedItem.value;
|
||||
litmus.getTestgroup(id, populateSubgroups);
|
||||
}
|
||||
|
||||
function handleSubgroupSelect() {
|
||||
var id = document.getElementById("qa-st-subgroup").selectedItem.value;
|
||||
updateCaller(sTestrun.name, sTestgroup.name, id, 0);
|
||||
}
|
||||
|
||||
function populateTestRuns(testrunsWrapper) {
|
||||
var menu = document.getElementById("qa-st-testrun");
|
||||
testrunsWrapper = qaTools.arrayify(testrunsWrapper);
|
||||
sTestrunsWrapper = testrunsWrapper;
|
||||
|
||||
while (menu.firstChild) { // clear menu
|
||||
menu.removeChild(menu.firstChild);
|
||||
}
|
||||
|
||||
for (var i = 0; i < testrunsWrapper.length; i++) {
|
||||
if (testrunsWrapper[i].enabled == 0) continue;
|
||||
var item = menu.appendItem(testrunsWrapper[i].name,
|
||||
testrunsWrapper[i].test_run_id);
|
||||
}
|
||||
menu.selectedIndex = 0;
|
||||
handleRunSelect();
|
||||
}
|
||||
|
||||
function populateTestGroups(testrun) {
|
||||
sTestrun = testrun;
|
||||
var menu = document.getElementById("qa-st-testgroup");
|
||||
while (menu.firstChild) { // clear menu
|
||||
menu.removeChild(menu.firstChild);
|
||||
}
|
||||
|
||||
var testgroups = qaTools.arrayify(testrun.testgroups);
|
||||
for (var i = 0; i < testgroups.length; i++) {
|
||||
if (testgroups[i].enabled == 0) continue;
|
||||
menu.appendItem(testgroups[i].name, testgroups[i].testgroup_id);
|
||||
}
|
||||
menu.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function populateSubgroups(testgroup) {
|
||||
sTestgroup = testgroup;
|
||||
var menu = document.getElementById("qa-st-subgroup");
|
||||
while (menu.firstChild) { // clear menu
|
||||
menu.removeChild(menu.firstChild);
|
||||
}
|
||||
var subgroups = qaTools.arrayify(testgroup.subgroups);
|
||||
|
||||
for (var i = 0; i < subgroups.length; i++) {
|
||||
if (subgroups[i].enabled == 0) continue;
|
||||
menu.appendItem(subgroups[i].name, subgroups[i].subgroup_id);
|
||||
}
|
||||
menu.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function OK() {
|
||||
handleOK();
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateCaller(testrunSummary, testgroupSummary, subgroupID, index) {
|
||||
litmus.writeStateToPref(testrunSummary, testgroupSummary, subgroupID, index);
|
||||
updateFunction();
|
||||
}
|
||||
|
||||
function Cancel() {
|
||||
handleCancel();
|
||||
return true;
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!DOCTYPE dialog PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
[<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://qa/skin/" type="text/css"?>
|
||||
|
||||
<dialog id="dialog-name"
|
||||
title="&qa.selecttests.header;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
persist="screenX screenY width height"
|
||||
buttons="accept,cancel"
|
||||
ondialogaccept="return OK();"
|
||||
ondialogcancel="return Cancel();"
|
||||
onload="handleLoad();">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/qa.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/common.js" />
|
||||
<script type="application/x-javascript" src="chrome://qa/content/tabs/selecttests.js" />
|
||||
|
||||
<vbox flex="1">
|
||||
<hbox>
|
||||
<description flex="1"> Please select a Test Run, Group and Subgroup. Your selections will show
|
||||
changes in the main Mozilla QA Companion, but will only take effect if you press the "OK" button.
|
||||
Pressing "Cancel" will take you back to your previous tests.</description>
|
||||
</hbox>
|
||||
<spacer height="10" />
|
||||
<hbox>
|
||||
<description value="Test Run:" />
|
||||
<menulist label=" " id="qa-st-testrun" onselect="handleRunSelect()">
|
||||
<menupopup >
|
||||
<menuitem label="&qa.selecttests.load;" selected="true" />
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<spacer height="10" />
|
||||
<hbox flex="1">
|
||||
<vbox>
|
||||
<description value="Test Group:" />
|
||||
<listbox id="qa-st-testgroup"
|
||||
onselect="handleTestgroupSelect()" flex="1">
|
||||
<listitem label="&qa.selecttests.load;"/>
|
||||
</listbox>
|
||||
</vbox>
|
||||
<vbox flex="1">
|
||||
<description value="Test Subgroup:" />
|
||||
<listbox id="qa-st-subgroup"
|
||||
onselect="handleSubgroupSelect()" flex="1">
|
||||
<listitem label="&qa.selecttests.load;" flex="1"/>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</dialog>
|
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
|
||||
]>
|
||||
|
||||
<overlay id="qa-settings-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_qa" src="chrome://qa/locale/qa.properties" />
|
||||
</stringbundleset>
|
||||
|
||||
<tabpanel id="qa-tab-settings">
|
||||
<vbox flex="1">
|
||||
<groupbox>
|
||||
<caption label="&qa.preferences.litmus.title;" />
|
||||
<hbox>
|
||||
<label control="qa-preferences-litmus-username"
|
||||
value="&qa.preferences.litmus.username;" width="60px" />
|
||||
<textbox id="qa-preferences-litmus-username" size="35" width="250px" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label control="qa-preferences-litmus-password"
|
||||
value="&qa.preferences.litmus.password;" width="60px" />
|
||||
<textbox id="qa-preferences-litmus-password" type="password" size="35" width="250px" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button style="margin-left: 50px;"
|
||||
id="qa-preferences-litmus-createAccount"
|
||||
label="&qa.preferences.litmus.createAccount;"
|
||||
oncommand="qaPrefsWindow.createAccount();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="qa-prefs-notify" flex="1" hidden="true">
|
||||
<caption label="&qa.preferences.notification.title;" />
|
||||
<description>&qa.preferences.notification.header;</description>
|
||||
<checkbox id="qa-prefs-notify-testday"
|
||||
label="&qa.preferences.notification.testday;" />
|
||||
<checkbox id="qa-prefs-notify-bugday"
|
||||
label="&qa.preferences.notification.bugday;" />
|
||||
<checkbox id="qa-prefs-notify-prerelease"
|
||||
label="&qa.preferences.notification.prerelease;" />
|
||||
<checkbox id="qa-prefs-notify-qmo"
|
||||
label="&qa.preferences.notification.qmo;" />
|
||||
<checkbox id="qa-prefs-notify-newbuild"
|
||||
label="&qa.preferences.notification.newbuild;" />
|
||||
<checkbox id="qa-prefs-notify-other"
|
||||
label="&qa.preferences.notification.other;" />
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
</overlay>
|
@ -1,185 +0,0 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<!ENTITY qa.litmus.title "Litmus">
|
||||
<!ENTITY qa.litmus.selecttests "Select/Change Tests">
|
||||
<!ENTITY qa.litmus.testlist.initiallabel "No tests loaded, select some tests!">
|
||||
<!ENTITY qa.litmus.testlist.initialdescription "No testcase">
|
||||
<!ENTITY qa.statusbar.label "QA">
|
||||
<!ENTITY qa.mainwindow.prefs "Preferences">
|
||||
<!ENTITY qa.mainwindow.title "Mozilla QA Companion">
|
||||
<!ENTITY qa.testcase.steps "Steps to Perform">
|
||||
<!ENTITY qa.testcase.expected "Expected Results">
|
||||
<!ENTITY qa.testcase.result.pass "Passed">
|
||||
<!ENTITY qa.testcase.result.fail "Failed">
|
||||
<!ENTITY qa.testcase.result.unclearbroken "Unclear or Broken">
|
||||
<!ENTITY qa.testcase.comment "Comment (optional):">
|
||||
|
||||
<!ENTITY qa.selecttests.load "Loading...">
|
||||
<!ENTITY qa.selecttests.header "Select Tests To Run">
|
||||
|
||||
<!ENTITY qa.preferences.title "Settings">
|
||||
<!ENTITY qa.preferences.litmus.title "Litmus Settings">
|
||||
<!ENTITY qa.preferences.litmus.username "Email:">
|
||||
<!ENTITY qa.preferences.litmus.password "Password:">
|
||||
<!ENTITY qa.preferences.litmus.OK "Save">
|
||||
<!ENTITY qa.preferences.litmus.createAccount "Create/Update Account">
|
||||
|
||||
<!ENTITY qa.preferences.notification.title "Notification Settings">
|
||||
<!ENTITY qa.preferences.notification.disableall "Disable all notifications">
|
||||
<!ENTITY qa.preferences.notification.header "Notify me when:">
|
||||
<!ENTITY qa.preferences.notification.testday "Mozilla QA is holding a Test Day event">
|
||||
<!ENTITY qa.preferences.notification.bugday "Mozilla QA is holding a Bug Day event">
|
||||
<!ENTITY qa.preferences.notification.prerelease "I can help test pre-releases (alpha, beta, etc.)">
|
||||
<!ENTITY qa.preferences.notification.qmo "There is new news from QMO (quality.mozilla.org)">
|
||||
<!ENTITY qa.preferences.notification.newbuild "New releases/builds of Firefox are recommended">
|
||||
<!ENTITY qa.preferences.notification.other "There is a special Mozilla QA announcement">
|
||||
|
||||
<!ENTITY qa.qmo.title "QMO">
|
||||
<!ENTITY qa.qmo.visit "Visit QMO">
|
||||
<!ENTITY qa.qmo.help "How you can help!">
|
||||
<!ENTITY qa.qmo.events "Upcoming events">
|
||||
<!ENTITY qa.qmo.forumposts "Recent forum topics">
|
||||
<!ENTITY qa.qmo.thelatest "The latest from QMO">
|
||||
|
||||
<!ENTITY qa.setup.title "Mozilla QA Companion: Setup">
|
||||
<!ENTITY qa.setup.welcomeheader "Welcome to the Mozilla QA Companion!">
|
||||
<!ENTITY qa.setup.welcometext "
|
||||
<html:h4>It's the easiest way to stay connected and participate in the Mozilla QA community...</html:h4>
|
||||
Mozilla Quality Assurance (QA) is a network of countless volunteers
|
||||
from the Internet community, along with a group of Mozilla employees, who share
|
||||
the common mission of <html:b>taming the Lizard</html:b> through testing and
|
||||
constructively reporting bugs in Mozilla products.
|
||||
<html:br/><html:br/>
|
||||
This extension allows you to <html:b>find bugs</html:b> in Mozilla products by
|
||||
running simple tests within the browser. Helping out doesn't take up much of
|
||||
your time, doesn't require any special skills, and helps to improve Mozilla
|
||||
products like Firefox and Thunderbird.
|
||||
<html:br/><html:br/>
|
||||
When you find a bug, this extension helps you to <html:b>report it</html:b>
|
||||
to <html:a href='http://litmus.mozilla.org/' style='color: #0067ac;' target='_blank'>Litmus</html:a>,
|
||||
the tool we use to track our testing efforts. You can even <html:b>search for bugs</html:b> and
|
||||
learn more about them through <html:a href='http://bugzilla.mozilla.org/' style='color: #0067ac;'
|
||||
target='_blank'>Bugzilla</html:a>, our bug tracking tool. Your test results and bug reports are valuable,
|
||||
and we use them to ensure that all features work properly across a wide range
|
||||
of platforms, operating systems, and configurations.
|
||||
|
||||
<html:h4>Why should I get involved?</html:h4>
|
||||
If you're a fan of Firefox and want to help us make it even better, the
|
||||
easiest way to get involved is to <html:b>help us test</html:b>! The Mozilla QA team and
|
||||
community play an important role in making sure millions of people have the
|
||||
best Web experience possible... so what are you waiting for? Join the Mozilla
|
||||
QA community now!
|
||||
|
||||
<html:h5>For more information, please visit the home of Mozilla QA at
|
||||
<html:a href='http://quality.mozilla.org' style='color: #0067ac;' target='_blank'>
|
||||
quality.mozilla.org (QMO)</html:a>.</html:h5>
|
||||
">
|
||||
|
||||
<!ENTITY qa.setup.aboutheader "About the Mozilla QA Companion">
|
||||
<!ENTITY qa.setup.abouttext "
|
||||
<html:h4>How do I get started?</html:h4>
|
||||
Getting started with Mozilla QA is easy! This setup wizard will ask you a
|
||||
few simple questions. Once that's done, you'll be able to use the Litmus tab,
|
||||
where you can select what you want to test, run those tests, and submit your
|
||||
results to Litmus. You can also search for bugs or see all the bugs reported today in
|
||||
the Bugzilla tab. To meet others and interact with the Mozilla QA team and community you
|
||||
can connect to IRC using the Chat tab. You'll also have a chance to learn more about
|
||||
Mozilla QA through regular updates and news on the QMO tab. It's all integrated into
|
||||
the Mozilla QA Companion!
|
||||
|
||||
<html:h4>A note on privacy</html:h4>
|
||||
When you use the Mozilla QA Companion, you're submitting test results to an
|
||||
open system. Other members of the community will access the information you
|
||||
submit in order to improve the quality of Mozilla products. You
|
||||
<html:b>should not</html:b> submit any private or confidential information
|
||||
using the Mozilla QA Companion. If you provide your real name or an IRC nickname
|
||||
to display instead, we'll hide your email address from
|
||||
public view to help prevent email harvesting bots from spamming you.
|
||||
For more information, please see our
|
||||
<html:a href='http://www.mozilla.com/privacy-policy.html' style='color: #0067ac;' target='_blank'>
|
||||
Privacy Policy</html:a>.
|
||||
|
||||
<html:h4>Welcome to the Mozilla QA community... Let's get started!</html:h4>
|
||||
">
|
||||
|
||||
<!ENTITY qa.setup.accountheader "Creating a Litmus account">
|
||||
<!ENTITY qa.setup.accounttext "To use the Mozilla QA Companion, you will need an account
|
||||
on Litmus, our test management system.">
|
||||
<!ENTITY qa.setup.haveaccount "Do you already have a Litmus account?">
|
||||
<!ENTITY qa.setup.accountno "I do not have a Litmus account">
|
||||
<!ENTITY qa.setup.accountyes "I already have a Litmus account">
|
||||
<!ENTITY qa.setup.accountyes.enterinfo "Enter your Litmus account information and then press
|
||||
the 'Continue' button.">
|
||||
<!ENTITY qa.setup.accountno.text "Complete the form below and press the
|
||||
<html:b>Create Account</html:b> button to create your new account. Once your
|
||||
account is created, press the 'Continue' button to complete setup.">
|
||||
<!ENTITY qa.setup.createfail "Note: If you have problems creating your Litmus account, just press the
|
||||
'Go Back' button and then 'Continue' to return to this window and try again.">
|
||||
|
||||
<!ENTITY qa.setup.accountdone "
|
||||
<html:h4>Congratulations!</html:h4>
|
||||
Your Litmus account has been created. You'll be able to use your new account both here in
|
||||
the Mozilla QA Companion and on the
|
||||
<html:a href='http://litmus.mozilla.org/' style='color: #0067ac;' target='_blank'>Litmus</html:a> website.
|
||||
|
||||
<html:h4>That's it! You're ready to start testing.</html:h4>
|
||||
If you have any questions along the way, please post to the
|
||||
<html:a href='http://quality.mozilla.org/forums' style='color: #0067ac;' target='_blank'>QMO Forums
|
||||
</html:a> or join us on
|
||||
<html:a href='http://irc.mozilla.org' style='color: #0067ac;' target='_blank'>IRC</html:a>.
|
||||
We are in #qa on irc.mozilla.org. You can click the 'Join IRC Now' button in the Chat tab or if
|
||||
you have an IRC client installed already, you can just click this link:
|
||||
<html:a href='irc://irc.mozilla.org/qa' style='color: #0067ac;'>join #qa</html:a>.
|
||||
">
|
||||
|
||||
<!ENTITY qa.setup.sysconfig.header "System Configuration">
|
||||
<!ENTITY qa.setup.sysconfig.text "
|
||||
For your test results to be useful, we need to know a little bit about your
|
||||
system configuration. We've tried to detect as much of the information below as
|
||||
possible, but please check the settings below and make any necessary changes.
|
||||
">
|
||||
<!ENTITY qa.setup.sysconfig.platform "Platform:">
|
||||
<!ENTITY qa.setup.sysconfig.opsys "Operating System:">
|
||||
|
||||
<!ENTITY qa.setup.finish.header "Setup Complete">
|
||||
|
||||
<!ENTITY qa.bugzilla.title "Bugzilla">
|
||||
|
||||
<!ENTITY qa.chat.title "Chat">
|
||||
<!ENTITY qa.chat.introtitle "What is IRC?">
|
||||
<!ENTITY qa.chat.intro "Internet Relay Chat (IRC) is the living room of the Mozilla QA Community.
|
||||
IRC is a place to ask questions, learn how you can help with the next versions of Firefox and Thunderbird,
|
||||
and meet other members of the community. Many of the regular QA events happen over IRC,
|
||||
such as Test Days and Bug Days. Come join us on IRC!">
|
||||
<!ENTITY qa.chat.intro2 "If you have a favorite IRC client, you can connect to <html:em>irc.mozilla.org</html:em>, channel #qa, but the easist way to get on IRC right now is through your web browser. Just click the button below.">
|
||||
<!ENTITY qa.chat.howdoItitle "How do I get on IRC?">
|
||||
<!ENTITY qa.chat.howdoI.imo "Learn more about irc.mozilla.org">
|
||||
<!ENTITY qa.chat.howdoI.imourl "http://irc.mozilla.org">
|
||||
<!ENTITY qa.chat.howdoI.irchelp "Visit irchelp.org">
|
||||
<!ENTITY qa.chat.howdoI.irchelpurl "http://www.irchelp.org">
|
||||
<!ENTITY qa.chat.howdoI.joinnow "Join IRC Now">
|
||||
|
||||
<!ENTITY qa.help.title "Help">
|
||||
<!ENTITY qa.help.helptitle "Mozilla QA Help">
|
||||
<!ENTITY qa.help.intro "
|
||||
Visit <html:a href='http://quality.mozilla.org/' style='color: #0067ac;' target='_blank'>
|
||||
QMO</html:a>, the home of Mozilla QA, for more information about what's happening with the community. Here are a few useful links:<html:br></html:br><html:br></html:br>
|
||||
<html:ul>
|
||||
<html:li><html:a href='http://quality.mozilla.org/qac' style='color: #0067ac;' target='_blank'>QA Companion Home</html:a></html:li>
|
||||
<html:li><html:a href='http://quality.mozilla.org/events' style='color: #0067ac;' target='_blank'>Community Events</html:a></html:li>
|
||||
<html:li><html:a href='http://quality.mozilla.org/forums' style='color: #0067ac;' target='_blank'>Discussion Forums</html:a></html:li>
|
||||
</html:ul>
|
||||
<html:h4>Litmus</html:h4>
|
||||
The Litmus tab is great for running a few quick tests, but visit <html:a href='http://litmus.mozilla.org/' style='color: #0067ac;'
|
||||
target='_blank'>Litmus</html:a> for detailed information about test cases and community activity through the Web interface. Make sure to read
|
||||
the <html:a href='http://quality.mozilla.org/litmus' style='color: #0067ac;' target='_blank'>Litmus Tutorial</html:a>.
|
||||
<html:h4>Bugzilla</html:h4>
|
||||
The Bugzilla tab allows you to run a few basic searches, but visit <html:a href='http://bugzilla.mozilla.org/' style='color: #0067ac;'
|
||||
target='_blank'>Bugzilla</html:a> to learn more about how we handle bugs, run advanced searches or work with bugs directly.
|
||||
">
|
||||
|
||||
<!ENTITY qa.notification.inprogress "Come Join! Event in Progress Now!">
|
||||
<!ENTITY qacompanionMenu.accesskey "Q">
|
||||
<!ENTITY qacompanionMenu.label "QA Companion">
|
@ -1,15 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
qa.extension.testcase.head = Testcase #
|
||||
qa.extension.prefs.loginError = Login Error. Please check your username and password or create a new account.
|
||||
qa.extension.prefs.loadingMsg = Validating account information. Please Wait...
|
||||
qa.extension.prefs.savedMsg = Your settings have been saved
|
||||
qa.extension.sysconfig.loadingMsg = Loading menu options...
|
||||
qa.extension.loading = Loading...
|
||||
qa.extension.litmus.progress = Now Testing %1$S of %2$S
|
||||
qa.extension.litmus.stats = Tests Completed - Week: %1$S, Month: %2$S, All Time: %3$S
|
||||
qa.getpassword.title = Login to Litmus
|
||||
qa.getpassword.message = Enter the login information for your Litmus Account
|
||||
qa.getpassword.tryagainmessage = Incorrect login information. Please enter the email address and password for your Litmus Account, if you have forgotten it, ask on IRC in #qa to have it reset.
|
@ -1,9 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
qa.extension.url.qmo.upcomingEvents = http://quality.mozilla.org/extension/upcomingevents_feed
|
||||
qa.extension.url.qmo.news = http://quality.mozilla.org/rss.xml
|
||||
qa.extension.url.qmo.forum_topics = http://quality.mozilla.org/extension/forum_topics
|
||||
qa.extension.url.qmo.howhelp = http://quality.mozilla.org/extension/howtohelp_feed
|
||||
qa.extension.url.bz.content = http://quality.mozilla.org/extension/bugzillatab_feed
|
@ -1,32 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#qa-notify {
|
||||
right: 18px;
|
||||
bottom: 21px;
|
||||
position: fixed;
|
||||
border: 1px solid grey;
|
||||
background-color: white;
|
||||
background-image: url("chrome://qa/skin/logolight.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.qa-notify {
|
||||
height: 140px;
|
||||
width: 420px;
|
||||
}
|
||||
|
||||
#qa-notify-box {
|
||||
padding: 0px 6px 6px 6px;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#qa-notify-header {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#qa-statusbar-overlay {
|
||||
list-style-image: url('chrome://qa/skin/qmo-16px.png');
|
||||
}
|
Before Width: | Height: | Size: 63 B |
Before Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 473 B |
Before Width: | Height: | Size: 3.0 KiB |
@ -1,197 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
@import url(chrome://global/skin/);
|
||||
|
||||
@namespace html "http://www.w3.org/1999/xhtml";
|
||||
|
||||
#qa-pass {
|
||||
background: #99ff99;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*-------------------------------
|
||||
HTML
|
||||
-------------------------------*/
|
||||
|
||||
#qa_tabbox html|ul, #qa_tabbox html|ol {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#qa_tabbox html|ul li {
|
||||
list-style-type: square;
|
||||
margin-bottom: 0.4em;
|
||||
}
|
||||
|
||||
#qa_tabbox html|a,
|
||||
#qa_tabbox html|a:link,
|
||||
#qa_tabbox html|a:visited {
|
||||
font-weight: bold;
|
||||
color: #0067ac;
|
||||
}
|
||||
#qa_tabbox html|a:focus,
|
||||
#qa_tabbox html|a:hover,
|
||||
#qa_tabbox html|a:active {
|
||||
color: #333;
|
||||
}
|
||||
/*remove bullets for everything but lists contained inside testcase data */
|
||||
html|li {
|
||||
list-style-type: none !important;
|
||||
}
|
||||
#qa-tab-litmus html|ul html|li {
|
||||
list-style-type: disc !important;
|
||||
}
|
||||
#qa-tab-litmus html|ol html|li {
|
||||
list-style-type: decimal !important;
|
||||
}
|
||||
|
||||
#qa-tab-litmus html|ul, #qa-tab-litmus html|ol {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------
|
||||
TABS
|
||||
-------------------------------*/
|
||||
#qa_tabbox #qa_tabrow {
|
||||
height: 30px !important;
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
|
||||
#qa_tabbox .tab-icon-image {
|
||||
list-style-image: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
#qa_tabbox #qa-tabbar-qmo {
|
||||
list-style-image: url(qmo-16px.png);
|
||||
text-align: right;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
#qa_tabbox #qa-tabbar-spacer {
|
||||
width: 93px;
|
||||
}
|
||||
|
||||
|
||||
#qa_tabbox tab, #qa_tabbox tabs spacer {
|
||||
border-bottom: 1px solid #ACA899 !important;
|
||||
}
|
||||
|
||||
.tabs-left, .tabs-right {
|
||||
-moz-border-bottom-colors: #ACA899 !important;
|
||||
}
|
||||
|
||||
#qa_tabbox tab[selected="true"] {
|
||||
border-bottom: 1px solid #E8E5D8 !important;
|
||||
}
|
||||
|
||||
tabs {
|
||||
border-bottom: 1px solid #E8E5D8;
|
||||
}
|
||||
|
||||
.tab-close-button {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab.highlight > .tab-image-right {
|
||||
background: url("chrome://qa/skin/highlight-start.png") no-repeat !important;
|
||||
}
|
||||
.tabbrowser-tab.highlight > .tab-image-left {
|
||||
background: url("chrome://qa/skin/highlight-end.png") no-repeat !important;
|
||||
}
|
||||
.tabbrowser-tab.highlight > .tab-image-middle {
|
||||
background: url("chrome://qa/skin/highlight-mid.png") repeat-x !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab.highlight:hover > .tab-image-right {
|
||||
background: url("chrome://qa/skin/highlight-hover-start.png") no-repeat !important;
|
||||
}
|
||||
.tabbrowser-tab.highlight:hover > .tab-image-left {
|
||||
background: url("chrome://qa/skin/highlight-hover-end.png") no-repeat !important;
|
||||
}
|
||||
.tabbrowser-tab.highlight:hover > .tab-image-middle {
|
||||
background: url("chrome://qa/skin/highlight-hover-mid.png") repeat-x !important;
|
||||
}
|
||||
|
||||
/* don't show outline around the middle of selected tabs */
|
||||
tab:focus > .tab-middle {
|
||||
outline: 1px none invert !important;
|
||||
}
|
||||
|
||||
/*-------------------------------
|
||||
PANELS
|
||||
-------------------------------*/
|
||||
#qa_tabbox tabpanel {
|
||||
line-height: 1.6;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#qa_tabbox tabpanels {
|
||||
background-color: white;
|
||||
border-top: 1px solid #ACA899;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
#qa_tabbox groupbox {
|
||||
background-color: white;
|
||||
}
|
||||
#qa_tabbox caption {
|
||||
font: bold 12px helvetica, arial, sans-serif;
|
||||
color: #ec891d;
|
||||
background-color: white;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#qa-qmo-help,
|
||||
#qa-qmo-events,
|
||||
#qa-qmo-forumposts,
|
||||
.box-mheight {
|
||||
}
|
||||
|
||||
#qa-qmo-latestbox,
|
||||
#qa-qmo-latest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------
|
||||
NOTIFY
|
||||
-------------------------------*/
|
||||
|
||||
#qa-notify {
|
||||
right: 18px;
|
||||
bottom: 21px;
|
||||
position: fixed;
|
||||
border: 1px solid grey;
|
||||
background-color: white;
|
||||
background-image: url("logolight.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.qa-notify {
|
||||
height: 140px;
|
||||
width: 420px;
|
||||
}
|
||||
|
||||
#qa-notify-box {
|
||||
padding: 0px 6px 6px 6px;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#qa-notify-header {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------
|
||||
GENERAL
|
||||
-------------------------------*/
|
||||
|
||||
.list {
|
||||
padding-left: 10px;
|
||||
}
|
Before Width: | Height: | Size: 642 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1017 B |
Before Width: | Height: | Size: 738 B |
Before Width: | Height: | Size: 234 B |
@ -1,451 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*
|
||||
* This file contains the following chatzilla related components:
|
||||
* 1. Command line handler service, for responding to the -chat command line
|
||||
* option. (CLineHandler)
|
||||
* 2. Content handlers for responding to content of type x-application-irc[s]
|
||||
* (IRCContentHandler)
|
||||
* 3. Protocol handler for supplying a channel to the browser when an irc://
|
||||
* or ircs:// link is clicked. (IRCProtocolHandler)
|
||||
* 4. A (nearly empty) implementation of nsIChannel for telling the browser
|
||||
* that irc:// links have the content type x-application-irc[s] (BogusChannel)
|
||||
*/
|
||||
|
||||
/* components defined in this file */
|
||||
const CLINE_SERVICE_CONTRACTID =
|
||||
"@mozilla.org/commandlinehandler/general-startup;1?type=chat";
|
||||
const CLINE_SERVICE_CID =
|
||||
Components.ID("{38a95514-1dd2-11b2-97e7-9da958640f2c}");
|
||||
const IRCPROT_HANDLER_CONTRACTID =
|
||||
"@mozilla.org/network/protocol;1?name=irc";
|
||||
const IRCSPROT_HANDLER_CONTRACTID =
|
||||
"@mozilla.org/network/protocol;1?name=ircs";
|
||||
const IRCPROT_HANDLER_CID =
|
||||
Components.ID("{f21c35f4-1dd1-11b2-a503-9bf8a539ea39}");
|
||||
const IRCSPROT_HANDLER_CID =
|
||||
Components.ID("{f21c35f4-1dd1-11b2-a503-9bf8a539ea3a}");
|
||||
|
||||
const IRC_MIMETYPE = "application/x-irc";
|
||||
const IRCS_MIMETYPE = "application/x-ircs";
|
||||
|
||||
|
||||
/* components used in this file */
|
||||
const MEDIATOR_CONTRACTID =
|
||||
"@mozilla.org/appshell/window-mediator;1";
|
||||
const STANDARDURL_CONTRACTID =
|
||||
"@mozilla.org/network/standard-url;1";
|
||||
const IOSERVICE_CONTRACTID =
|
||||
"@mozilla.org/network/io-service;1";
|
||||
const ASS_CONTRACTID =
|
||||
"@mozilla.org/appshell/appShellService;1";
|
||||
const RDFS_CONTRACTID =
|
||||
"@mozilla.org/rdf/rdf-service;1";
|
||||
|
||||
//XXXgijs: Because necko is annoying and doesn't expose this error flag, we
|
||||
// define our own constant for it. Throwing something else will show
|
||||
// ugly errors instead of seeminly doing nothing.
|
||||
const NS_ERROR_MODULE_NETWORK_BASE = 0x804b0000;
|
||||
const NS_ERROR_NO_CONTENT = NS_ERROR_MODULE_NETWORK_BASE + 17;
|
||||
|
||||
/* interfaces used in this file */
|
||||
const nsIWindowMediator = Components.interfaces.nsIWindowMediator;
|
||||
const nsICmdLineHandler = Components.interfaces.nsICmdLineHandler;
|
||||
const nsICategoryManager = Components.interfaces.nsICategoryManager;
|
||||
const nsIURIContentListener = Components.interfaces.nsIURIContentListener;
|
||||
const nsIURILoader = Components.interfaces.nsIURILoader;
|
||||
const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler;
|
||||
const nsIURI = Components.interfaces.nsIURI;
|
||||
const nsIStandardURL = Components.interfaces.nsIStandardURL;
|
||||
const nsIChannel = Components.interfaces.nsIChannel;
|
||||
const nsIRequest = Components.interfaces.nsIRequest;
|
||||
const nsIIOService = Components.interfaces.nsIIOService;
|
||||
const nsIAppShellService = Components.interfaces.nsIAppShellService;
|
||||
const nsISupports = Components.interfaces.nsISupports;
|
||||
const nsISupportsWeakReference = Components.interfaces.nsISupportsWeakReference;
|
||||
const nsIRDFService = Components.interfaces.nsIRDFService;
|
||||
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
|
||||
const nsICommandLine = Components.interfaces.nsICommandLine;
|
||||
|
||||
|
||||
// ChatZilla launcher method
|
||||
function spawnChatZilla(uri, count)
|
||||
{
|
||||
var e;
|
||||
|
||||
var wmClass = Components.classes[MEDIATOR_CONTRACTID];
|
||||
var windowManager = wmClass.getService(nsIWindowMediator);
|
||||
|
||||
var assClass = Components.classes[ASS_CONTRACTID];
|
||||
var ass = assClass.getService(nsIAppShellService);
|
||||
hiddenWin = ass.hiddenDOMWindow;
|
||||
|
||||
// Ok, not starting currently, so check if we've got existing windows.
|
||||
var w = windowManager.getMostRecentWindow("irc:chatzilla");
|
||||
|
||||
// Claiming that a ChatZilla window is loading.
|
||||
if ("ChatZillaStarting" in hiddenWin)
|
||||
{
|
||||
dump("cz-service: ChatZilla claiming to be starting.\n");
|
||||
if (w && ("client" in w) && ("initialized" in w.client) &&
|
||||
w.client.initialized)
|
||||
{
|
||||
dump("cz-service: It lied. It's finished starting.\n");
|
||||
// It's actually loaded ok.
|
||||
delete hiddenWin.ChatZillaStarting;
|
||||
}
|
||||
}
|
||||
|
||||
if ("ChatZillaStarting" in hiddenWin)
|
||||
{
|
||||
count = count || 0;
|
||||
|
||||
if ((new Date() - hiddenWin.ChatZillaStarting) > 10000)
|
||||
{
|
||||
dump("cz-service: Continuing to be unable to talk to existing window!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
//dump("cz-service: **** Try: " + count + ", delay: " + (new Date() - hiddenWin.ChatZillaStarting) + "\n");
|
||||
|
||||
// We have a ChatZilla window, but we're still loading.
|
||||
hiddenWin.setTimeout(function wrapper(count) {
|
||||
spawnChatZilla(uri, count + 1);
|
||||
}, 250, count);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// We have a window.
|
||||
if (w)
|
||||
{
|
||||
dump("cz-service: Existing, fully loaded window. Using.\n");
|
||||
// Window is working and initialized ok. Use it.
|
||||
w.focus();
|
||||
w.gotoIRCURL(uri);
|
||||
return true;
|
||||
}
|
||||
|
||||
dump("cz-service: No windows, starting new one.\n");
|
||||
// Ok, no available window, loading or otherwise, so start ChatZilla.
|
||||
var args = new Object();
|
||||
args.url = uri;
|
||||
|
||||
hiddenWin.ChatZillaStarting = new Date();
|
||||
hiddenWin.openDialog("chrome://chatzilla_qa/content/chatzilla.xul", "_blank",
|
||||
"chrome,menubar,toolbar,status,resizable,dialog=no",
|
||||
args);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Command Line handler service */
|
||||
function CLineService()
|
||||
{}
|
||||
|
||||
/* nsISupports */
|
||||
CLineService.prototype.QueryInterface =
|
||||
function handler_QI(iid)
|
||||
{
|
||||
if (iid.equals(nsISupports))
|
||||
return this;
|
||||
|
||||
if (nsICmdLineHandler && iid.equals(nsICmdLineHandler))
|
||||
return this;
|
||||
|
||||
if (nsICommandLineHandler && iid.equals(nsICommandLineHandler))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
/* nsICmdLineHandler */
|
||||
CLineService.prototype.commandLineArgument = "-chat";
|
||||
CLineService.prototype.prefNameForStartup = "general.startup.chat";
|
||||
CLineService.prototype.chromeUrlForTask = "chrome://chatzilla_qa/content";
|
||||
CLineService.prototype.helpText = "Start with an IRC chat client";
|
||||
CLineService.prototype.handlesArgs = true;
|
||||
CLineService.prototype.defaultArgs = "";
|
||||
CLineService.prototype.openWindowWithArgs = true;
|
||||
|
||||
/* nsICommandLineHandler */
|
||||
CLineService.prototype.handle =
|
||||
function handler_handle(cmdLine)
|
||||
{
|
||||
var args;
|
||||
try
|
||||
{
|
||||
var uristr = cmdLine.handleFlagWithParam("chat", false);
|
||||
if (uristr)
|
||||
{
|
||||
args = new Object();
|
||||
args.url = uristr;
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
}
|
||||
|
||||
if (args || cmdLine.handleFlag("chat", false))
|
||||
{
|
||||
var assClass = Components.classes[ASS_CONTRACTID];
|
||||
var ass = assClass.getService(nsIAppShellService);
|
||||
var hWin = ass.hiddenDOMWindow;
|
||||
hWin.openDialog("chrome://chatzilla_qa/content/", "_blank",
|
||||
"chrome,menubar,toolbar,status,resizable,dialog=no",
|
||||
args);
|
||||
cmdLine.preventDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
CLineService.prototype.helpInfo =
|
||||
" -chat [<ircurl>] Start with an IRC chat client.\n"
|
||||
|
||||
/* factory for command line handler service (CLineService) */
|
||||
var CLineFactory = new Object();
|
||||
|
||||
CLineFactory.createInstance =
|
||||
function (outer, iid)
|
||||
{
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
return new CLineService().QueryInterface(iid);
|
||||
}
|
||||
|
||||
/* irc protocol handler component */
|
||||
function IRCProtocolHandler(isSecure)
|
||||
{
|
||||
this.isSecure = isSecure;
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.protocolFlags =
|
||||
nsIProtocolHandler.URI_NORELATIVE |
|
||||
nsIProtocolHandler.ALLOWS_PROXY;
|
||||
if ("URI_DANGEROUS_TO_LOAD" in nsIProtocolHandler) {
|
||||
IRCProtocolHandler.prototype.protocolFlags |=
|
||||
nsIProtocolHandler.URI_LOADABLE_BY_ANYONE;
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.allowPort =
|
||||
function ircph_allowPort(port, scheme)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.newURI =
|
||||
function ircph_newURI(spec, charset, baseURI)
|
||||
{
|
||||
var cls = Components.classes[STANDARDURL_CONTRACTID];
|
||||
var url = cls.createInstance(nsIStandardURL);
|
||||
url.init(nsIStandardURL.URLTYPE_STANDARD, (this.isSecure ? 9999 : 6667), spec, charset, baseURI);
|
||||
|
||||
return url.QueryInterface(nsIURI);
|
||||
}
|
||||
|
||||
IRCProtocolHandler.prototype.newChannel =
|
||||
function ircph_newChannel(URI)
|
||||
{
|
||||
ios = Components.classes[IOSERVICE_CONTRACTID].getService(nsIIOService);
|
||||
if (!ios.allowPort(URI.port, URI.scheme))
|
||||
throw Components.results.NS_ERROR_FAILURE;
|
||||
|
||||
return new BogusChannel(URI, this.isSecure);
|
||||
}
|
||||
|
||||
/* protocol handler factory object (IRCProtocolHandler) */
|
||||
var IRCProtocolHandlerFactory = new Object();
|
||||
|
||||
IRCProtocolHandlerFactory.createInstance =
|
||||
function ircphf_createInstance(outer, iid)
|
||||
{
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
if (!iid.equals(nsIProtocolHandler) && !iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
var protHandler = new IRCProtocolHandler(false);
|
||||
protHandler.scheme = "irc";
|
||||
protHandler.defaultPort = 6667;
|
||||
return protHandler;
|
||||
}
|
||||
|
||||
/* secure protocol handler factory object (IRCProtocolHandler) */
|
||||
var IRCSProtocolHandlerFactory = new Object();
|
||||
|
||||
IRCSProtocolHandlerFactory.createInstance =
|
||||
function ircphf_createInstance(outer, iid)
|
||||
{
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
if (!iid.equals(nsIProtocolHandler) && !iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
var protHandler = new IRCProtocolHandler(true);
|
||||
protHandler.scheme = "ircs";
|
||||
protHandler.defaultPort = 9999;
|
||||
return protHandler;
|
||||
}
|
||||
|
||||
/* bogus IRC channel used by the IRCProtocolHandler */
|
||||
function BogusChannel(URI, isSecure)
|
||||
{
|
||||
this.URI = URI;
|
||||
this.originalURI = URI;
|
||||
this.isSecure = isSecure;
|
||||
this.contentType = (this.isSecure ? IRCS_MIMETYPE : IRC_MIMETYPE);
|
||||
}
|
||||
|
||||
BogusChannel.prototype.QueryInterface =
|
||||
function bc_QueryInterface(iid)
|
||||
{
|
||||
if (!iid.equals(nsIChannel) && !iid.equals(nsIRequest) &&
|
||||
!iid.equals(nsISupports))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/* nsIChannel */
|
||||
BogusChannel.prototype.loadAttributes = null;
|
||||
BogusChannel.prototype.contentLength = 0;
|
||||
BogusChannel.prototype.owner = null;
|
||||
BogusChannel.prototype.loadGroup = null;
|
||||
BogusChannel.prototype.notificationCallbacks = null;
|
||||
BogusChannel.prototype.securityInfo = null;
|
||||
|
||||
BogusChannel.prototype.open =
|
||||
BogusChannel.prototype.asyncOpen =
|
||||
function bc_open(observer, ctxt)
|
||||
{
|
||||
spawnChatZilla(this.URI.spec);
|
||||
// We don't throw this (a number, not a real 'resultcode') because it
|
||||
// upsets xpconnect if we do (error in the js console).
|
||||
Components.returnCode = NS_ERROR_NO_CONTENT;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.asyncRead =
|
||||
function bc_asyncRead(listener, ctxt)
|
||||
{
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* nsIRequest */
|
||||
BogusChannel.prototype.isPending =
|
||||
function bc_isPending()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.status = Components.results.NS_OK;
|
||||
|
||||
BogusChannel.prototype.cancel =
|
||||
function bc_cancel(status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
BogusChannel.prototype.suspend =
|
||||
BogusChannel.prototype.resume =
|
||||
function bc_suspres()
|
||||
{
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
var ChatzillaModule = new Object();
|
||||
|
||||
ChatzillaModule.registerSelf =
|
||||
function cz_mod_registerSelf(compMgr, fileSpec, location, type)
|
||||
{
|
||||
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
|
||||
var catman = Components.classes["@mozilla.org/categorymanager;1"]
|
||||
.getService(nsICategoryManager);
|
||||
|
||||
debug("*** Registering -chat handler.\n");
|
||||
compMgr.registerFactoryLocation(CLINE_SERVICE_CID,
|
||||
"Chatzilla CommandLine Service",
|
||||
CLINE_SERVICE_CONTRACTID,
|
||||
fileSpec, location, type);
|
||||
catman.addCategoryEntry("command-line-argument-handlers",
|
||||
"chatzilla command line handler",
|
||||
CLINE_SERVICE_CONTRACTID, true, true);
|
||||
catman.addCategoryEntry("command-line-handler",
|
||||
"m-irc",
|
||||
CLINE_SERVICE_CONTRACTID, true, true);
|
||||
|
||||
debug("*** Registering irc protocol handler.\n");
|
||||
compMgr.registerFactoryLocation(IRCPROT_HANDLER_CID,
|
||||
"IRC protocol handler",
|
||||
IRCPROT_HANDLER_CONTRACTID,
|
||||
fileSpec, location, type);
|
||||
|
||||
debug("*** Registering ircs protocol handler.\n");
|
||||
compMgr.registerFactoryLocation(IRCSPROT_HANDLER_CID,
|
||||
"IRCS protocol handler",
|
||||
IRCSPROT_HANDLER_CONTRACTID,
|
||||
fileSpec, location, type);
|
||||
|
||||
debug("*** Registering done.\n");
|
||||
}
|
||||
|
||||
ChatzillaModule.unregisterSelf =
|
||||
function cz_mod_unregisterSelf(compMgr, fileSpec, location)
|
||||
{
|
||||
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
|
||||
|
||||
var catman = Components.classes["@mozilla.org/categorymanager;1"]
|
||||
.getService(nsICategoryManager);
|
||||
catman.deleteCategoryEntry("command-line-argument-handlers",
|
||||
"chatzilla command line handler", true);
|
||||
catman.deleteCategoryEntry("command-line-handler",
|
||||
"m-irc", true);
|
||||
}
|
||||
|
||||
ChatzillaModule.getClassObject =
|
||||
function cz_mod_getClassObject(compMgr, cid, iid)
|
||||
{
|
||||
// Checking if we're disabled in the Chrome Registry.
|
||||
var rv;
|
||||
try {
|
||||
var rdfSvc = Components.classes[RDFS_CONTRACTID].getService(nsIRDFService);
|
||||
var rdfDS = rdfSvc.GetDataSource("rdf:chrome");
|
||||
var resSelf = rdfSvc.GetResource("urn:mozilla:package:chatzilla");
|
||||
var resDisabled = rdfSvc.GetResource("http://www.mozilla.org/rdf/chrome#disabled");
|
||||
rv = rdfDS.GetTarget(resSelf, resDisabled, true);
|
||||
} catch (e) {
|
||||
}
|
||||
if (rv)
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
|
||||
if (cid.equals(CLINE_SERVICE_CID))
|
||||
return CLineFactory;
|
||||
|
||||
if (cid.equals(IRCPROT_HANDLER_CID))
|
||||
return IRCProtocolHandlerFactory;
|
||||
|
||||
if (cid.equals(IRCSPROT_HANDLER_CID))
|
||||
return IRCSProtocolHandlerFactory;
|
||||
|
||||
if (!iid.equals(Components.interfaces.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
ChatzillaModule.canUnload =
|
||||
function cz_mod_canUnload(compMgr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* entrypoint */
|
||||
function NSGetModule(compMgr, fileSpec)
|
||||
{
|
||||
return ChatzillaModule;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
pref("qa.extension.litmus.url", "https://litmus.mozilla.org/");
|
||||
pref("qa.extension.hermes.url", "https://litmus.mozilla.org/hermes/1/");
|
||||
pref("qa.extension.bugzilla.url", "https:/bugzilla.mozilla.org/");
|
||||
pref("qa.extension.isFirstTime", true);
|
||||
pref("qa.extension.minNotificationInterval", 5400000); // 90 minutes
|
||||
pref("qa.extension.lastNotificationTime", 0);
|
||||
pref("qa.extension.minNotificationCheckInterval", 5400000); // 90 minutes
|
||||
pref("qa.extension.lastNotificationCheckTime", 0);
|
||||
pref("qa.extension.notificationSettings", '0,1,0,1,0,0,1');
|
@ -1,24 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#"
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<RDF:Description RDF:about="rdf:#$QJqvE"
|
||||
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
|
||||
em:minVersion="2.0"
|
||||
em:maxVersion="3.0.*"/>
|
||||
<RDF:Description RDF:about="urn:mozilla:install-manifest"
|
||||
em:id="{667e9f3d-0096-4d2b-b171-9a96afbabe20}"
|
||||
em:version="0.1.14"
|
||||
em:type="2"
|
||||
em:name="Mozilla QA Companion"
|
||||
em:description="The QA tool for testers."
|
||||
em:creator="Mozilla QA Team"
|
||||
em:homepageURL="http://quality.mozilla.org/"
|
||||
em:iconURL="chrome://qa/skin/qmo_logo_32x32.png">
|
||||
<em:targetApplication RDF:resource="rdf:#$QJqvE"/>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
@ -1,11 +0,0 @@
|
||||
content qa jar:chrome/qa.jar!/content/
|
||||
skin qa classic/1.0 jar:chrome/qa.jar!/skin/
|
||||
locale qa en-US jar:chrome/qa.jar!/locale/en-US/
|
||||
|
||||
overlay chrome://browser/content/browser.xul chrome://qa/content/browserOverlays.xul
|
||||
|
||||
content chatzilla_qa jar:chatzilla.jar!/content/chatzilla/
|
||||
skin chatzilla_qa modern/1.0 jar:chatzilla.jar!/skin/modern/chatzilla/
|
||||
locale chatzilla_qa en-US jar:chatzilla.jar!/locale/en-US/chatzilla/
|
||||
content chatzillaservice_qa components/chatzilla-service.js
|
||||
|
@ -1,2 +0,0 @@
|
||||
skin qa-mac classic/1.0 chrome/skin/
|
||||
override chrome://qa/skin/platform.css chrome/skin/platform.css
|
@ -1,44 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#qa-tabbar-spacer {
|
||||
width: 17px !important;
|
||||
}
|
||||
|
||||
#qa_tabbox tabpanel {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
#qa_tabbox tabpanels {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
#qa_tabbox groupbox {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
#qa_tabbox caption {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/** causes weird behavior on branch, but needed for trunk **/
|
||||
#qa-tabbar-qmo {
|
||||
width:16px;
|
||||
margin-left: 13px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#qa-testcase-comment {
|
||||
background-color: transparent !important;
|
||||
max-width: 170px;
|
||||
}
|
||||
|
||||
#qa-preferences-litmus-username {
|
||||
max-width: 350px;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
#qa-preferences-litmus-password {
|
||||
max-width: 400px;
|
||||
width: 350px;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
skin qa-win classic/1.0 chrome/skin/
|
||||
override chrome://qa/skin/platform.css chrome/skin/platform.css
|
@ -1,9 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* This file is intentionally left blank to prevent an error from being thrown
|
||||
* on windows when attempting to overwrite the common CSS. If we need future
|
||||
* specific windows CSS tweaks, they should go here.
|
||||
**/
|