Bug 1207499 - Part 10: Remove use of expression closure from testing/. r=jmaher

This commit is contained in:
Tooru Fujisawa 2015-09-23 18:42:19 +09:00
parent 7fbb71a90c
commit d1ab8896d1
5 changed files with 19 additions and 13 deletions

View File

@ -124,13 +124,13 @@
}
browserTest.prototype = {
get passCount() {
return this.results.filter(function (t) !t.info && !t.todo && t.pass).length;
return this.results.filter(t => !t.info && !t.todo && t.pass).length;
},
get todoCount() {
return this.results.filter(function (t) !t.info && t.todo && t.pass).length;
return this.results.filter(t => !t.info && t.todo && t.pass).length;
},
get failCount() {
return this.results.filter(function (t) !t.info && !t.pass).length;
return this.results.filter(t => !t.info && !t.pass).length;
},
addResult: function addResult(result) {
@ -289,9 +289,9 @@
var log = "";
var passCount = aTests.map(function (f) f.passCount).reduce(sum);
var failCount = aTests.map(function (f) f.failCount).reduce(sum);
var todoCount = aTests.map(function (f) f.todoCount).reduce(sum);
var passCount = aTests.map(f => f.passCount).reduce(sum);
var failCount = aTests.map(f => f.failCount).reduce(sum);
var todoCount = aTests.map(f => f.todoCount).reduce(sum);
log += "<div id=\"summary\" class=\"";
log += failCount != 0 ? "failure" :
passCount == 0 ? "todo" : "success";

View File

@ -328,9 +328,9 @@ Tester.prototype = {
finish: function Tester_finish(aSkipSummary) {
this.Promise.Debugging.flushUncaughtErrors();
var passCount = this.tests.reduce(function(a, f) a + f.passCount, 0);
var failCount = this.tests.reduce(function(a, f) a + f.failCount, 0);
var todoCount = this.tests.reduce(function(a, f) a + f.todoCount, 0);
var passCount = this.tests.reduce((a, f) => a + f.passCount, 0);
var failCount = this.tests.reduce((a, f) => a + f.failCount, 0);
var todoCount = this.tests.reduce((a, f) => a + f.todoCount, 0);
if (this.repeat > 0) {
--this.repeat;

View File

@ -30,7 +30,9 @@ var APP_INFO = {
invalidateCachesOnRestart() {},
// nsIWinAppHelper
get userCanElevate() false,
get userCanElevate() {
return false;
},
QueryInterface(iid) {
let interfaces = [ Ci.nsIXULAppInfo, Ci.nsIXULRuntime ];

View File

@ -607,7 +607,7 @@ SpecialPowersAPI.prototype = {
// in order to properly log these assertions and notify
// all usefull log observers
let window = this.window.get();
let parentRunner, repr = function (o) o;
let parentRunner, repr = o => o;
if (window) {
window = window.wrappedJSObject;
parentRunner = window.TestRunner;

View File

@ -234,7 +234,9 @@ var _fakeIdleService = {
Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
},
contractID: "@mozilla.org/widget/idleservice;1",
get CID() this.registrar.contractIDToCID(this.contractID),
get CID() {
return this.registrar.contractIDToCID(this.contractID);
},
activate: function FIS_activate()
{
@ -286,7 +288,9 @@ var _fakeIdleService = {
},
// nsIIdleService
get idleTime() 0,
get idleTime() {
return 0;
},
addIdleObserver: function () {},
removeIdleObserver: function () {},