diff --git a/testing/tests/l10n/extensions/coverage/Makefile.in b/testing/tests/l10n/extensions/coverage/Makefile.in deleted file mode 100644 index 7d9d6661110..00000000000 --- a/testing/tests/l10n/extensions/coverage/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org l10n testing. -# -# The Initial Developer of the Original Code is -# Mozilla Foundation. -# Portions created by the Initial Developer are Copyright (C) 2006 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Axel Hecht -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = coverage -XPI_NAME = coverage -#INSTALL_EXTENSION_ID = coverage@l10n.mozilla.com -XPI_PKGNAME = coverage-$(EXTENSION_VERSION) -EXTENSION_VERSION = 0.5 - -USE_EXTENSION_MANIFEST = 1 -DIST_FILES = install.rdf -PREF_JS_EXPORTS = $(srcdir)/coverage-extension-prefs.js - -DEFINES += -DEXTENSION_VERSION=$(EXTENSION_VERSION) - -include $(topsrcdir)/config/rules.mk diff --git a/testing/tests/l10n/extensions/coverage/chrome/content/coverage-menu.js b/testing/tests/l10n/extensions/coverage/chrome/content/coverage-menu.js deleted file mode 100644 index 4c19c6c1ef6..00000000000 --- a/testing/tests/l10n/extensions/coverage/chrome/content/coverage-menu.js +++ /dev/null @@ -1,104 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org l10n testing. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2066 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/** - * Item to close a menu popup - * - * Used by OpenMenuObj. - */ -function CloseMenuObj(aPopup) { - this.args = [aPopup]; -} -CloseMenuObj.prototype = { - args: null, - method: function _openMenu(aPopup) { - aPopup.hidePopup(); - } -}; - -/** - * Item to open a menu popup - * - * Adds a CloseMenuObj item as well as potentially child popups to - * Stack - */ -function OpenMenuObj(aPopup) { - this.args = [aPopup]; -} -OpenMenuObj.prototype = { - args: null, - method: function _openMenu(aPopup) { - aPopup.showPopup(); - Stack.push(new CloseMenuObj(aPopup)); - for (var i = aPopup.childNodes.length - 1; i>=0; --i) { - var c = aPopup.childNodes[i]; - if (c.nodeName != 'menu' || c.childNodes.length == 0) { - continue; - } - for each (var childpop in c.childNodes) { - if (childpop.localName == "menupopup") { - Stack.push(new OpenMenuObj(childpop)); - } - } - } - } -}; - -/** - * Item to kick off menu coverage testing - * - * Pretty similar to OpenMenuObj, just that it works on the main-menubar - * instead of a given popup. - */ -function RootMenu(aWindow) { - this._w = aWindow; -}; -RootMenu.prototype = { - args: [], - method: function() { - var mb = this._w.document.getElementById('main-menubar'); - for (var i = mb.childNodes.length - 1; i>=0; --i) { - var m = mb.childNodes[i]; - Stack.push(new OpenMenuObj(m.firstChild)); - } - }, - _w: null -}; - -toRun.push(new TestDone('MENUS')); -toRun.push(new RootMenu(wins[0])); -toRun.push(new TestStart('MENUS')); diff --git a/testing/tests/l10n/extensions/coverage/chrome/content/coverage-neterror.js b/testing/tests/l10n/extensions/coverage/chrome/content/coverage-neterror.js deleted file mode 100644 index 934bceb9185..00000000000 --- a/testing/tests/l10n/extensions/coverage/chrome/content/coverage-neterror.js +++ /dev/null @@ -1,113 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org l10n testing. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2066 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var SBS = Cc["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService); -var bundle = SBS.createBundle("chrome://global/locale/appstrings.properties"); - -/** - * Item to wait on asynchronous loads - */ -var loadAction = { - isLoaded: false, - args: [], - method: function() { - if (!this.isLoaded) { - Stack.push(this); - } - } -}; -// onLoad handler for the iframe, sibling of loadAction -function onFrameLoad(aEvent) { - aEvent.stopPropagation(); - loadAction.isLoaded = true; - return false; -}; - -/** - * Item to load the next error page - * - * Uses the loadAction object to wait for asynchronous loading. - */ -function ErrPageLoad(aFrame, aProperty) { - this.args = [aFrame, aProperty.key, aProperty.value]; -}; -ErrPageLoad.prototype = { - args: null, - method: function(aFrame, aErr, aDesc) { - loadAction.isLoaded = false; - var q = 'e=' + encodeURIComponent(aErr); - q += '&u=' + encodeURIComponent('http://foo.bar'); - // Simple replacement, replace anything that's %s with aURL, - // see http://lxr.mozilla.org/mozilla1.8/source/docshell/base/nsDocShell.cpp#2907 - // on how to do this right. But that requires knowledge on each and - // every error, too much work for now. - aDesc = aDesc.replace('%S', 'http://foo.bar'); - q += '&d=' + encodeURIComponent(aDesc); - Stack.push(loadAction); - aFrame.setAttribute('src', 'about:neterror?' + q); - } -}; - -/** - * Item to start the neterror tests - * - * This item collects all the neterror pages we intend to test - * and adds them to the Stack. - */ -function RootNeterror() { - this.args = []; -}; -RootNeterror.prototype = { - args: null, - method: function(aIFrame) { - var frame = document.getElementById('neterror-pane'); - var nErrors = - [err for (err in SimpleGenerator(bundle.getSimpleEnumeration(), - Ci.nsIPropertyElement))]; - nErrors.sort(function(aPl, aPr) { - return aPl.key > aPr.key ? 1 : - aPl.key < aPr.key ? -1 : 0; - }); - for each (err in nErrors) { - Stack.push(new ErrPageLoad(frame, err)); - } - } -}; - -toRun.push(new TestDone('NETERROR')); -toRun.push(new RootNeterror()); -toRun.push(new TestStart('NETERROR')); diff --git a/testing/tests/l10n/extensions/coverage/chrome/content/coverage-prefs.js b/testing/tests/l10n/extensions/coverage/chrome/content/coverage-prefs.js deleted file mode 100644 index 282c9d98695..00000000000 --- a/testing/tests/l10n/extensions/coverage/chrome/content/coverage-prefs.js +++ /dev/null @@ -1,138 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org l10n testing. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2066 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/** - * Item to show the next pane in a prefs window - */ -function ShowPaneObj(aPane, aLoader) { - this.args = [aPane, aLoader]; -} -ShowPaneObj.prototype = { - args: null, - method: function _openMenu(aPane, aLoader) { - Stack.push(aLoader); - aPane.parentNode.showPane(aPane); - } -}; - -/** - * Item to close the preferences window once the tests are done - */ -function ClosePreferences() { - this.args = []; -}; -ClosePreferences.prototype = { - args: [], - method: function() { - var pWin = WM.getMostRecentWindow("Browser:Preferences"); - if (pWin) { - pWin.close(); - } - else { - Components.utils.reportError("prefwindow not found, trying again"); - } - } -}; - -/** - * Item to wait for a preference pane to load - */ -function PrefPaneLoader() { -}; -PrefPaneLoader.prototype = { - _currentPane: null, - args: [], - method: function() { - if (!this._currentPane) { - // The pane we're waiting for hasn't been loaded yet, do me again - Stack.push(this); - return; - } - // the pane is loaded, kick off the load of the next one, if available - pane = this._currentPane.nextSibling; - this._currentPane = null; - while (pane) { - if (pane.nodeName == 'prefpane') { - Stack.push(new ShowPaneObj(pane, this)); - return; - } - pane = pane.nextSibling; - } - }, - // nsIDOMEventListener - handleEvent: function _hv(aEvent) { - this._currentPane = aEvent.target; - } -}; - -/** - * Item to start the preference dialog tests - * - * This item expects to have 'paneMain' as the ID of the first pane. - * That may be an over-simplification, but it guarantees to load - * the panes from left to right, and that all are not loaded yet. - * WFM. - */ -function RootPreference(aWindow) { - this.args = [aWindow]; -}; -RootPreference.prototype = { - args: [], - method: function(aWindow) { - WM.addListener(this); - aWindow.openPreferences('paneMain'); - }, - // nsIWindowMediatorListener - onWindowTitleChange: function(aWindow, newTitle){}, - onOpenWindow: function(aWindow) { - WM.removeListener(this); - // ensure the timer runs in the modal window, too - Stack._timer.initWithCallback({notify:function (aTimer) {Stack.pop();}}, - Stack._time, 1); - Stack.push(new ClosePreferences()); - var ppl = new PrefPaneLoader(); - aWindow.docShell.QueryInterface(Ci.nsIInterfaceRequestor); - var DOMwin = aWindow.docShell.getInterface(Ci.nsIDOMWindow); - DOMwin.addEventListener('paneload', ppl, false); - Stack.push(ppl); - }, - onCloseWindow: function(aWindow){} -}; - -toRun.push(new TestDone('PREFERENCES')); -toRun.push(new RootPreference(wins[0])); -toRun.push(new TestStart('PREFERENCES')); diff --git a/testing/tests/l10n/extensions/coverage/chrome/content/coverage.js b/testing/tests/l10n/extensions/coverage/chrome/content/coverage.js deleted file mode 100644 index 77571bea382..00000000000 --- a/testing/tests/l10n/extensions/coverage/chrome/content/coverage.js +++ /dev/null @@ -1,130 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org l10n testing. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2066 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/** - * Basic architecture for UI exposure tests - * - * Details on http://wiki.mozilla.org/SoftwareTesting:Tools:L10n:Coverage - */ - -var Ci = Components.interfaces; -var Cc = Components.classes; -var Cr = Components.results; - -var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); -var ds = Cc[NS_DIRECTORY_SERVICE_CONTRACTID].getService(Ci.nsIProperties); -const WM = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); - -/** - * Global Stack object - * - * This object keeps the tests running with some time for visual inspection. - */ -var Stack = { - _stack: [], - _time: 250, - _timer: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer), - notify: function _notify(aTimer) { - this.pop(); - }, - push: function _push(aItem) { - this._stack.push(aItem); - if (this._stack.length == 1) { - this._timer.initWithCallback({notify:function (aTimer) {Stack.pop();}}, - this._time, 1); - } - }, - pop: function _pop() { - var obj = this._stack.pop(); - try { - obj.method.apply(obj, obj.args); - } catch (e) { - Components.utils.reportError(e); - } - if (!this._stack.length) { - this._timer.cancel(); - } - } -}; -/** - * Add your test set to toRun. - * The onload handler will add them to the Stack and kick off the - * testing. - */ -var toRun = []; - -/** - * Utility to get array of xpcom objects from a nsISimpleEnumerator - * Requires JS1.7 - */ -function SimpleGenerator(enumr, interface) { - while (enumr.hasMoreElements()) { - yield enumr.getNext().QueryInterface(interface); - } -} - -var wins = [w for (w in SimpleGenerator(WM.getEnumerator(null), Ci.nsIDOMWindow))]; - -/** - * Helper items to log start and end of testing to the Error Console - */ -function MsgBase() { -} -MsgBase.prototype = { - args: [], - method: function() { - Components.utils.reportError(this._msg); - } -}; -function TestStart(aCat) { - this._msg = 'TESTING:START:COVERAGE:' + aCat; -} -TestStart.prototype = new MsgBase; -function TestDone(aCat) { - this._msg = 'TESTING:DONE:COVERAGE:' + aCat; -} -TestDone.prototype = new MsgBase; - -/** - * onload handler for the entry page. - * Copy the toRun items over to the stack and kick things off. - */ -function onLoad() { - for each (var obj in toRun) { - Stack.push(obj); - } -} diff --git a/testing/tests/l10n/extensions/coverage/chrome/content/coverage.xul b/testing/tests/l10n/extensions/coverage/chrome/content/coverage.xul deleted file mode 100644 index e56af62fed7..00000000000 --- a/testing/tests/l10n/extensions/coverage/chrome/content/coverage.xul +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -

Locale Tests

- - - - - - -
- - - diff --git a/testing/tests/l10n/web/layout.css b/testing/tests/l10n/web/layout.css deleted file mode 100644 index 1e7af40b15a..00000000000 --- a/testing/tests/l10n/web/layout.css +++ /dev/null @@ -1,133 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#sidebar { - float: right; - margin-top: -8px; -} - -#menu li[selected] { - background-color: lightgrey; - border-style: inset inset none inset; -} -#menu li { - display: block; - float: left; - font-weight: bold; - padding: .5em; - margin-left:1px; - margin-right:1px; - border-style: outset outset none outset; - -moz-border-radius-topleft: 15px; - -moz-border-radius-topright: 15px; -} - -#main { - clear: left; -} -body { - overflow: scroll; -} -#content { - vertical-align: top; -} - -div.is_good { - padding-left: 16px; -} - -.missing, .busted { - background-color: red; -} - -.obsolete, .fair { - background-color: orange; -} - -.zero { - opacity: .3; - background-color: green !important; -} - - -.good { - background-color: limegreen; -} - -.void { - color: grey; - background-color: lightgrey; -} - -td.locale { - width: 4em; -} -td.app-res { - width: 4em; -} - -td.count { - padding-left:3px; - padding-right: 3px; - width: 3.5em; - text-align: right; -} - -div.calbordered { - float: none; -} - -/* waterfall view */ -#log-dlg { - overflow: scroll; -} -.log-row { - margin: 0pt; -} -.ERROR { - background-color: coral; -} - -/* search view */ - -td.ordered {border: 2px solid black;} -td.error {background-color: coral;} -td.conflict {background-color: grey;} -td.enUS {opacity: .5;} - -/* feedreader view */ -.feedreader { border: thin solid lightgrey } \ No newline at end of file diff --git a/testing/tests/l10n/web/post.js b/testing/tests/l10n/web/post.js deleted file mode 100644 index 8f2f742bbaf..00000000000 --- a/testing/tests/l10n/web/post.js +++ /dev/null @@ -1,40 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -view.init(); -controller.addLocales(keys(tierMap)); -controller.loaded(); diff --git a/testing/tests/l10n/web/rss-reader-code.js b/testing/tests/l10n/web/rss-reader-code.js deleted file mode 100644 index dd29d2c0862..00000000000 --- a/testing/tests/l10n/web/rss-reader-code.js +++ /dev/null @@ -1,93 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -var rssController = { - __proto__: baseController, - get path() { - return 'results/' + this.tag + '/feed-reader-results.json'; - }, - beforeSelect: function() { - this.hashes = {}; - rssView.setUpHandlers(); - var _t = this; - var callback = function(obj) { - delete _t.req; - if (view != rssView) { - // ignore, we have switched again - return; - } - _t.result = obj; - rssView.updateView(keys(_t.result)); - }; - this.req = JSON.get('results/' + this.tag + '/feed-reader-results.json', - callback); - }, - beforeUnSelect: function() { - rssView.destroyHandlers(); - }, - showView: function(aClosure) { - // json onload handler does this; - }, - getContent: function(aLoc) { - var row = document.createDocumentFragment(); - var lst = this.result[aLoc]; - var _t = this; - for each (var pair in lst) { - //YAHOO.widget.Logger.log('testing ' + path); - var td = document.createElement('td'); - td.className = 'feedreader'; - td.innerHTML = pair[0]; - td.title = pair[1]; - row.appendChild(td); - } - return row; - } -}; -var rssView = { - __proto__: baseView, - setUpHandlers: function() { - _t = this; - }, - destroyHandlers: function() { - if (this._dv) { - this._dv.hide(); - } - } -}; -controller.addPane('RSS', 'rss', rssController, rssView); -//controller.addLocales(keys(results.locales)); diff --git a/testing/tests/l10n/web/search-code.js b/testing/tests/l10n/web/search-code.js deleted file mode 100644 index 4ced5aebe72..00000000000 --- a/testing/tests/l10n/web/search-code.js +++ /dev/null @@ -1,241 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -var searchController = { - __proto__: baseController, - get path() { - return 'results/' + this.tag + '/search-results.json'; - }, - beforeSelect: function() { - this.hashes = {}; - searchView.setUpHandlers(); - var _t = this; - var callback = function(obj) { - delete _t.req; - if (view != searchView) { - // ignore, we have switched again - return; - } - _t.result = obj; - searchView.updateView(keys(_t.result.locales)); - }; - this.req = JSON.get('results/' + this.tag + '/search-results.json', - callback); - }, - beforeUnSelect: function() { - this.hashes = {}; - searchView.destroyHandlers(); - }, - showView: function(aClosure) { - // json onload handler does this; - }, - getContent: function(aLoc) { - var row = document.createDocumentFragment(); - var lst = this.result.locales[aLoc].list; - var _t = this; - lst.sort(function(a,b){return _t.cmp.apply(_t,[a,b])}); - var orders = this.result.locales[aLoc].orders; - if (orders) { - var explicit = []; - var implicit = []; - for (var sn in orders) { - if (explicit[sn]) { - fatal = true; - break; - } - explicit[sn] = orders[sn]; - } - explicit = []; - for each (var path in lst) { - var shortName = this.result.details[path].ShortName; - if (orders[shortName]) { - explicit[orders[shortName] - 1] = path; - } - else { - implicit.push(path); - } - } - lst = explicit.concat(implicit); - } - row.innerHTML = 'bug'; - for each (var path in lst) { - //YAHOO.widget.Logger.log('testing ' + path); - var innerContent; - var cl = ''; - if (path.match(/^mozilla/)) { - cl += ' enUS'; - } - var localName = path.substr(path.lastIndexOf('/') + 1); - if (this.result.details[path].error) { - innerContent = 'error in ' + localName; - cl += ' error'; - } - else { - var shortName = this.result.details[path].ShortName; - var img = this.result.details[path].Image; - if (this.result.locales[aLoc].orders && this.result.locales[aLoc].orders[shortName]) { - cl += " ordered"; - } - innerContent = '' + shortName; - } - var td = document.createElement('td'); - td.className = 'searchplugin' + cl; - td.innerHTML = innerContent; - row.appendChild(td); - td.details = this.result.details[path]; - // test the hash code - if (td.details.error) { - // ignore errorenous plugins - continue; - } - if (this.hashes[localName]) { - this.hashes[localName].nodes.push(td); - if (this.hashes[localName].conflict) { - td.className += ' conflict'; - } - else if (this.hashes[localName].key != td.details.md5) { - this.hashes[localName].conflict = true; - for each (td in this.hashes[localName].nodes) { - td.className += ' conflict'; - } - } - } - else { - this.hashes[localName] = {key: td.details.md5, nodes: [td]}; - } - } - for (localName in this.hashes) { - if ( ! ('conflict' in this.hashes[localName])) { - continue; - } - locs = []; - for each (var td in this.hashes[localName].nodes) { - locs.push(td.parentNode.firstChild.textContent); - } - YAHOO.widget.Logger.log('difference in ' + localName + ' for ' + locs.join(', ')); - } - return row; - }, - cmp: function(l,r) { - var lName = this.result.details[l].ShortName; - var rName = this.result.details[r].ShortName; - if (lName) lName = lName.toLowerCase(); - if (rName) rName = rName.toLowerCase(); - return lName < rName ? -1 : lName > rName ? 1 : 0; - } -}; -var searchView = { - __proto__: baseView, - setUpHandlers: function() { - _t = this; - this.omv = function(event){_t.onMouseOver.apply(_t, [event]);}; - this.omo = function(event){_t.onMouseOut.apply(_t, [event]);}; - this.content.addEventListener("mouseover", this.omv, true); - this.content.addEventListener("mouseout", this.omv, true); - }, - destroyHandlers: function() { - this.content.removeEventListener("mouseover", this.omv, true); - this.content.removeEventListener("mouseout", this.omv, true); - if (this._dv) { - this._dv.hide(); - } - }, - onMouseOver: function(event) { - if (!event.target.details) - return; - var _e = { - details: event.target.details, - clientX: event.clientX, - clientY: event.clientY - }; - this.pending = setTimeout(function(){searchView.showDetail(_e);}, 500); - }, - onMouseOut: function(event) { - if (this.pending) { - clearTimeout(this.pending); - delete this.pending; - return; - } - if (!event.target.details) - return; - }, - showDetail: function(event) { - delete this.pending; - if (!this._dv) { - this._dv = new YAHOO.widget.Panel('dv', {visible:true,draggable:true,constraintoviewport:true}); - this._dv.beforeHideEvent.subscribe(function(){delete this._dv;}, null); - } - var dt = event.details; - if (dt.error) { - this._dv.setHeader("Error"); - this._dv.setBody(dt.error); - } - else { - this._dv.setHeader("Details"); - var c = ''; - var q = 'test'; - var len = 0; - for each (var url in dt.urls) { - var uc = url.template; - var sep = (uc.indexOf('?') > -1) ? '&' : '?'; - for (var p in url.params) { - uc += sep + p + '=' + url.params[p]; - sep = '&'; - } - uc = uc.replace('{searchTerms}', q); - var mpContent = ''; - if (url.MozParams) { - for each (var mp in url.MozParams) { - // add at least the yahoo prefs - if (mp.condition == 'pref') { - mpContent += ', using pref ' + mp.name + '=' + mp.pref; - } - } - } - c += '' +mpContent+ '
'; - len = len < c.length ? c.length : len; - } - this._dv.setBody(c); - } - this._dv.render(document.body); - this._dv.moveTo(event.clientX + window.scrollX, event.clientY + window.scrollY); - this._dv.show(); - } -}; -controller.addPane('Search', 'search', searchController, searchView); -//controller.addLocales(keys(results.locales)); diff --git a/testing/tests/l10n/web/waterfall-code.js b/testing/tests/l10n/web/waterfall-code.js deleted file mode 100644 index 1ac8d4892bb..00000000000 --- a/testing/tests/l10n/web/waterfall-code.js +++ /dev/null @@ -1,191 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Axel Hecht - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -var waterfallView = { - __proto__: baseView, - scale: 1/60, - unstyle: function() { - this.content.innerHTML = ''; - }, - updateView: function(aResult) { - YAHOO.widget.Logger.log('waterfallView.updateView called'); - var head = document.getElementById('head'); - head.innerHTML = ''; - this.content.innerHTML = ''; - for each (var loc in controller.locales) { - var h = document.createElement('th'); - h.className = 'wf-locale-head ' + view.getClass(loc); - h.textContent = loc; - head.appendChild(h); - } - var heads = head.childNodes; - var lastDate = -1; - function pad(aNumber, length) { - str = String(aNumber); - while (str.length < length) { - str = '0' + str; - } - return str; - }; - for (var i = aResult.length - 1; i >= 0; i--) { - var wf = document.createElement('tr'); - wf.className = 'waterfall-row'; - wf.setAttribute('style','vertical-align: top;'); - this.content.appendChild(wf); - var b = aResult[i]; - var height = Math.floor((b[1][1] - b[1][0]) * this.scale); - var style = "height: " + height + "px;"; - wf.setAttribute('style', style); - var cell = view.getCell(); - cell.className = 'cell-label'; - var d = this.getUTCDate(b[0]); - var label = pad(d.getUTCHours(), 2) + ':' + - pad(d.getUTCMinutes(), 2); - if (lastDate != d.getUTCDate()) { - lastDate = d.getUTCDate(); - label = d.getUTCDate() +'/'+ (d.getUTCMonth()+1) + '
' + label; - } - cell.innerHTML = label + - '
L'; - wf.appendChild(cell); - var locs = keys(b[2]); - var h = 1; - for each (loc in locs) { - if (h >= heads.length) { - YAHOO.widget.Logger.log("dropping result for " + loc); - continue; - } - while (heads[h].textContent < loc) { - // we don't have a result for this column in this build - cell = view.getCell(); - cell.className = view.getClass(heads[h].textContent) - wf.appendChild(cell); - h++; - if (h >= heads.length) { - YAHOO.widget.Logger.log("dropping result for " + loc); - continue; - } - } - if (heads[h].textContent > loc) { - YAHOO.widget.Logger.log("dropping result for " + loc); - continue; - } - cell = view.getCell(); - cell.innerHTML = 'L B'; - if (b[2][loc] & 2) { - cell.className = 'busted '; - } - else if (b[2][loc] & 1) { - cell.className = 'fair '; - } - else { - cell.className = 'good '; - } - cell.className += ' ' + view.getClass(loc); - wf.appendChild(cell); - h++; - } - if (i == 0) { - continue; - } - // XXX don't make output sparse - continue; - wf = document.createElement('tr'); - wf.className = 'waterfall-row'; - wf.setAttribute('style','vertical-align: top;'); - this.content.appendChild(wf); - var b = aResult[i]; - var height = Math.floor((b[1][0] - aResult[i-1][1][1]) * this.scale); - var style = "height: " + height + "px;"; - wf.setAttribute('style', style); - //var cell = view.getCell(); - } - }, - setUpHandlers: function() { - _t = this; - }, - destroyHandlers: function() { - }, - // Helper functions - getUTCDate: function(aTag) { - var D = new Date(); - var d = aTag.split(/[ -]/).map(function(aEl){return Number(aEl);}); - d[1] -= 1; // adjust month - D.setTime(Date.UTC.apply(null,d)); - return D; - } -}; -var waterfallController = { - __proto__: baseController, - get path() { - return 'results/waterfall.json'; - }, - beforeSelect: function() { - this.result = {}; - this.isShown = false; - waterfallView.setUpHandlers(); - var _t = this; - var callback = function(obj) { - delete _t.req; - if (view != waterfallView) { - // ignore, we have switched again - return; - } - _t.result = obj; - _t.tag = obj[obj.length - 1][0]; // set the subdir to latest build - controller.addLocales(keys(obj[obj.length - 1][2])); - waterfallView.updateView(_t.result); - }; - this.req = JSON.get('results/waterfall.json', callback); - }, - beforeUnSelect: function() { - if (this.req) { - this.req.abort(); - delete this.req; - } - waterfallView.unstyle(); - waterfallView.destroyHandlers(); - }, - showView: function(aClosure) { - // json onload handler does this; - } -}; -controller.addPane('Tinder', 'waterfall', waterfallController, - waterfallView);