From 4043fe468f097089475614c7cbe7051677d50106 Mon Sep 17 00:00:00 2001 From: "axel%pike.org" Date: Thu, 17 Aug 2006 11:55:00 +0000 Subject: [PATCH] bug 348554, add conflicts and en-US markup to output git-svn-id: svn://10.0.0.236/trunk@207721 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/testing/tests/l10n/web/search-code.js | 41 +++++++++++++++++-- .../tests/l10n/web/search-engines.html | 2 + 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/mozilla/testing/tests/l10n/web/search-code.js b/mozilla/testing/tests/l10n/web/search-code.js index b8ae560b4fb..702be46adb7 100755 --- a/mozilla/testing/tests/l10n/web/search-code.js +++ b/mozilla/testing/tests/l10n/web/search-code.js @@ -46,6 +46,7 @@ for each (loc in Tier2) tierMap[loc] = 'Tier-2'; var view; view = { + hashes: {}, updateView: function() { this._gView = document.getElementById("view"); var cmp = function(l,r) { @@ -92,15 +93,19 @@ view = { //YAHOO.widget.Logger.log('testing ' + path); var innerContent; var cl = ''; + if (path.match(/^mozilla/)) { + cl += ' enUS'; + } + var localName = path.substr(path.lastIndexOf('/') + 1) if (results.details[path].error) { - innerContent = 'error in ' + path.substr(path.lastIndexOf('/') + 1); - cl = ' error'; + innerContent = 'error in ' + localName; + cl += ' error'; } else { var shortName = results.details[path].ShortName; var img = results.details[path].Image; if (results.locales[loc].orders && results.locales[loc].orders[shortName]) { - cl = " ordered"; + cl += " ordered"; } innerContent = '' + shortName; } @@ -109,8 +114,38 @@ view = { td.innerHTML = innerContent; row.appendChild(td); td.details = results.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(', ')); + } }, onMouseOver: function(event) { if (!event.target.details) diff --git a/mozilla/testing/tests/l10n/web/search-engines.html b/mozilla/testing/tests/l10n/web/search-engines.html index 85b33ad0265..8457edad755 100755 --- a/mozilla/testing/tests/l10n/web/search-engines.html +++ b/mozilla/testing/tests/l10n/web/search-engines.html @@ -56,6 +56,8 @@