From f227d92d5af536a61fb7c47e3891fa7364bfbb80 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Wed, 28 Jun 2017 06:58:01 -0600 Subject: [PATCH] Bug 1375903 - Enable eslint on testing/talos - mechanical changes; r=jmaher Most of these changes were made by 'mach eslint --fix'. --- .eslintignore | 7 +- testing/talos/talos/base_profile/prefs.js | 4 +- testing/talos/talos/generate-tart-xpi.html | 12 +- testing/talos/talos/generate-tresize-xpi.html | 12 +- .../pageloader/chrome/MozillaFileLogger.js | 22 +- .../talos/talos/pageloader/chrome/Profiler.js | 22 +- .../talos/talos/pageloader/chrome/memory.js | 6 +- .../talos/pageloader/chrome/pageloader.js | 112 ++++---- testing/talos/talos/pageloader/chrome/quit.js | 58 ++--- .../talos/talos/pageloader/chrome/report.js | 28 +- .../talos/talos/pageloader/chrome/tscroll.js | 21 +- .../talos/pageloader/components/tp-cmdline.js | 30 +-- .../talos/talos/scripts/MozillaFileLogger.js | 22 +- testing/talos/talos/scripts/Profiler.js | 20 +- testing/talos/talos/scripts/talos-debug.js | 32 +-- testing/talos/talos/scripts/xpigen.js | 9 +- .../addon/SessionRestoreTalosTest.js | 16 +- .../sessionrestore/addon/content/main.js | 4 +- testing/talos/talos/startup_test/tpaint.html | 16 +- .../tresize/addon/content/Profiler.js | 20 +- .../tresize/addon/content/framescript.js | 2 +- .../tresize/addon/content/tresize.js | 20 +- .../talos/startup_test/tspaint_test.html | 20 +- .../chrome/talos-powers-content.js | 6 +- .../components/TalosPowersService.js | 22 +- .../content/TalosContentProfiler.js | 14 +- .../content/TalosParentProfiler.js | 10 +- .../content/TalosPowersContent.js | 4 +- testing/talos/talos/tests/a11y/a11y.js | 13 +- testing/talos/talos/tests/a11y/dhtml.html | 10 +- .../talos/talos/tests/a11y/tablemutation.html | 26 +- .../tests/devtools/addon/content/Profiler.js | 20 +- .../addon/content/addon-test-frontend.js | 24 +- .../tests/devtools/addon/content/damp.html | 8 +- .../tests/devtools/addon/content/damp.js | 38 +-- .../devtools/addon/content/framescript.js | 2 +- .../tests/perf-reftest/bloom-basic-ref.html | 2 +- .../talos/tests/perf-reftest/bloom-basic.html | 2 +- .../talos/talos/tests/perf-reftest/util.js | 4 +- testing/talos/talos/tests/quit.js | 81 +++--- .../talos/talos/tests/tabpaint/bootstrap.js | 2 +- .../tests/tabpaint/content/tabpaint.html | 2 +- .../talos/tests/tabpaint/content/target.html | 2 +- .../talos/talos/tests/tabswitch/bootstrap.js | 38 +-- .../talos/tests/tabswitch/content/test.html | 2 +- .../tests/tart/addon/content/Profiler.js | 20 +- .../tests/tart/addon/content/framescript.js | 4 +- .../talos/tests/tart/addon/content/tart.html | 30 +-- .../talos/tests/tart/addon/content/tart.js | 246 +++++++++--------- .../talos/tests/video/video_playback.html | 44 ++-- .../webgl/benchmarks/video/video_upload.html | 23 +- .../talos/webextensions/dummy/background.js | 4 +- .../talos/webextensions/dummy/content.js | 4 +- tools/rewriting/ThirdPartyPaths.txt | 3 + 54 files changed, 593 insertions(+), 632 deletions(-) diff --git a/.eslintignore b/.eslintignore index 39828228b5cd..415d52c8ab54 100644 --- a/.eslintignore +++ b/.eslintignore @@ -305,7 +305,12 @@ testing/modules/ajv-4.1.1.js testing/modules/sinon-2.3.2.js # octothorpe used for pref file comment causes parsing error testing/mozbase/mozprofile/tests/files/prefs_with_comments.js -testing/talos/** +testing/talos/talos/scripts/jszip.min.js +testing/talos/talos/tests/canvasmark/** +testing/talos/talos/tests/dromaeo/** +testing/talos/talos/tests/v8_7/** +testing/talos/talos/tests/kraken/** + testing/web-platform/** testing/xpcshell/moz-http2/** testing/xpcshell/node-http2/** diff --git a/testing/talos/talos/base_profile/prefs.js b/testing/talos/talos/base_profile/prefs.js index 7d160e0dba0f..9944e75f5b02 100755 --- a/testing/talos/talos/base_profile/prefs.js +++ b/testing/talos/talos/base_profile/prefs.js @@ -1,6 +1,6 @@ -// This file is needed to work around a Firefox bug where capability.principal +// This file is needed to work around a Firefox bug where capability.principal // prefs in user.js don't get recognized until the second browser launch -// which is too late for our purposes of using quit.js. Loading the principals +// which is too late for our purposes of using quit.js. Loading the principals // from prefs.js avoids this issue. user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead"); user_pref("capability.principal.codebase.p0.id", "file://"); diff --git a/testing/talos/talos/generate-tart-xpi.html b/testing/talos/talos/generate-tart-xpi.html index ccc1de103bef..b79c7c38d516 100644 --- a/testing/talos/talos/generate-tart-xpi.html +++ b/testing/talos/talos/generate-tart-xpi.html @@ -33,13 +33,15 @@ $("status").style.display = "inline"; createXpiDataUri(base, files, { - onprogress: function(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; }, + onprogress(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; }, - onerror : function(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.
" + e; }, + onerror(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.
" + e; }, - onsuccess : function(u) { $("xpi-link").href = u; - $("status").style.display = "none"; - $("result").style.display = "inline"; } + onsuccess(u) { + $("xpi-link").href = u; + $("status").style.display = "none"; + $("result").style.display = "inline"; +} }); } diff --git a/testing/talos/talos/generate-tresize-xpi.html b/testing/talos/talos/generate-tresize-xpi.html index 137ab99e1021..f6c2e0b97073 100644 --- a/testing/talos/talos/generate-tresize-xpi.html +++ b/testing/talos/talos/generate-tresize-xpi.html @@ -30,13 +30,15 @@ $("status").style.display = "inline"; createXpiDataUri(base, files, { - onprogress: function(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; }, + onprogress(p) { $("status-text").innerHTML = "Preparing ... " + p.toFixed(0) + "%"; }, - onerror : function(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.
" + e; }, + onerror(e) { $("status-text").innerHTML = "Oops, couldn't generate XPI. Reload to retry.
" + e; }, - onsuccess : function(u) { $("xpi-link").href = u; - $("status").style.display = "none"; - $("result").style.display = "inline"; } + onsuccess(u) { + $("xpi-link").href = u; + $("status").style.display = "none"; + $("result").style.display = "inline"; +} }); } diff --git a/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js b/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js index 4d463ef945d9..3570044eabd7 100644 --- a/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js +++ b/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js @@ -1,9 +1,9 @@ /** * MozillaFileLogger, a log listener that can write to a local file. - */ + */ -//double logging to account for normal mode and ipc mode (mobile_profile only) -//Ideally we would remove the dump() and just do ipc logging +// double logging to account for normal mode and ipc mode (mobile_profile only) +// Ideally we would remove the dump() and just do ipc logging function dumpLog(msg) { dump(msg); MozillaFileLogger.log(msg); @@ -56,8 +56,8 @@ MozillaFileLogger.init = function(path) { } MozillaFileLogger.getLogCallback = function() { - return function (msg) { - var data = msg.num + " " + msg.level + " " + msg.info.join(' ') + "\n"; + return function(msg) { + var data = msg.num + " " + msg.level + " " + msg.info.join(" ") + "\n"; if (MozillaFileLogger._foStream) MozillaFileLogger._foStream.write(data, data.length); @@ -72,21 +72,21 @@ MozillaFileLogger.log = function(msg) { try { if (MozillaFileLogger._foStream) MozillaFileLogger._foStream.write(msg, msg.length); - } catch(ex) {} + } catch (ex) {} } MozillaFileLogger.close = function() { - if(MozillaFileLogger._foStream) + if (MozillaFileLogger._foStream) MozillaFileLogger._foStream.close(); - + MozillaFileLogger._foStream = null; MozillaFileLogger._file = null; } try { - var prefs = Cc['@mozilla.org/preferences-service;1'] + var prefs = Cc["@mozilla.org/preferences-service;1"] .getService(Ci.nsIPrefBranch2); - var filename = prefs.getCharPref('talos.logfile'); + var filename = prefs.getCharPref("talos.logfile"); MozillaFileLogger.init(filename); -} catch (ex) {} //pref does not exist, return empty string +} catch (ex) {} // pref does not exist, return empty string diff --git a/testing/talos/talos/pageloader/chrome/Profiler.js b/testing/talos/talos/pageloader/chrome/Profiler.js index 2c86d84090ba..4c8427ae8f1e 100644 --- a/testing/talos/talos/pageloader/chrome/Profiler.js +++ b/testing/talos/talos/pageloader/chrome/Profiler.js @@ -18,7 +18,7 @@ // relevant parts of our tests. var Profiler; -(function(){ +(function() { var _profiler; // If this script is loaded in a framescript context, there won't be a @@ -40,7 +40,7 @@ var Profiler; // (It's not required nor allowed for addons since Firefox 17) // It's used inside talos from non-privileged pages (like during tscroll), // and it works because talos disables all/most security measures. - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) {} try { @@ -71,7 +71,7 @@ var Profiler; * - gecko_profile_threads * - gecko_profile_dir */ - initFromObject: function Profiler__initFromObject (obj) { + initFromObject: function Profiler__initFromObject(obj) { if (obj && ("gecko_profile_dir" in obj) && typeof obj.gecko_profile_dir == "string" && ("gecko_profile_interval" in obj) && Number.isFinite(obj.gecko_profile_interval * 1) && @@ -84,10 +84,10 @@ var Profiler; enabled = true; } }, - initFromURLQueryParams: function Profiler__initFromURLQueryParams (locationSearch) { + initFromURLQueryParams: function Profiler__initFromURLQueryParams(locationSearch) { this.initFromObject(searchToObject(locationSearch)); }, - beginTest: function Profiler__beginTest (testName) { + beginTest: function Profiler__beginTest(testName) { currentTest = testName; if (_profiler && enabled) { _profiler.StartProfiler(profiler_entries, profiler_interval, @@ -98,13 +98,13 @@ var Profiler; } } }, - finishTest: function Profiler__finishTest () { + finishTest: function Profiler__finishTest() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/" + currentTest + ".profile"); _profiler.StopProfiler(); } }, - finishTestAsync: function Profiler__finishTest () { + finishTestAsync: function Profiler__finishTest() { if (!(_profiler && enabled)) { return; } @@ -141,13 +141,13 @@ var Profiler; }); }); }, - finishStartupProfiling: function Profiler__finishStartupProfiling () { + finishStartupProfiling: function Profiler__finishStartupProfiling() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/startup.profile"); _profiler.StopProfiler(); } }, - resume: function Profiler__resume (name, explicit) { + resume: function Profiler__resume(name, explicit) { if (_profiler) { if (_profiler.ResumeSampling) { _profiler.ResumeSampling(); @@ -155,7 +155,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'Start of test "' + (name || test_name) + '"'); } }, - pause: function Profiler__pause (name, explicit) { + pause: function Profiler__pause(name, explicit) { if (_profiler) { if (_profiler.PauseSampling) { _profiler.PauseSampling(); @@ -163,7 +163,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'End of test "' + (name || test_name) + '"'); } }, - mark: function Profiler__mark (marker, explicit) { + mark: function Profiler__mark(marker, explicit) { if (_profiler) { _profiler.AddMarker(explicit ? marker : 'Profiler: "' + (marker || test_name) + '"'); } diff --git a/testing/talos/talos/pageloader/chrome/memory.js b/testing/talos/talos/pageloader/chrome/memory.js index fe46fa0214f8..df4218c0318c 100644 --- a/testing/talos/talos/pageloader/chrome/memory.js +++ b/testing/talos/talos/pageloader/chrome/memory.js @@ -12,7 +12,7 @@ function initializeMemoryCollector(callback, args) { var os = Components.classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); - os.addObserver(function () { + os.addObserver(function() { var os = Components.classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); @@ -29,13 +29,13 @@ function initializeMemoryCollector(callback, args) { * we will assume there is no child process. */ var event = { - notify: function(timer) { + notify(timer) { memTimer = null; gChildProcess = false; gMemCallback(); } } - + var memTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); memTimer.initWithCallback(event, 10000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); diff --git a/testing/talos/talos/pageloader/chrome/pageloader.js b/testing/talos/talos/pageloader/chrome/pageloader.js index 9f0919b0e8db..06daea109549 100644 --- a/testing/talos/talos/pageloader/chrome/pageloader.js +++ b/testing/talos/talos/pageloader/chrome/pageloader.js @@ -47,7 +47,7 @@ var gDisableE10S = false; var gUseE10S = false; var profilingInfo = false; -//when TEST_DOES_OWN_TIMING, we need to store the time from the page as MozAfterPaint can be slower than pageload +// when TEST_DOES_OWN_TIMING, we need to store the time from the page as MozAfterPaint can be slower than pageload var gTime = -1; var gStartTime = -1; var gReference = -1; @@ -118,7 +118,7 @@ function plInit() { try { var args; - + /* * Desktop firefox: * non-chrome talos runs - tp-cmdline will create and load pageloader @@ -172,25 +172,25 @@ function plInit() { pages = plLoadURLsFromURI(fileURI); if (!pages) { - dumpLine('tp: could not load URLs, quitting'); + dumpLine("tp: could not load URLs, quitting"); plStop(true); } if (pages.length == 0) { - dumpLine('tp: no pages to test, quitting'); + dumpLine("tp: no pages to test, quitting"); plStop(true); } if (startIndex < 0) startIndex = 0; if (endIndex == -1 || endIndex >= pages.length) - endIndex = pages.length-1; + endIndex = pages.length - 1; if (startIndex > endIndex) { dumpLine("tp: error: startIndex >= endIndex"); plStop(true); } - pages = pages.slice(startIndex,endIndex+1); + pages = pages.slice(startIndex, endIndex + 1); pageUrls = pages.map(function(p) { return p.url.spec.toString(); }); report = new Report(); @@ -220,15 +220,15 @@ function plInit() { gPaintWindow = browserWindow; // get our window out of the way - window.resizeTo(10,10); + window.resizeTo(10, 10); - var browserLoadFunc = function (ev) { - browserWindow.removeEventListener('load', browserLoadFunc, true); + var browserLoadFunc = function(ev) { + browserWindow.removeEventListener("load", browserLoadFunc, true); // do this half a second after load, because we need to be // able to resize the window and not have it get clobbered // by the persisted values - setTimeout(function () { + setTimeout(function() { // For e10s windows, since bug 1261842, the initial browser is remote unless // it attempts to browse to a URI that should be non-remote (landed at bug 1047603). // @@ -297,8 +297,8 @@ function plInit() { }, 500); }; - browserWindow.addEventListener('load', browserLoadFunc, true); - } catch(e) { + browserWindow.addEventListener("load", browserLoadFunc, true); + } catch (e) { dumpLine("pageloader exception: " + e); plStop(true); } @@ -309,10 +309,10 @@ function plPageFlags() { } var ContentListener = { - receiveMessage: function(message) { + receiveMessage(message) { switch (message.name) { - case 'PageLoader:LoadEvent': return plLoadHandlerMessage(message); - case 'PageLoader:RecordTime': return plRecordTimeMessage(message); + case "PageLoader:LoadEvent": return plLoadHandlerMessage(message); + case "PageLoader:RecordTime": return plRecordTimeMessage(message); } }, }; @@ -337,9 +337,9 @@ function plLoadPage() { // if the page does its own timing, use a capturing handler // to make sure that we can set up the function for content to call - content.addEventListener('load', plLoadHandlerCapturing, true); + content.addEventListener("load", plLoadHandlerCapturing, true); removeLastAddedListener = function() { - content.removeEventListener('load', plLoadHandlerCapturing, true); + content.removeEventListener("load", plLoadHandlerCapturing, true); if (useMozAfterPaint) { content.removeEventListener("MozAfterPaint", plPaintedCapturing, true); gPaintListener = false; @@ -351,9 +351,9 @@ function plLoadPage() { // XXX we use a capturing event here too -- load events don't bubble up // to the element. See bug 390263. - content.addEventListener('load', plLoadHandler, true); + content.addEventListener("load", plLoadHandler, true); removeLastAddedListener = function() { - content.removeEventListener('load', plLoadHandler, true); + content.removeEventListener("load", plLoadHandler, true); if (useMozAfterPaint) { gPaintWindow.removeEventListener("MozAfterPaint", plPainted, true); gPaintListener = false; @@ -364,11 +364,11 @@ function plLoadPage() { // If the test browser is remote (e10s / IPC) we need to use messages to watch for page load if (gUseE10S) { let mm = content.selectedBrowser.messageManager; - mm.addMessageListener('PageLoader:LoadEvent', ContentListener); - mm.addMessageListener('PageLoader:RecordTime', ContentListener); + mm.addMessageListener("PageLoader:LoadEvent", ContentListener); + mm.addMessageListener("PageLoader:RecordTime", ContentListener); removeLastAddedMsgListener = function() { - mm.removeMessageListener('PageLoader:LoadEvent', ContentListener); - mm.removeMessageListener('PageLoader:RecordTime', ContentListener); + mm.removeMessageListener("PageLoader:LoadEvent", ContentListener); + mm.removeMessageListener("PageLoader:RecordTime", ContentListener); }; } @@ -401,7 +401,7 @@ function startAndLoadURI(pageName) { function getTestName() { // returns tp5n var pageName = pages[pageIndex].url.spec; - let parts = pageName.split('/'); + let parts = pageName.split("/"); if (parts.length > 4) { return parts[4]; } @@ -410,7 +410,7 @@ function getTestName() { // returns tp5n function getCurrentPageShortName() { var pageName = pages[pageIndex].url.spec; - let parts = pageName.split('/'); + let parts = pageName.split("/"); if (parts.length > 5) { return parts[5]; } @@ -422,16 +422,16 @@ function loadFail() { numRetries++; if (numRetries >= maxRetries) { - dumpLine('__FAILTimeout in ' + getTestName() + '__FAIL'); - dumpLine('__FAILTimeout (' + numRetries + '/' + maxRetries + ') exceeded on ' + pageName + '__FAIL'); + dumpLine("__FAILTimeout in " + getTestName() + "__FAIL"); + dumpLine("__FAILTimeout (" + numRetries + "/" + maxRetries + ") exceeded on " + pageName + "__FAIL"); Profiler.finishTest(); plStop(true); } else { - dumpLine('__WARNTimeout (' + numRetries + '/' + maxRetries + ') exceeded on ' + pageName + '__WARN'); + dumpLine("__WARNTimeout (" + numRetries + "/" + maxRetries + ") exceeded on " + pageName + "__WARN"); // TODO: make this a cleaner cleanup pageCycle--; - content.removeEventListener('load', plLoadHandler, true); - content.removeEventListener('load', plLoadHandlerCapturing, true); + content.removeEventListener("load", plLoadHandler, true); + content.removeEventListener("load", plLoadHandlerCapturing, true); content.removeEventListener("MozAfterPaint", plPaintedCapturing, true); content.removeEventListener("MozAfterPaint", plPainted, true); gPaintWindow.removeEventListener("MozAfterPaint", plPaintedCapturing, true); @@ -440,7 +440,7 @@ function loadFail() { removeLastAddedMsgListener = null; gPaintListener = false; - //TODO: consider adding a tab and removing the old tab?!? + // TODO: consider adding a tab and removing the old tab?!? setTimeout(plLoadPage, delay); } } @@ -455,7 +455,7 @@ var plNextPage = async function() { await Profiler.finishTestAsync(); } - if (pageIndex < pages.length-1) { + if (pageIndex < pages.length - 1) { pageIndex++; if (profilingInfo) { Profiler.beginTest(getCurrentPageShortName()); @@ -502,7 +502,7 @@ function forceContentGC() { function plRecordTime(time) { var pageName = pages[pageIndex].url.spec; var i = pageIndex - if (i < pages.length-1) { + if (i < pages.length - 1) { i++; } else { i = 0; @@ -512,8 +512,8 @@ function plRecordTime(time) { recordedName = pageUrls[pageIndex]; } if (typeof(time) == "string") { - var times = time.split(','); - var names = recordedName.split(','); + var times = time.split(","); + var names = recordedName.split(","); for (var t = 0; t < times.length; t++) { if (names.length == 1) { report.recordTime(names, times[t]); @@ -525,31 +525,31 @@ function plRecordTime(time) { report.recordTime(recordedName, time); } if (noisy) { - dumpLine("Cycle " + (cycle+1) + "(" + pageCycle + ")" + ": loaded " + pageName + " (next: " + nextName + ")"); + dumpLine("Cycle " + (cycle + 1) + "(" + pageCycle + ")" + ": loaded " + pageName + " (next: " + nextName + ")"); } } function plLoadHandlerCapturing(evt) { // make sure we pick up the right load event - if (evt.type != 'load' || + if (evt.type != "load" || evt.originalTarget.defaultView.frameElement) return; - //set the tpRecordTime function (called from test pages we load) to store a global time. - content.contentWindow.wrappedJSObject.tpRecordTime = function (time, startTime, testName) { + // set the tpRecordTime function (called from test pages we load) to store a global time. + content.contentWindow.wrappedJSObject.tpRecordTime = function(time, startTime, testName) { gTime = time; gStartTime = startTime; recordedName = testName; setTimeout(plWaitForPaintingCapturing, 0); } - content.contentWindow.wrappedJSObject.plGarbageCollect = function () { + content.contentWindow.wrappedJSObject.plGarbageCollect = function() { window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils) .garbageCollect(); } - content.removeEventListener('load', plLoadHandlerCapturing, true); + content.removeEventListener("load", plLoadHandlerCapturing, true); removeLastAddedListener = null; setTimeout(plWaitForPaintingCapturing, 0); @@ -561,9 +561,9 @@ function sendScroll() { const SCROLL_TEST_NUM_STEPS = 100; // The page doesn't really use tpRecordTime. Instead, we trigger the scroll test, // and the scroll test will call tpRecordTime which will take us to the next page - let details = {target: 'content', stepSize: SCROLL_TEST_STEP_PX, opt_numSteps: SCROLL_TEST_NUM_STEPS}; + let details = {target: "content", stepSize: SCROLL_TEST_STEP_PX, opt_numSteps: SCROLL_TEST_NUM_STEPS}; let mm = content.selectedBrowser.messageManager; - mm.sendAsyncMessage("PageLoader:ScrollTest", { details: details }); + mm.sendAsyncMessage("PageLoader:ScrollTest", { details }); } function plWaitForPaintingCapturing() { @@ -616,11 +616,11 @@ function _loadHandlerCapturing() { // the onload handler function plLoadHandler(evt) { // make sure we pick up the right load event - if (evt.type != 'load' || + if (evt.type != "load" || evt.originalTarget.defaultView.frameElement) return; - content.removeEventListener('load', plLoadHandler, true); + content.removeEventListener("load", plLoadHandler, true); setTimeout(waitForPainted, 0); } @@ -749,7 +749,7 @@ function plStopAll(force) { if (force == false) { pageIndex = 0; pageCycle = 1; - if (cycle < NUM_CYCLES-1) { + if (cycle < NUM_CYCLES - 1) { cycle++; recordedName = null; setTimeout(plLoadPage, delay); @@ -769,16 +769,16 @@ function plStopAll(force) { } if (content) { - content.removeEventListener('load', plLoadHandlerCapturing, true); - content.removeEventListener('load', plLoadHandler, true); + content.removeEventListener("load", plLoadHandlerCapturing, true); + content.removeEventListener("load", plLoadHandler, true); if (useMozAfterPaint) content.removeEventListener("MozAfterPaint", plPaintedCapturing, true); content.removeEventListener("MozAfterPaint", plPainted, true); if (gUseE10S) { let mm = content.selectedBrowser.messageManager; - mm.removeMessageListener('PageLoader:LoadEvent', ContentListener); - mm.removeMessageListener('PageLoader:RecordTime', ContentListener); + mm.removeMessageListener("PageLoader:LoadEvent", ContentListener); + mm.removeMessageListener("PageLoader:RecordTime", ContentListener); mm.loadFrameScript("data:,removeEventListener('load', _contentLoadHandler, true);", false, true); } @@ -804,7 +804,7 @@ function plLoadURLsFromURI(manifestUri) { try { fstream.init(uriFile.file, -1, 0, 0); - } catch(ex) { + } catch (ex) { dumpLine("tp: the file %s doesn't exist" % uriFile.file); return null; } @@ -814,7 +814,7 @@ function plLoadURLsFromURI(manifestUri) { var d = []; var lineNo = 0; - var line = {value:null}; + var line = {value: null}; var more; do { lineNo++; @@ -822,10 +822,10 @@ function plLoadURLsFromURI(manifestUri) { var s = line.value; // strip comments (only leading ones) - s = s.replace(/^#.*/, ''); + s = s.replace(/^#.*/, ""); // strip leading and trailing whitespace - s = s.replace(/^\s*/, '').replace(/\s*$/, ''); + s = s.replace(/^\s*/, "").replace(/\s*$/, ""); if (!s) continue; @@ -880,8 +880,8 @@ function plLoadURLsFromURI(manifestUri) { if (pageFilterRegexp && !pageFilterRegexp.test(url.spec)) continue; - d.push({ url: url, - flags: flags }); + d.push({ url, + flags }); } } while (more); diff --git a/testing/talos/talos/pageloader/chrome/quit.js b/testing/talos/talos/pageloader/chrome/quit.js index b6ea2864748c..97ab376c03b5 100644 --- a/testing/talos/talos/pageloader/chrome/quit.js +++ b/testing/talos/talos/pageloader/chrome/quit.js @@ -40,69 +40,53 @@ These files did not have a license */ -function canQuitApplication() -{ +function canQuitApplication() { var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); - if (!os) - { + if (!os) { return true; } - - try - { + + try { var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"] .createInstance(Components.interfaces.nsISupportsPRBool); os.notifyObservers(cancelQuit, "quit-application-requested"); - - // Something aborted the quit process. - if (cancelQuit.data) - { + + // Something aborted the quit process. + if (cancelQuit.data) { return false; } - } - catch (ex) - { + } catch (ex) { } return true; } -function goQuitApplication() -{ - if (!canQuitApplication()) - { +function goQuitApplication() { + if (!canQuitApplication()) { return false; } - const kAppStartup = '@mozilla.org/toolkit/app-startup;1'; - const kAppShell = '@mozilla.org/appshell/appShellService;1'; - var appService; - var forceQuit; + const kAppStartup = "@mozilla.org/toolkit/app-startup;1"; + const kAppShell = "@mozilla.org/appshell/appShellService;1"; + var appService; + var forceQuit; - if (kAppStartup in Components.classes) - { + if (kAppStartup in Components.classes) { appService = Components.classes[kAppStartup]. getService(Components.interfaces.nsIAppStartup); forceQuit = Components.interfaces.nsIAppStartup.eForceQuit; - } - else if (kAppShell in Components.classes) - { + } else if (kAppShell in Components.classes) { appService = Components.classes[kAppShell]. getService(Components.interfaces.nsIAppShellService); forceQuit = Components.interfaces.nsIAppShellService.eForceQuit; - } - else - { - throw 'goQuitApplication: no AppStartup/appShell'; + } else { + throw "goQuitApplication: no AppStartup/appShell"; } - try - { + try { appService.quit(forceQuit); - } - catch(ex) - { - throw('goQuitApplication: ' + ex); + } catch (ex) { + throw ("goQuitApplication: " + ex); } return true; diff --git a/testing/talos/talos/pageloader/chrome/report.js b/testing/talos/talos/pageloader/chrome/report.js index 6c801070a99f..d8c6d99d3146 100644 --- a/testing/talos/talos/pageloader/chrome/report.js +++ b/testing/talos/talos/pageloader/chrome/report.js @@ -66,10 +66,10 @@ Report.prototype.getReport = function() { report += "_x_x_mozilla_page_load_details\n"; report += "|i|pagename|runs|\n"; - for (var i=0; i < pages.length; i++) { - report += '|'+ - i + ';'+ - pages[i].substr(prefixLen) + ';'+ + for (var i = 0; i < pages.length; i++) { + report += "|" + + i + ";" + + pages[i].substr(prefixLen) + ";" + this.timeVals[pages[i]].join(";") + "\n"; } @@ -81,7 +81,7 @@ Report.prototype.getReport = function() { report += "__end_cc_report\n"; } var now = (new Date()).getTime(); - report += "__startTimestamp" + now + "__endTimestamp\n"; //timestamp for determning shutdown time, used by talos + report += "__startTimestamp" + now + "__endTimestamp\n"; // timestamp for determning shutdown time, used by talos return report; } @@ -129,19 +129,19 @@ Report.prototype.getReportSummary = function() { report += "------- Summary: start -------\n"; report += "Number of tests: " + pages.length + "\n"; - for (var i=0; i < pages.length; i++) { + for (var i = 0; i < pages.length; i++) { var results = this.timeVals[pages[i]].map(function(v) { return Number(v); }); - report += '\n[#'+ i + '] ' + pages[i].substr(prefixLen) - + ' Cycles:' + results.length - + ' Average:' + average(results).toFixed(2) - + ' Median:' + median(results).toFixed(2) - + ' stddev:' + stddev(results).toFixed(2) - + ' (' + (100 * stddev(results) / median(results)).toFixed(1) + '%)' - + (results.length < 5 ? '' : (' stddev-sans-first:' + stddev(results.slice(1)).toFixed(2))) - + '\nValues: ' + results.map(function(v) { + report += "\n[#" + i + "] " + pages[i].substr(prefixLen) + + " Cycles:" + results.length + + " Average:" + average(results).toFixed(2) + + " Median:" + median(results).toFixed(2) + + " stddev:" + stddev(results).toFixed(2) + + " (" + (100 * stddev(results) / median(results)).toFixed(1) + "%)" + + (results.length < 5 ? "" : (" stddev-sans-first:" + stddev(results.slice(1)).toFixed(2))) + + "\nValues: " + results.map(function(v) { return v.toFixed(1); }).join(" ") + "\n"; diff --git a/testing/talos/talos/pageloader/chrome/tscroll.js b/testing/talos/talos/pageloader/chrome/tscroll.js index b3f1b74d29a9..24fd13eef689 100644 --- a/testing/talos/talos/pageloader/chrome/tscroll.js +++ b/testing/talos/talos/pageloader/chrome/tscroll.js @@ -2,8 +2,7 @@ // unprivileged code. // - Please make sure that any changes apply cleanly to all use cases. -function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) -{ +function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) { var win; if (target == "content") { target = content.wrappedJSObject; @@ -32,7 +31,7 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) replyId: 1, // dispatch an event to the framescript and register the result/callback event - exec: function(commandName, arg, callback, opt_custom_window) { + exec(commandName, arg, callback, opt_custom_window) { let win = opt_custom_window || window; let replyEvent = "TalosPowers:ParentExec:ReplyEvent:" + this.replyId++; if (callback) { @@ -69,10 +68,10 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) function P_setupReportFn() { return new Promise(function(resolve) { report = opt_reportFunc || win.tpRecordTime; - if (report == 'PageLoader:RecordTime') { + if (report == "PageLoader:RecordTime") { report = function(duration, start, name) { var msg = { time: duration, startTime: start, testName: name }; - sendAsyncMessage('PageLoader:RecordTime', msg); + sendAsyncMessage("PageLoader:RecordTime", msg); } resolve(); return; @@ -81,13 +80,13 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) // Not part of the test and does nothing if we're within talos. // Provides an alternative tpRecordTime (with some stats display) if running in a browser. if (!report && document.head) { - var imported = document.createElement('script'); + var imported = document.createElement("script"); imported.addEventListener("load", function() { report = tpRecordTime; resolve(); }); - imported.src = '../../scripts/talos-debug.js?dummy=' + Date.now(); // For some browsers to re-read + imported.src = "../../scripts/talos-debug.js?dummy=" + Date.now(); // For some browsers to re-read document.head.appendChild(imported); return; } @@ -118,14 +117,14 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) return (win.performance && win.performance.now) ? win.performance.now() : Date.now(); - }; + } var isWindow = target.self === target; var getPos = isWindow ? function() { return target.pageYOffset; } : function() { return target.scrollTop; }; - var gotoTop = isWindow ? function() { target.scroll(0, 0); ensureScroll(); } + var gotoTop = isWindow ? function() { target.scroll(0, 0); ensureScroll(); } : function() { target.scrollTop = 0; ensureScroll(); }; var doScrollTick = isWindow ? function() { target.scrollBy(0, stepSize); ensureScroll(); } @@ -230,7 +229,7 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) stopFrameTimeRecording(handle, function(intervals) { function average(arr) { var sum = 0; - for(var i = 0; i < arr.length; i++) + for (var i = 0; i < arr.length; i++) sum += arr[i]; return arr.length ? sum / arr.length : 0; } @@ -264,7 +263,7 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) try { function handleMessageFromChrome(message) { var payload = message.data.details; - testScroll(payload.target, payload.stepSize, 'PageLoader:RecordTime', payload.opt_numSteps); + testScroll(payload.target, payload.stepSize, "PageLoader:RecordTime", payload.opt_numSteps); } addMessageListener("PageLoader:ScrollTest", handleMessageFromChrome); diff --git a/testing/talos/talos/pageloader/components/tp-cmdline.js b/testing/talos/talos/pageloader/components/tp-cmdline.js index 3e18b37d6c6c..3a0d582c3540 100644 --- a/testing/talos/talos/pageloader/components/tp-cmdline.js +++ b/testing/talos/talos/pageloader/components/tp-cmdline.js @@ -41,10 +41,10 @@ // to handle multiple arguments. const TP_CMDLINE_CONTRACTID = "@mozilla.org/commandlinehandler/general-startup;1?type=tp"; -const TP_CMDLINE_CLSID = Components.ID('{8AF052F5-8EFE-4359-8266-E16498A82E8B}'); +const TP_CMDLINE_CLSID = Components.ID("{8AF052F5-8EFE-4359-8266-E16498A82E8B}"); const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1"; const nsISupports = Components.interfaces.nsISupports; - + const nsICategoryManager = Components.interfaces.nsICategoryManager; const nsICommandLine = Components.interfaces.nsICommandLine; const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler; @@ -58,7 +58,7 @@ function PageLoaderCmdLineHandler() {} PageLoaderCmdLineHandler.prototype = { /* nsISupports */ - QueryInterface : function handler_QI(iid) { + QueryInterface: function handler_QI(iid) { if (iid.equals(nsISupports)) return this; @@ -69,7 +69,7 @@ PageLoaderCmdLineHandler.prototype = }, /* nsICommandLineHandler */ - handle : function handler_handle(cmdLine) { + handle: function handler_handle(cmdLine) { var args = {}; try { var uristr = cmdLine.handleFlagWithParam("tp", false); @@ -101,8 +101,7 @@ PageLoaderCmdLineHandler.prototype = args.scrolltest = cmdLine.handleFlag("tpscrolltest", false); args.disableE10s = cmdLine.handleFlag("tpdisable_e10s", false); args.rss = cmdLine.handleFlag("rss", false); - } - catch (e) { + } catch (e) { return; } @@ -116,7 +115,7 @@ PageLoaderCmdLineHandler.prototype = cmdLine.preventDefault = true; }, - helpInfo : + helpInfo: " -tp Run pageload perf tests on given manifest\n" + " -tpfilter str Only include pages from manifest that contain str (regexp)\n" + " -tpcycles n Loop through pages n times\n" + @@ -129,7 +128,7 @@ PageLoaderCmdLineHandler.prototype = " -tpheight height Height of window\n" + " -tbprofilinginfo A JSON object describing profiler settings\n" + " -tpoffline Force offline mode\n" + - " -tpnoisy Dump the name of the last loaded page to console\n" + + " -tpnoisy Dump the name of the last loaded page to console\n" + " -tptimeout Max amount of time given for a page to load, quit if exceeded\n" + " -tpdelay Amount of time to wait between each pageload\n" + " -tpnoforcecc Don't force cycle collection between each pageload\n" + @@ -143,8 +142,7 @@ PageLoaderCmdLineHandler.prototype = var PageLoaderCmdLineFactory = { - createInstance : function(outer, iid) - { + createInstance(outer, iid) { if (outer != null) { throw Components.results.NS_ERROR_NO_AGGREGATION; } @@ -162,8 +160,7 @@ function NSGetFactory(cid) { var PageLoaderCmdLineModule = { - registerSelf : function(compMgr, fileSpec, location, type) - { + registerSelf(compMgr, fileSpec, location, type) { compMgr = compMgr.QueryInterface(nsIComponentRegistrar); compMgr.registerFactoryLocation(TP_CMDLINE_CLSID, @@ -179,8 +176,7 @@ var PageLoaderCmdLineModule = TP_CMDLINE_CONTRACTID, true, true); }, - unregisterSelf : function(compMgr, fileSpec, location) - { + unregisterSelf(compMgr, fileSpec, location) { compMgr = compMgr.QueryInterface(nsIComponentRegistrar); compMgr.unregisterFactoryLocation(TP_CMDLINE_CLSID, fileSpec); @@ -189,13 +185,11 @@ var PageLoaderCmdLineModule = "m-tp", true); }, - getClassObject : function(compMgr, cid, iid) - { + getClassObject(compMgr, cid, iid) { return NSGetFactory(cid); }, - canUnload : function(compMgr) - { + canUnload(compMgr) { return true; } }; diff --git a/testing/talos/talos/scripts/MozillaFileLogger.js b/testing/talos/talos/scripts/MozillaFileLogger.js index cf8dbb2c8cce..1461833ea310 100644 --- a/testing/talos/talos/scripts/MozillaFileLogger.js +++ b/testing/talos/talos/scripts/MozillaFileLogger.js @@ -11,7 +11,7 @@ function contentDispatchEvent(type, data, sync) { var element = new CustomEvent("contentEvent", { bubbles: true, - detail: { sync: sync, type: type, data: JSON.stringify(data) } + detail: { sync, type, data: JSON.stringify(data) } }); document.dispatchEvent(element); } @@ -24,8 +24,8 @@ function contentAsyncEvent(type, data) { contentDispatchEvent(type, data, 0); } -//double logging to account for normal mode and ipc mode (mobile_profile only) -//Ideally we would remove the dump() and just do ipc logging +// double logging to account for normal mode and ipc mode (mobile_profile only) +// Ideally we would remove the dump() and just do ipc logging function dumpLog(msg) { dump(msg); MozFileLogger.log(msg); @@ -82,10 +82,10 @@ MozFileLogger.init = function(path) { } MozFileLogger.getLogCallback = function() { - return function (msg) { + return function(msg) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var data = msg.num + " " + msg.level + " " + msg.info.join(' ') + "\n"; + var data = msg.num + " " + msg.level + " " + msg.info.join(" ") + "\n"; if (MozFileLogger._foStream) MozFileLogger._foStream.write(data, data.length); @@ -102,7 +102,7 @@ MozFileLogger.log = function(msg) { try { if (MozFileLogger._foStream) MozFileLogger._foStream.write(msg, msg.length); - } catch(ex) {} + } catch (ex) {} } MozFileLogger.close = function() { @@ -113,17 +113,17 @@ MozFileLogger.close = function() { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - if(MozFileLogger._foStream) + if (MozFileLogger._foStream) MozFileLogger._foStream.close(); - + MozFileLogger._foStream = null; MozFileLogger._file = null; } try { - var prefs = Components.classes['@mozilla.org/preferences-service;1'] + var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch2); - var filename = prefs.getCharPref('talos.logfile'); + var filename = prefs.getCharPref("talos.logfile"); MozFileLogger.init(filename); -} catch (ex) {} //pref does not exist, return empty string +} catch (ex) {} // pref does not exist, return empty string diff --git a/testing/talos/talos/scripts/Profiler.js b/testing/talos/talos/scripts/Profiler.js index 9d94cfb543f3..be6300e0f6a2 100644 --- a/testing/talos/talos/scripts/Profiler.js +++ b/testing/talos/talos/scripts/Profiler.js @@ -18,7 +18,7 @@ // relevant parts of our tests. var Profiler; -(function(){ +(function() { var _profiler; // If this script is loaded in a framescript context, there won't be a @@ -40,7 +40,7 @@ var Profiler; // (It's not required nor allowed for addons since Firefox 17) // It's used inside talos from non-privileged pages (like during tscroll), // and it works because talos disables all/most security measures. - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) {} try { @@ -71,7 +71,7 @@ var Profiler; * - gecko_profile_threads * - gecko_profile_dir */ - initFromObject: function Profiler__initFromObject (obj) { + initFromObject: function Profiler__initFromObject(obj) { if (obj && ("gecko_profile_dir" in obj) && typeof obj.gecko_profile_dir == "string" && ("gecko_profile_interval" in obj) && Number.isFinite(obj.gecko_profile_interval * 1) && @@ -84,10 +84,10 @@ var Profiler; enabled = true; } }, - initFromURLQueryParams: function Profiler__initFromURLQueryParams (locationSearch) { + initFromURLQueryParams: function Profiler__initFromURLQueryParams(locationSearch) { this.initFromObject(searchToObject(locationSearch)); }, - beginTest: function Profiler__beginTest (testName) { + beginTest: function Profiler__beginTest(testName) { currentTest = testName; if (_profiler && enabled) { _profiler.StartProfiler(profiler_entries, profiler_interval, @@ -98,19 +98,19 @@ var Profiler; } } }, - finishTest: function Profiler__finishTest () { + finishTest: function Profiler__finishTest() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/" + currentTest + ".profile"); _profiler.StopProfiler(); } }, - finishStartupProfiling: function Profiler__finishStartupProfiling () { + finishStartupProfiling: function Profiler__finishStartupProfiling() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/startup.profile"); _profiler.StopProfiler(); } }, - resume: function Profiler__resume (name, explicit) { + resume: function Profiler__resume(name, explicit) { if (_profiler) { if (_profiler.ResumeSampling) { _profiler.ResumeSampling(); @@ -118,7 +118,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'Start of test "' + (name || test_name) + '"'); } }, - pause: function Profiler__pause (name, explicit) { + pause: function Profiler__pause(name, explicit) { if (_profiler) { if (_profiler.PauseSampling) { _profiler.PauseSampling(); @@ -126,7 +126,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'End of test "' + (name || test_name) + '"'); } }, - mark: function Profiler__mark (marker, explicit) { + mark: function Profiler__mark(marker, explicit) { if (_profiler) { _profiler.AddMarker(explicit ? marker : 'Profiler: "' + (marker || test_name) + '"'); } diff --git a/testing/talos/talos/scripts/talos-debug.js b/testing/talos/talos/scripts/talos-debug.js index b01d63a809af..eb0aec8f458d 100644 --- a/testing/talos/talos/scripts/talos-debug.js +++ b/testing/talos/talos/scripts/talos-debug.js @@ -2,7 +2,7 @@ * 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/. */ -/****************************************************************** +/** **************************************************************** * window.talosDebug provides some statistical functions * (sum, average, median, stddev) and a tpRecordTime method which * reports some statistics about the data set, including detected @@ -16,24 +16,24 @@ *****************************************************************/ window.talosDebug = { // Optional config properties - disabled : false, + disabled: false, ignore: -1, // Number of items to ignore at the begining of the set. -1 for auto-detect. displayData: false, // If true, will also display all the data points. fixed: 2, // default floating point digits for display. // End of config - sum: function (values) { - return values.reduce(function(a, b){return a + b;}); + sum(values) { + return values.reduce(function(a, b) { return a + b; }); }, - average: function (values) { + average(values) { var d = window.talosDebug; return values.length ? d.sum(values) / values.length : 999999; }, - median: function (values) { + median(values) { var clone = values.slice(0); - var sorted = clone.sort(function(a, b){ return (a > b) ? 1 : ((a < b) ? -1 : 0); }); + var sorted = clone.sort(function(a, b) { return (a > b) ? 1 : ((a < b) ? -1 : 0); }); var len = values.length; if (!len) return 999999; @@ -42,14 +42,14 @@ window.talosDebug = { return (sorted[len / 2] + sorted[len / 2 - 1]) / 2; // Average value of the two middle items. }, - stddev: function (values, avg) { + stddev(values, avg) { if (values.length <= 1) { return 0; } return Math.sqrt( - values.map(function (v) { return Math.pow(v - avg, 2); }) - .reduce(function (a, b) { return a + b; }) / (values.length - 1)); + values.map(function(v) { return Math.pow(v - avg, 2); }) + .reduce(function(a, b) { return a + b; }) / (values.length - 1)); }, // Estimate the number of warmup iterations of this data set (in a completely unscrientific way). @@ -64,7 +64,7 @@ window.talosDebug = { // Now we should have an index which is at least the 2nd value within the stable part. // We get stddev for that index..end (baseStd), and then go backwards as long as stddev is // decreasing or within ~1% of baseStd, and return the earliest index for which it is. - detectWarmup: function (values) { + detectWarmup(values) { var MIN_WIDTH = 3; var MAX_WIDTH = 7; var d = window.talosDebug; @@ -113,7 +113,7 @@ window.talosDebug = { return stableFrom; }, - statsDisplay: function (collection) { + statsDisplay(collection) { var d = window.talosDebug; var std = d.stddev(collection, d.average(collection)); var avg = d.average(collection); @@ -124,12 +124,12 @@ window.talosDebug = { "\nStdDev: " + std.toFixed(d.fixed) + " (" + (100 * std / (avg ? avg : 1)).toFixed(d.fixed) + "% of average)"; }, - tpRecordTime: function (dataCSV) { + tpRecordTime(dataCSV) { var d = window.talosDebug; if (d.disabled) return; - var collection = ("" + dataCSV).split(",").map(function(item){ return parseFloat(item); }); + var collection = ("" + dataCSV).split(",").map(function(item) { return parseFloat(item); }); var res = d.statsDisplay(collection); var warmup = (d.ignore >= 0) ? d.ignore : d.detectWarmup(collection); @@ -145,7 +145,7 @@ window.talosDebug = { } if (d.displayData) { - var disp = collection.map(function(item){ + var disp = collection.map(function(item) { return item.toFixed(d.fixed); }); if (warmup >= 0) @@ -168,6 +168,6 @@ window.talosDebug = { } // Enable testing outside of talos by providing an alternative report function. -if (typeof (tpRecordTime) === 'undefined') { +if (typeof (tpRecordTime) === "undefined") { tpRecordTime = window.talosDebug.tpRecordTime; } diff --git a/testing/talos/talos/scripts/xpigen.js b/testing/talos/talos/scripts/xpigen.js index 6cfd28c52f8b..7fb1ea7e6ea9 100644 --- a/testing/talos/talos/scripts/xpigen.js +++ b/testing/talos/talos/scripts/xpigen.js @@ -22,8 +22,7 @@ function createXpiDataUri(base, files, callbacks) { r.open("GET", url, false); r.requestType = "arraybuffer"; r.overrideMimeType("text/plain; charset=x-user-defined"); - try { r.send(); } - catch (e) { throw "FileNotRetrieved: " + url + " - " + e; } + try { r.send(); } catch (e) { throw "FileNotRetrieved: " + url + " - " + e; } // For 'file://' Firefox sets status=0 on success or throws otherwise // In Firefox 34-ish onwards, success status is 200. if (!(r.readyState == 4 && (r.status == 0 || r.status == 200))) @@ -53,14 +52,14 @@ function createXpiDataUri(base, files, callbacks) { } } - return sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) + (nMod3 === 2 ? '' : nMod3 === 1 ? '=' : '=='); + return sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) + (nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "=="); } // Create the zip/xpi try { function dummy() {} - var onsuccess = callbacks.onsuccess || dummy; - var onerror = callbacks.onerror || dummy; + var onsuccess = callbacks.onsuccess || dummy; + var onerror = callbacks.onerror || dummy; var onprogress = callbacks.onprogress || dummy; var zip = new JSZip(); diff --git a/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js b/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js index 60023e603d29..c1299794f8ab 100644 --- a/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js +++ b/testing/talos/talos/startup_test/sessionrestore/addon/SessionRestoreTalosTest.js @@ -34,13 +34,13 @@ nsSessionRestoreTalosTest.prototype = { _xpcom_factory: XPCOMUtils.generateSingletonFactory(nsSessionRestoreTalosTest), - ////////////////////////////////////////////////////////////////////////////// - //// nsISupports + // //////////////////////////////////////////////////////////////////////////// + // // nsISupports QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), - ////////////////////////////////////////////////////////////////////////////// - //// nsIObserver + // //////////////////////////////////////////////////////////////////////////// + // // nsIObserver observe: function DS_observe(aSubject, aTopic, aData) { switch (aTopic) { @@ -62,7 +62,7 @@ nsSessionRestoreTalosTest.prototype = { /** * Perform initialization on profile-after-change. */ - init: function() { + init() { if (StartupPerformance.isRestored) { this.onReady(true); } else { @@ -82,7 +82,7 @@ nsSessionRestoreTalosTest.prototype = { /** * Session Restore is complete, hurray. */ - onReady: function(hasRestoredTabs) { + onReady(hasRestoredTabs) { if (hasRestoredTabs) { Services.obs.removeObserver(this, StartupPerformance.RESTORED_TOPIC); } @@ -151,7 +151,7 @@ nsSessionRestoreTalosTest.prototype = { } }; -//////////////////////////////////////////////////////////////////////////////// -//// Module +// ////////////////////////////////////////////////////////////////////////////// +// // Module this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSessionRestoreTalosTest]); diff --git a/testing/talos/talos/startup_test/sessionrestore/addon/content/main.js b/testing/talos/talos/startup_test/sessionrestore/addon/content/main.js index 4d261b3ab57f..34d5ca1a4328 100755 --- a/testing/talos/talos/startup_test/sessionrestore/addon/content/main.js +++ b/testing/talos/talos/startup_test/sessionrestore/addon/content/main.js @@ -24,12 +24,12 @@ addEventListener("load", function() { // Report data to Talos, if possible dumpLog("__start_report" + - duration + + duration + "__end_report\n\n"); // Next one is required by the test harness but not used dumpLog("__startTimestamp" + - Date.now() + + Date.now() + "__endTimestamp\n\n"); goQuitApplication(); }); diff --git a/testing/talos/talos/startup_test/tpaint.html b/testing/talos/talos/startup_test/tpaint.html index ea519d79c64b..48ea27600daf 100644 --- a/testing/talos/talos/startup_test/tpaint.html +++ b/testing/talos/talos/startup_test/tpaint.html @@ -8,7 +8,7 @@ var OPENER_DELAY = 1000; // ms delay between tests var REPEAT_COUNT = 20; var kid, kidStartTime, kidEndTime, windowIndex, openTimes; -var auto = document.location.search.split('=')[1]; // ?auto=1 +var auto = document.location.search.split("=")[1]; // ?auto=1 /* * tpaint -- measures the amount of time between opening a new window @@ -44,12 +44,12 @@ function scheduleNextWindow() { function calcMedian( numbers ) { // Avoid changing the original array. var sortedNumbers = Array.from(numbers); - sortedNumbers.sort( function (a,b){ return a-b; } ); + sortedNumbers.sort( function(a, b) { return a - b; } ); var n = Math.floor( sortedNumbers.length / 2 ); if (sortedNumbers.length % 2) { return sortedNumbers[n]; } - return ( sortedNumbers[n-1] + sortedNumbers[n] ) / 2; + return ( sortedNumbers[n - 1] + sortedNumbers[n] ) / 2; } async function reportTimes() { @@ -71,10 +71,10 @@ async function reportTimes() { med = calcMedian(openTimes); if (auto) { - dumpLog("__start_report" + openTimes.join('|') + "__end_report"); + dumpLog("__start_report" + openTimes.join("|") + "__end_report"); var now = (new Date()).getTime(); dumpLog("__startTimestamp" + now + "__endTimestamp\n"); - dumpLog("openingTimes="+openTimes.slice(1)+"\n"); + dumpLog("openingTimes=" + openTimes.slice(1) + "\n"); dumpLog("avgOpenTime:" + avg + "\n" ); dumpLog("minOpenTime:" + min + "\n" ); dumpLog("maxOpenTime:" + max + "\n" ); @@ -86,13 +86,13 @@ async function reportTimes() { } else { alert("Average over " + count + " runs: " + avg + "\n" + "(min=" + min + ", max=" + max + ")\n" + - "runs=" + openTimes.join(',')); + "runs=" + openTimes.join(",")); } } async function childIsOpen() { kidEndTime = window.performance.now(); - await TalosContentProfiler.pause('tpaint ' + windowIndex); + await TalosContentProfiler.pause("tpaint " + windowIndex); openTimes[windowIndex] = kidEndTime - kidStartTime; scheduleNextWindow(); } @@ -109,7 +109,7 @@ var kidHTML = " diff --git a/testing/talos/talos/tests/a11y/tablemutation.html b/testing/talos/talos/tests/a11y/tablemutation.html index f5ae9980cd56..54b76742790a 100644 --- a/testing/talos/talos/tests/a11y/tablemutation.html +++ b/testing/talos/talos/tests/a11y/tablemutation.html @@ -76,21 +76,20 @@ diff --git a/testing/talos/talos/tests/devtools/addon/content/Profiler.js b/testing/talos/talos/tests/devtools/addon/content/Profiler.js index 9d94cfb543f3..be6300e0f6a2 100644 --- a/testing/talos/talos/tests/devtools/addon/content/Profiler.js +++ b/testing/talos/talos/tests/devtools/addon/content/Profiler.js @@ -18,7 +18,7 @@ // relevant parts of our tests. var Profiler; -(function(){ +(function() { var _profiler; // If this script is loaded in a framescript context, there won't be a @@ -40,7 +40,7 @@ var Profiler; // (It's not required nor allowed for addons since Firefox 17) // It's used inside talos from non-privileged pages (like during tscroll), // and it works because talos disables all/most security measures. - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) {} try { @@ -71,7 +71,7 @@ var Profiler; * - gecko_profile_threads * - gecko_profile_dir */ - initFromObject: function Profiler__initFromObject (obj) { + initFromObject: function Profiler__initFromObject(obj) { if (obj && ("gecko_profile_dir" in obj) && typeof obj.gecko_profile_dir == "string" && ("gecko_profile_interval" in obj) && Number.isFinite(obj.gecko_profile_interval * 1) && @@ -84,10 +84,10 @@ var Profiler; enabled = true; } }, - initFromURLQueryParams: function Profiler__initFromURLQueryParams (locationSearch) { + initFromURLQueryParams: function Profiler__initFromURLQueryParams(locationSearch) { this.initFromObject(searchToObject(locationSearch)); }, - beginTest: function Profiler__beginTest (testName) { + beginTest: function Profiler__beginTest(testName) { currentTest = testName; if (_profiler && enabled) { _profiler.StartProfiler(profiler_entries, profiler_interval, @@ -98,19 +98,19 @@ var Profiler; } } }, - finishTest: function Profiler__finishTest () { + finishTest: function Profiler__finishTest() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/" + currentTest + ".profile"); _profiler.StopProfiler(); } }, - finishStartupProfiling: function Profiler__finishStartupProfiling () { + finishStartupProfiling: function Profiler__finishStartupProfiling() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/startup.profile"); _profiler.StopProfiler(); } }, - resume: function Profiler__resume (name, explicit) { + resume: function Profiler__resume(name, explicit) { if (_profiler) { if (_profiler.ResumeSampling) { _profiler.ResumeSampling(); @@ -118,7 +118,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'Start of test "' + (name || test_name) + '"'); } }, - pause: function Profiler__pause (name, explicit) { + pause: function Profiler__pause(name, explicit) { if (_profiler) { if (_profiler.PauseSampling) { _profiler.PauseSampling(); @@ -126,7 +126,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'End of test "' + (name || test_name) + '"'); } }, - mark: function Profiler__mark (marker, explicit) { + mark: function Profiler__mark(marker, explicit) { if (_profiler) { _profiler.AddMarker(explicit ? marker : 'Profiler: "' + (marker || test_name) + '"'); } diff --git a/testing/talos/talos/tests/devtools/addon/content/addon-test-frontend.js b/testing/talos/talos/tests/devtools/addon/content/addon-test-frontend.js index e7a43905d589..be130413259e 100644 --- a/testing/talos/talos/tests/devtools/addon/content/addon-test-frontend.js +++ b/testing/talos/talos/tests/devtools/addon/content/addon-test-frontend.js @@ -12,16 +12,16 @@ function $(id) { // take a while (e.g. when triggering the test run) function chromeExec(commandName, data, doneCallback) { // dispatch an event to the framescript which will take it from there. - doneCallback = doneCallback || function dummy(){}; + doneCallback = doneCallback || function dummy() {}; dispatchEvent( new CustomEvent("damp@mozilla.org:chrome-exec-event", { bubbles: true, detail: { command: { name: commandName, - data: data, + data, }, - doneCallback: doneCallback + doneCallback } }) ); @@ -36,7 +36,7 @@ function runTest(config, doneCallback) { } function sum(values) { - return values.reduce(function(a, b){return a + b;}); + return values.reduce(function(a, b) { return a + b; }); } function average(values) { @@ -48,8 +48,8 @@ function stddev(values, avg) { if (values.length <= 1) return 0; return Math.sqrt( - values.map(function (v) { return Math.pow(v - avg, 2); }) - .reduce(function (a, b) { return a + b; }) / (values.length - 1)); + values.map(function(v) { return Math.pow(v - avg, 2); }) + .reduce(function(a, b) { return a + b; }) / (values.length - 1)); } var lastResults = '["[no results collected]"]'; @@ -68,11 +68,11 @@ function doneTest(dispResult) { for (var i in dispResult) { var di = dispResult[i]; - var disp = [].concat(di.value).map(function(a){return " " + (isNaN(a) ? -1 : a.toFixed(1));}).join("  "); + var disp = [].concat(di.value).map(function(a) { return " " + (isNaN(a) ? -1 : a.toFixed(1)); }).join("  "); dispResult[i] = String(di.name) + ": " + disp; - if (di.name.indexOf(".half")>=0 || di.name.indexOf(".all")>=0) - dispResult[i] = ""+dispResult[i]+""; - if (di.name.indexOf(".raw")>=0) + if (di.name.indexOf(".half") >= 0 || di.name.indexOf(".all") >= 0) + dispResult[i] = "" + dispResult[i] + ""; + if (di.name.indexOf(".raw") >= 0) dispResult[i] = "
" + dispResult[i]; // Add space before raw results (which are the first result of an animation) // stats: @@ -96,7 +96,7 @@ function doneTest(dispResult) { dispStats += s + "    Average (" + stats[s].length + "): " + average(stats[s]).toFixed(2) + " stddev: " + stddev(stats[s]).toFixed(2) + "
"; } - dispStats +="
Individual animations:
"; + dispStats += "
Individual animations:
"; } $("run-results").innerHTML = "

Results :
" + dispStats + dispResult.join("
"); } @@ -157,4 +157,4 @@ function init() { } } -addEventListener("load", init); \ No newline at end of file +addEventListener("load", init); diff --git a/testing/talos/talos/tests/devtools/addon/content/damp.html b/testing/talos/talos/tests/devtools/addon/content/damp.html index f58a1f63a178..b742ff12490e 100644 --- a/testing/talos/talos/tests/devtools/addon/content/damp.html +++ b/testing/talos/talos/tests/devtools/addon/content/damp.html @@ -67,10 +67,10 @@ Utilities: Configure DAMP (CTRL-F5 to reset to talos defaults)

diff --git a/testing/talos/talos/tests/devtools/addon/content/damp.js b/testing/talos/talos/tests/devtools/addon/content/damp.js index f1b2ab3dc394..a122b7431563 100644 --- a/testing/talos/talos/tests/devtools/addon/content/damp.js +++ b/testing/talos/talos/tests/devtools/addon/content/damp.js @@ -27,7 +27,7 @@ function Damp() { Damp.prototype = { - addTab: function(url) { + addTab(url) { return new Promise((resolve, reject) => { let tab = this._win.gBrowser.selectedTab = this._win.gBrowser.addTab(url); let browser = tab.linkedBrowser; @@ -38,12 +38,12 @@ Damp.prototype = { }); }, - closeCurrentTab: function() { + closeCurrentTab() { this._win.BrowserCloseTabOrWindow(); return this._win.gBrowser.selectedTab; }, - reloadPage: function() { + reloadPage() { let startReloadTimestamp = performance.now(); return new Promise((resolve, reject) => { let browser = gBrowser.selectedBrowser; @@ -59,7 +59,7 @@ Damp.prototype = { }); }, - openToolbox: function (tool = "webconsole") { + openToolbox(tool = "webconsole") { let tab = getActiveTab(getMostRecentBrowserWindow()); let target = devtools.TargetFactory.forTab(tab); let startRecordTimestamp = performance.now(); @@ -86,7 +86,7 @@ Damp.prototype = { }; }), - saveHeapSnapshot: function(label) { + saveHeapSnapshot(label) { let tab = getActiveTab(getMostRecentBrowserWindow()); let target = devtools.TargetFactory.forTab(tab); let toolbox = gDevTools.getToolbox(target); @@ -104,7 +104,7 @@ Damp.prototype = { }); }, - readHeapSnapshot: function(label) { + readHeapSnapshot(label) { let start = performance.now(); this._snapshot = ThreadSafeChromeUtils.readHeapSnapshot(this._heapSnapshotFilePath); let end = performance.now(); @@ -224,7 +224,7 @@ Damp.prototype = { yield this.testTeardown(); }), - takeCensus: function(label) { + takeCensus(label) { let start = performance.now(); this._snapshot.takeCensus({ @@ -260,7 +260,7 @@ Damp.prototype = { return Promise.resolve(); }, - _getToolLoadingTests: function(url, label) { + _getToolLoadingTests(url, label) { let openToolboxAndLog = Task.async(function*(name, tool) { let {time, toolbox} = yield this.openToolbox(tool); @@ -380,7 +380,7 @@ Damp.prototype = { _nextCommandIx: 0, _commands: [], _onSequenceComplete: 0, - _nextCommand: function() { + _nextCommand() { if (this._nextCommandIx >= this._commands.length) { this._onSequenceComplete(); return; @@ -388,7 +388,7 @@ Damp.prototype = { this._commands[this._nextCommandIx++].call(this); }, // Each command at the array a function which must call nextCommand once it's done - _doSequence: function(commands, onComplete) { + _doSequence(commands, onComplete) { this._commands = commands; this._onSequenceComplete = onComplete; this._results = []; @@ -397,25 +397,25 @@ Damp.prototype = { this._nextCommand(); }, - _log: function(str) { + _log(str) { if (window.MozillaFileLogger && window.MozillaFileLogger.log) window.MozillaFileLogger.log(str); window.dump(str); }, - _logLine: function(str) { + _logLine(str) { return this._log(str + "\n"); }, - _reportAllResults: function() { + _reportAllResults() { var testNames = []; var testResults = []; var out = ""; for (var i in this._results) { res = this._results[i]; - var disp = [].concat(res.value).map(function(a){return (isNaN(a) ? -1 : a.toFixed(1));}).join(" "); + var disp = [].concat(res.value).map(function(a) { return (isNaN(a) ? -1 : a.toFixed(1)); }).join(" "); out += res.name + ": " + disp + "\n"; if (!Array.isArray(res.value)) { // Waw intervals array is not reported to talos @@ -426,15 +426,15 @@ Damp.prototype = { this._log("\n" + out); if (content && content.tpRecordTime) { - content.tpRecordTime(testResults.join(','), 0, testNames.join(',')); + content.tpRecordTime(testResults.join(","), 0, testNames.join(",")); } else { - //alert(out); + // alert(out); } }, _onTestComplete: null, - _doneInternal: function() { + _doneInternal() { this._logLine("DAMP_RESULTS_JSON=" + JSON.stringify(this._results)); this._reportAllResults(); this._win.gBrowser.selectedTab = this._dampTab; @@ -496,8 +496,8 @@ Damp.prototype = { }); }, - startTest: function(doneCallback, config) { - this._onTestComplete = function (results) { + startTest(doneCallback, config) { + this._onTestComplete = function(results) { Profiler.mark("DAMP - end", true); doneCallback(results); }; diff --git a/testing/talos/talos/tests/devtools/addon/content/framescript.js b/testing/talos/talos/tests/devtools/addon/content/framescript.js index 2597496dd9ca..a2f156ad5aca 100644 --- a/testing/talos/talos/tests/devtools/addon/content/framescript.js +++ b/testing/talos/talos/tests/devtools/addon/content/framescript.js @@ -1,7 +1,7 @@ (function() { const PREFIX = "damp@mozilla.org:"; - addEventListener(PREFIX + "chrome-exec-event", function (e) { + addEventListener(PREFIX + "chrome-exec-event", function(e) { if (content.document.documentURI.indexOf("chrome://damp/content/damp.html")) { // Can have url fragment. Backward compatible version of !str.startsWidth("prefix") throw new Error("Cannot be used outside of DAMP's launch page"); diff --git a/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html b/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html index dbb726cf1f39..67a6a8aa2d7c 100644 --- a/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html +++ b/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html @@ -4,7 +4,7 @@ - \ No newline at end of file + diff --git a/testing/talos/talos/tests/tabswitch/bootstrap.js b/testing/talos/talos/tests/tabswitch/bootstrap.js index f6ef9572dec5..3a42ae0de3ef 100644 --- a/testing/talos/talos/tests/tabswitch/bootstrap.js +++ b/testing/talos/talos/tests/tabswitch/bootstrap.js @@ -17,24 +17,24 @@ let context = {}; let TalosParentProfiler; var windowListener = { - onOpenWindow: function(aWindow) { + onOpenWindow(aWindow) { // Ensure we don't get tiles which contact the network aboutNewTabService.newTabURL = "about:blank"; // Wait for the window to finish loading let window = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow); let cb = function() { - window.removeEventListener("load", cb, false); + window.removeEventListener("load", cb); loadIntoWindow(window); }; - window.addEventListener("load", cb, false); + window.addEventListener("load", cb); }, - onCloseWindow: function(aWindow) { + onCloseWindow(aWindow) { aboutNewTabService.resetNewTabURL(); }, - onWindowTitleChange: function(aWindow, aTitle) { + onWindowTitleChange(aWindow, aTitle) { } }; @@ -67,7 +67,7 @@ function waitForDelayedStartup(win) { Services.obs.removeObserver(onStartup, topic); resolve(); } - }, topic, false); + }, topic); }); } @@ -94,7 +94,7 @@ function loadTabs(gBrowser, urls) { let listener = { QueryInterface: XPCOMUtils.generateQI(["nsIWebProgressListener", "nsISupportsWeakReference"]), - onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { + onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { let loadedState = Ci.nsIWebProgressListener.STATE_STOP | Ci.nsIWebProgressListener.STATE_IS_NETWORK; if ((aStateFlags & loadedState) == loadedState && @@ -424,21 +424,21 @@ function test(window) { yield switchToTab(initialTab); } - let output = ''+ - ''+ - 'Tab Switch Results'+ - '

Tab switch times

' + - ''; + let output = "" + + '' + + "Tab Switch Results" + + "

Tab switch times

" + + "
"; let time = 0; - for(let i in times) { + for (let i in times) { time += times[i]; - output += ''; + output += ""; } - output += '
' + testURLs[i] + '' + times[i] + 'ms
" + testURLs[i] + "" + times[i] + "ms
'; + output += ""; dump("total tab switch time:" + time + "\n"); let resultsTab = win.gBrowser.loadOneTab( - 'data:text/html;charset=utf-8,' + encodeURIComponent(output), { + "data:text/html;charset=utf-8," + encodeURIComponent(output), { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), }); let pref = Services.prefs.getBoolPref("browser.tabs.warnOnCloseOtherTabs"); @@ -510,7 +510,7 @@ function handleFile(win, file) { localFile.initWithPath(file); let localURI = Services.io.newFileURI(localFile); let req = new win.XMLHttpRequest(); - req.open('get', localURI.spec, false); + req.open("get", localURI.spec, false); req.send(null); @@ -533,7 +533,7 @@ function handleFile(win, file) { } var observer = { - observe: function(aSubject, aTopic, aData) { + observe(aSubject, aTopic, aData) { if (aTopic == "tabswitch-urlfile") { handleFile(aSubject, aData); } @@ -554,7 +554,7 @@ function startup(aData, aReason) { // Load into any new windows Services.wm.addListener(windowListener); - Services.obs.addObserver(observer, "tabswitch-urlfile", false); + Services.obs.addObserver(observer, "tabswitch-urlfile"); Services.ppmm.loadProcessScript("chrome://tabswitch/content/tabswitch-content-process.js", true); diff --git a/testing/talos/talos/tests/tabswitch/content/test.html b/testing/talos/talos/tests/tabswitch/content/test.html index 4c4eff552b2a..cf9a52c6ba8e 100644 --- a/testing/talos/talos/tests/tabswitch/content/test.html +++ b/testing/talos/talos/tests/tabswitch/content/test.html @@ -6,7 +6,7 @@ sendAsyncMessage("tabswitch-do-test"); addMessageListener("tabswitch-test-results", function onMessage(msg) { let data = msg.data; - content.tpRecordTime(data.times.join(','), 0, data.urls.join(',')); + content.tpRecordTime(data.times.join(","), 0, data.urls.join(",")); }); } } diff --git a/testing/talos/talos/tests/tart/addon/content/Profiler.js b/testing/talos/talos/tests/tart/addon/content/Profiler.js index 9d94cfb543f3..be6300e0f6a2 100644 --- a/testing/talos/talos/tests/tart/addon/content/Profiler.js +++ b/testing/talos/talos/tests/tart/addon/content/Profiler.js @@ -18,7 +18,7 @@ // relevant parts of our tests. var Profiler; -(function(){ +(function() { var _profiler; // If this script is loaded in a framescript context, there won't be a @@ -40,7 +40,7 @@ var Profiler; // (It's not required nor allowed for addons since Firefox 17) // It's used inside talos from non-privileged pages (like during tscroll), // and it works because talos disables all/most security measures. - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) {} try { @@ -71,7 +71,7 @@ var Profiler; * - gecko_profile_threads * - gecko_profile_dir */ - initFromObject: function Profiler__initFromObject (obj) { + initFromObject: function Profiler__initFromObject(obj) { if (obj && ("gecko_profile_dir" in obj) && typeof obj.gecko_profile_dir == "string" && ("gecko_profile_interval" in obj) && Number.isFinite(obj.gecko_profile_interval * 1) && @@ -84,10 +84,10 @@ var Profiler; enabled = true; } }, - initFromURLQueryParams: function Profiler__initFromURLQueryParams (locationSearch) { + initFromURLQueryParams: function Profiler__initFromURLQueryParams(locationSearch) { this.initFromObject(searchToObject(locationSearch)); }, - beginTest: function Profiler__beginTest (testName) { + beginTest: function Profiler__beginTest(testName) { currentTest = testName; if (_profiler && enabled) { _profiler.StartProfiler(profiler_entries, profiler_interval, @@ -98,19 +98,19 @@ var Profiler; } } }, - finishTest: function Profiler__finishTest () { + finishTest: function Profiler__finishTest() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/" + currentTest + ".profile"); _profiler.StopProfiler(); } }, - finishStartupProfiling: function Profiler__finishStartupProfiling () { + finishStartupProfiling: function Profiler__finishStartupProfiling() { if (_profiler && enabled) { _profiler.dumpProfileToFile(profiler_dir + "/startup.profile"); _profiler.StopProfiler(); } }, - resume: function Profiler__resume (name, explicit) { + resume: function Profiler__resume(name, explicit) { if (_profiler) { if (_profiler.ResumeSampling) { _profiler.ResumeSampling(); @@ -118,7 +118,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'Start of test "' + (name || test_name) + '"'); } }, - pause: function Profiler__pause (name, explicit) { + pause: function Profiler__pause(name, explicit) { if (_profiler) { if (_profiler.PauseSampling) { _profiler.PauseSampling(); @@ -126,7 +126,7 @@ var Profiler; _profiler.AddMarker(explicit ? name : 'End of test "' + (name || test_name) + '"'); } }, - mark: function Profiler__mark (marker, explicit) { + mark: function Profiler__mark(marker, explicit) { if (_profiler) { _profiler.AddMarker(explicit ? marker : 'Profiler: "' + (marker || test_name) + '"'); } diff --git a/testing/talos/talos/tests/tart/addon/content/framescript.js b/testing/talos/talos/tests/tart/addon/content/framescript.js index 953458b453e4..8c467b047da0 100644 --- a/testing/talos/talos/tests/tart/addon/content/framescript.js +++ b/testing/talos/talos/tests/tart/addon/content/framescript.js @@ -1,7 +1,7 @@ (function() { const TART_PREFIX = "tart@mozilla.org:"; - addEventListener(TART_PREFIX + "chrome-exec-event", function (e) { + addEventListener(TART_PREFIX + "chrome-exec-event", function(e) { if (content.document.documentURI.indexOf("chrome://tart/content/tart.html")) { // Can have url fragment. Backward compatible version of !str.startsWidth("prefix") throw new Error("Cannot be used outside of TART's launch page"); @@ -21,4 +21,4 @@ id: uniqueMessageId }); }, false); -})() \ No newline at end of file +})() diff --git a/testing/talos/talos/tests/tart/addon/content/tart.html b/testing/talos/talos/tests/tart/addon/content/tart.html index 1dd9fa2b1e5f..c0c62639614f 100644 --- a/testing/talos/talos/tests/tart/addon/content/tart.html +++ b/testing/talos/talos/tests/tart/addon/content/tart.html @@ -18,16 +18,16 @@ function $(id) { // take a while (e.g. when triggering the test run) function chromeExec(commandName, data, doneCallback) { // dispatch an event to the framescript which will take it from there. - doneCallback = doneCallback || function dummy(){}; + doneCallback = doneCallback || function dummy() {}; dispatchEvent( new CustomEvent("tart@mozilla.org:chrome-exec-event", { bubbles: true, detail: { command: { name: commandName, - data: data, + data, }, - doneCallback: doneCallback + doneCallback } }) ); @@ -51,7 +51,7 @@ function runTest(config, doneCallback) { function sum(values) { - return values.reduce(function(a, b){return a + b;}); + return values.reduce(function(a, b) { return a + b; }); } function average(values) { @@ -63,8 +63,8 @@ function stddev(values, avg) { if (values.length <= 1) return 0; return Math.sqrt( - values.map(function (v) { return Math.pow(v - avg, 2); }) - .reduce(function (a, b) { return a + b; }) / (values.length - 1)); + values.map(function(v) { return Math.pow(v - avg, 2); }) + .reduce(function(a, b) { return a + b; }) / (values.length - 1)); } var lastResults = '["[no results collected]"]'; @@ -83,11 +83,11 @@ function doneTest(dispResult) { for (var i in dispResult) { var di = dispResult[i]; - var disp = [].concat(di.value).map(function(a){return " " + (isNaN(a) ? -1 : a.toFixed(1));}).join("  "); + var disp = [].concat(di.value).map(function(a) { return " " + (isNaN(a) ? -1 : a.toFixed(1)); }).join("  "); dispResult[i] = String(di.name) + ": " + disp; - if (di.name.indexOf(".half")>=0 || di.name.indexOf(".all")>=0) - dispResult[i] = ""+dispResult[i]+""; - if (di.name.indexOf(".raw")>=0) + if (di.name.indexOf(".half") >= 0 || di.name.indexOf(".all") >= 0) + dispResult[i] = "" + dispResult[i] + ""; + if (di.name.indexOf(".raw") >= 0) dispResult[i] = "
" + dispResult[i]; // Add space before raw results (which are the first result of an animation) // stats: @@ -111,7 +111,7 @@ function doneTest(dispResult) { dispStats += s + "    Average (" + stats[s].length + "): " + average(stats[s]).toFixed(2) + " stddev: " + stddev(stats[s]).toFixed(2) + "
"; } - dispStats +="
Individual animations:
"; + dispStats += "
Individual animations:
"; } $("run-results").innerHTML = "

Results :
" + dispStats + dispResult.join("
"); } @@ -263,10 +263,10 @@ Utilities: Configure TART (CTRL-F5 to reset to talos defaults)
diff --git a/testing/talos/talos/tests/tart/addon/content/tart.js b/testing/talos/talos/tests/tart/addon/content/tart.js index 5f7f3b45a515..0ac71aee6a47 100644 --- a/testing/talos/talos/tests/tart/addon/content/tart.js +++ b/testing/talos/talos/tests/tart/addon/content/tart.js @@ -39,41 +39,41 @@ Tart.prototype = { // Detectors may support keepListening(e) to indicate to keep waiting before continuing to the next animation. tabDetector: { - arm: function(handler, win) { + arm(handler, win) { win.gBrowser.tabContainer.addEventListener("transitionend", handler); }, - measureNow: function(e) { + measureNow(e) { return (e.type == "transitionend" && e.propertyName == "max-width"); }, - cleanup: function (handler, win) { + cleanup(handler, win) { win.gBrowser.tabContainer.removeEventListener("transitionend", handler); } }, customizeEnterDetector: { - arm: function(handler, win) { + arm(handler, win) { win.gNavToolbox.addEventListener("customizationready", handler); }, - measureNow: function(e) { + measureNow(e) { return (e.type == "customizationready"); }, - cleanup: function (handler, win) { + cleanup(handler, win) { win.gNavToolbox.removeEventListener("customizationready", handler); } }, - makeNewTabURLChangePromise: function(url) { + makeNewTabURLChangePromise(url) { let promise = new Promise(resolve => { Services.obs.addObserver(function observer(subject, topic, data) { Services.obs.removeObserver(observer, topic); if (data == url) { resolve(); } - }, "newtab-url-changed", false); + }, "newtab-url-changed"); }); if (url === "about:newtab") { aboutNewTabService.resetNewTabURL(); @@ -86,40 +86,40 @@ Tart.prototype = { // Same as customizeEnterDetector, but stops recording when the CSS animation ends // The detector then waits until customizationready customizeEnterCssDetector: { - arm: function(handler, win) { + arm(handler, win) { win.gNavToolbox.addEventListener("customizationready", handler); win.gNavToolbox.addEventListener("customization-transitionend", handler); }, - measureNow: function(e) { + measureNow(e) { return (e.type == "customization-transitionend"); }, - keepListening: function (e) { + keepListening(e) { return (e.type != "customizationready"); }, - cleanup: function (handler, win) { + cleanup(handler, win) { win.gNavToolbox.removeEventListener("customization-transitionend", handler); win.gNavToolbox.removeEventListener("customizationready", handler); } }, customizeExitDetector: { - arm: function(handler, win) { + arm(handler, win) { win.gNavToolbox.addEventListener("aftercustomization", handler); }, - measureNow: function(e) { + measureNow(e) { return (e.type == "aftercustomization"); }, - cleanup: function (handler, win) { + cleanup(handler, win) { win.gNavToolbox.removeEventListener("aftercustomization", handler); } }, - clickNewTab: function() { + clickNewTab() { this._endDetection = this.tabDetector; this._win.BrowserOpenTab(); // Modifying the style for each tab right after opening seems like it could regress performance, @@ -134,55 +134,55 @@ Tart.prototype = { // Per-tab min-width on open it is then. // --> many-tabs case which requires modified max-width will not go into v1. No need for now. - //this._win.gBrowser.selectedTab.style.minWidth = "1px"; // Prevent overflow regrdless of DPI scale. + // this._win.gBrowser.selectedTab.style.minWidth = "1px"; // Prevent overflow regrdless of DPI scale. return this._win.gBrowser.selectedTab; }, - clickCloseCurrentTab: function() { + clickCloseCurrentTab() { this._endDetection = this.tabDetector; this._win.BrowserCloseTabOrWindow(); return this._win.gBrowser.selectedTab; }, - fadeOutCurrentTab: function() { + fadeOutCurrentTab() { this._endDetection = this.tabDetector; this._win.gBrowser.selectedTab.removeAttribute("fadein"); }, - fadeInCurrentTab: function() { + fadeInCurrentTab() { this._endDetection = this.tabDetector; this._win.gBrowser.selectedTab.setAttribute("fadein", "true"); }, - addSomeChromeUriTab: function() { + addSomeChromeUriTab() { this._endDetection = this.tabDetector; this._win.gBrowser.selectedTab = this._win.gBrowser.addTab("chrome://tart/content/blank.icon.html"); }, - triggerCustomizeEnter: function() { + triggerCustomizeEnter() { this._endDetection = this.customizeEnterDetector; this._win.gCustomizeMode.enter(); }, - triggerCustomizeEnterCss: function() { + triggerCustomizeEnterCss() { this._endDetection = this.customizeEnterCssDetector; this._win.gCustomizeMode.enter(); }, - triggerCustomizeExit: function() { + triggerCustomizeExit() { this._endDetection = this.customizeExitDetector; this._win.gCustomizeMode.exit(); }, - pinTart: function() { + pinTart() { return this._win.gBrowser.pinTab(this._tartTab); }, - unpinTart: function() { + unpinTart() { return this._win.gBrowser.unpinTab(this._tartTab); }, @@ -194,11 +194,11 @@ Tart.prototype = { _results: [], _config: {subtests: [], repeat: 1, rest: 500, tickle: true, controlProfiler: true}, - _animate: function(preWaitMs, triggerFunc, onDoneCallback, isReportResult, name, referenceDuration) { + _animate(preWaitMs, triggerFunc, onDoneCallback, isReportResult, name, referenceDuration) { var self = this; var recordingHandle; var timeoutId = 0; - var detector; //will be assigned after calling trigger. + var detector; // will be assigned after calling trigger. var rAF = window.requestAnimationFrame || window.mozRequestAnimationFrame; const Ci = Components.interfaces; const Cc = Components.classes; @@ -225,7 +225,7 @@ Tart.prototype = { var last = performance.now(); function rec() { - //self._win.getComputedStyle(self._win.gBrowser.selectedTab).width; // force draw - not good - too much regression + // self._win.getComputedStyle(self._win.gBrowser.selectedTab).width; // force draw - not good - too much regression if (_abortRecording) return; var now = performance.now(); @@ -311,7 +311,7 @@ Tart.prototype = { } // If detector supports keepListening, use it, otherwise - measurement indicates the end. - if (detector.keepListening ? detector.keepListening(e) : !isMeasureNow){ + if (detector.keepListening ? detector.keepListening(e) : !isMeasureNow) { return; } } else { @@ -341,7 +341,7 @@ Tart.prototype = { function tickleLoop() { if (i++ < ((isReportResult && self._config.tickle) ? 17 : 0)) { - self._win.document.getElementById(id).style.opacity = i%10 /10 + .05; // just some style modification which will force redraw + self._win.document.getElementById(id).style.opacity = i % 10 / 10 + .05; // just some style modification which will force redraw return rAF(tickleLoop); } @@ -369,7 +369,7 @@ Tart.prototype = { _nextCommandIx: 0, _commands: [], _onSequenceComplete: 0, - _nextCommand: function() { + _nextCommand() { if (this._nextCommandIx >= this._commands.length) { this._onSequenceComplete(); return; @@ -377,7 +377,7 @@ Tart.prototype = { this._commands[this._nextCommandIx++](); }, // Each command at the array a function which must call nextCommand once it's done - _doSequence: function(commands, onComplete) { + _doSequence(commands, onComplete) { this._commands = commands; this._onSequenceComplete = onComplete; this._results = []; @@ -386,25 +386,25 @@ Tart.prototype = { this._nextCommand(); }, - _log: function(str) { + _log(str) { if (window.MozillaFileLogger && window.MozillaFileLogger.log) window.MozillaFileLogger.log(str); window.dump(str); }, - _logLine: function(str) { + _logLine(str) { return this._log(str + "\n"); }, - _reportAllResults: function() { + _reportAllResults() { var testNames = []; var testResults = []; var out = ""; for (var i in this._results) { res = this._results[i]; - var disp = [].concat(res.value).map(function(a){return (isNaN(a) ? -1 : a.toFixed(1));}).join(" "); + var disp = [].concat(res.value).map(function(a) { return (isNaN(a) ? -1 : a.toFixed(1)); }).join(" "); out += res.name + ": " + disp + "\n"; if (!Array.isArray(res.value)) { // Waw intervals array is not reported to talos @@ -415,15 +415,15 @@ Tart.prototype = { this._log("\n" + out); if (content && content.tpRecordTime) { - content.tpRecordTime(testResults.join(','), 0, testNames.join(',')); + content.tpRecordTime(testResults.join(","), 0, testNames.join(",")); } else { - //alert(out); + // alert(out); } }, _onTestComplete: null, - _doneInternal: function() { + _doneInternal() { this._logLine("TART_RESULTS_JSON=" + JSON.stringify(this._results)); this._reportAllResults(); this._win.gBrowser.selectedTab = this._tartTab; @@ -433,7 +433,7 @@ Tart.prototype = { } }, - _startTest: function() { + _startTest() { // Save prefs and states which will change during the test, to get restored when done. var origNewtabEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled"); @@ -454,7 +454,7 @@ Tart.prototype = { var customizeExit = this.triggerCustomizeExit.bind(this); var next = this._nextCommand.bind(this); - var rest = 500; //500ms default rest before measuring an animation + var rest = 500; // 500ms default rest before measuring an animation if (this._config.rest) { rest = this._config.rest; } @@ -491,7 +491,7 @@ Tart.prototype = { var subtests = { init: [ // This is called before each subtest, so it's safe to assume the following prefs: - function(){ + function() { Services.prefs.setBoolPref("browser.newtabpage.enabled", true); Services.prefs.setBoolPref("browser.newtab.preload", false); self.pinTart(); @@ -501,7 +501,7 @@ Tart.prototype = { restore: [ // Restore prefs which were modified during the test - function(){ + function() { Services.prefs.setBoolPref("browser.newtabpage.enabled", origNewtabEnabled); Services.prefs.setBoolPref("browser.newtab.preload", origPreload); Services.prefs.setCharPref("layout.css.devPixelsPerPx", origDpi); @@ -511,154 +511,156 @@ Tart.prototype = { ], simple: [ - function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); next();}, - function(){animate(0, addTab, next);}, - function(){animate(0, closeCurrentTab, next);}, + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); next(); }, + function() { animate(0, addTab, next); }, + function() { animate(0, closeCurrentTab, next); }, - function(){animate(rest, addTab, next, true, "simple-open-DPI1", tabRefDuration);}, - function(){animate(rest, closeCurrentTab, next, true, "simple-close-DPI1", tabRefDuration);} + function() { animate(rest, addTab, next, true, "simple-open-DPI1", tabRefDuration); }, + function() { animate(rest, closeCurrentTab, next, true, "simple-close-DPI1", tabRefDuration); } ], iconDpi1: [ - function(){ + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(0, closeCurrentTab, next); }, - function(){animate(rest, addTab, next, true, "icon-open-DPI1", tabRefDuration);}, - function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI1", tabRefDuration);} + function() { animate(rest, addTab, next, true, "icon-open-DPI1", tabRefDuration); }, + function() { animate(rest, closeCurrentTab, next, true, "icon-close-DPI1", tabRefDuration); } ], iconDpi2: [ - function(){ + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(0, closeCurrentTab, next); }, - function(){animate(rest, addTab, next, true, "icon-open-DPI2", tabRefDuration);}, - function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI2", tabRefDuration);} + function() { animate(rest, addTab, next, true, "icon-open-DPI2", tabRefDuration); }, + function() { animate(rest, closeCurrentTab, next, true, "icon-close-DPI2", tabRefDuration); } ], newtabNoPreload: [ - function(){ + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1"); Services.prefs.setBoolPref("browser.newtab.preload", false); self.makeNewTabURLChangePromise("about:newtab").then(next); }, - function(){animate(rest, addTab, next, true, "newtab-open-preload-no", tabRefDuration);}, - function(){animate(0, closeCurrentTab, next);} + function() { animate(rest, addTab, next, true, "newtab-open-preload-no", tabRefDuration); }, + function() { animate(0, closeCurrentTab, next); } ], newtabYesPreload: [ - function(){ + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1"); Services.prefs.setBoolPref("browser.newtab.preload", true); self.makeNewTabURLChangePromise("about:newtab").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(0, closeCurrentTab, next); }, - function(){animate(1000, addTab, next, true, "newtab-open-preload-yes", tabRefDuration);}, - function(){animate(0, closeCurrentTab, next);} + function() { animate(1000, addTab, next, true, "newtab-open-preload-yes", tabRefDuration); }, + function() { animate(0, closeCurrentTab, next); } ], simple3open3closeDpiCurrent: [ - function(){animate(rest, addTab, next, true, "simple3-1-open-DPIcurrent", tabRefDuration);}, - function(){animate(rest, addTab, next, true, "simple3-2-open-DPIcurrent", tabRefDuration);}, - function(){animate(rest, addTab, next, true, "simple3-3-open-DPIcurrent", tabRefDuration);}, + function() { animate(rest, addTab, next, true, "simple3-1-open-DPIcurrent", tabRefDuration); }, + function() { animate(rest, addTab, next, true, "simple3-2-open-DPIcurrent", tabRefDuration); }, + function() { animate(rest, addTab, next, true, "simple3-3-open-DPIcurrent", tabRefDuration); }, - function(){animate(rest, closeCurrentTab, next, true, "simple3-3-close-DPIcurrent", tabRefDuration);}, - function(){animate(rest, closeCurrentTab, next, true, "simple3-2-close-DPIcurrent", tabRefDuration);}, - function(){animate(rest, closeCurrentTab, next, true, "simple3-1-close-DPIcurrent", tabRefDuration);} + function() { animate(rest, closeCurrentTab, next, true, "simple3-3-close-DPIcurrent", tabRefDuration); }, + function() { animate(rest, closeCurrentTab, next, true, "simple3-2-close-DPIcurrent", tabRefDuration); }, + function() { animate(rest, closeCurrentTab, next, true, "simple3-1-close-DPIcurrent", tabRefDuration); } ], multi: [ - function(){ + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1.0"); self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(0, addTab, next);}, - function(){animate(0, addTab, next);}, - function(){animate(0, addTab, next);}, - function(){animate(0, addTab, next);}, - function(){animate(0, addTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(0, addTab, next); }, + function() { animate(0, addTab, next); }, + function() { animate(0, addTab, next); }, + function() { animate(0, addTab, next); }, + function() { animate(0, addTab, next); }, - function(){animate(rest*2, addTab, next, true, "multi-open-DPI1", tabRefDuration);}, - function(){animate(rest*2, closeCurrentTab, next, true, "multi-close-DPI1", tabRefDuration);}, + function() { animate(rest * 2, addTab, next, true, "multi-open-DPI1", tabRefDuration); }, + function() { animate(rest * 2, closeCurrentTab, next, true, "multi-close-DPI1", tabRefDuration); }, - function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); next();}, - function(){animate(0, addTab, next);}, - function(){animate(0, closeCurrentTab, next);}, - function(){animate(rest*2, addTab, next, true, "multi-open-DPI2", tabRefDuration);}, - function(){animate(rest*2, closeCurrentTab, next, true, "multi-close-DPI2", tabRefDuration);}, + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); next(); }, + function() { animate(0, addTab, next); }, + function() { animate(0, closeCurrentTab, next); }, + function() { animate(rest * 2, addTab, next, true, "multi-open-DPI2", tabRefDuration); }, + function() { animate(rest * 2, closeCurrentTab, next, true, "multi-close-DPI2", tabRefDuration); }, - function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1"); next();}, + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1"); next(); }, - function(){animate(0, closeCurrentTab, next);}, - function(){animate(0, closeCurrentTab, next);}, - function(){animate(0, closeCurrentTab, next);}, - function(){animate(0, closeCurrentTab, next);}, - function(){animate(0, closeCurrentTab, next);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, closeCurrentTab, next); }, + function() { animate(0, closeCurrentTab, next); }, + function() { animate(0, closeCurrentTab, next); }, + function() { animate(0, closeCurrentTab, next); }, + function() { animate(0, closeCurrentTab, next); }, + function() { animate(0, closeCurrentTab, next); }, ], simpleFadeDpiCurrent: [ - function(){self.makeNewTabURLChangePromise("about:blank").then(next);}, + function() { self.makeNewTabURLChangePromise("about:blank").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(rest, fadeout, next, true, "simpleFade-close-DPIcurrent", tabRefDuration);}, - function(){animate(rest, fadein, next, true, "simpleFade-open-DPIcurrent", tabRefDuration);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(rest, fadeout, next, true, "simpleFade-close-DPIcurrent", tabRefDuration); }, + function() { animate(rest, fadein, next, true, "simpleFade-open-DPIcurrent", tabRefDuration); }, + function() { animate(0, closeCurrentTab, next); }, ], iconFadeDpiCurrent: [ - function(){self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next);}, + function() { self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(rest, fadeout, next, true, "iconFade-close-DPIcurrent", tabRefDuration);}, - function(){animate(rest, fadein, next, true, "iconFade-open-DPIcurrent", tabRefDuration);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(rest, fadeout, next, true, "iconFade-close-DPIcurrent", tabRefDuration); }, + function() { animate(rest, fadein, next, true, "iconFade-open-DPIcurrent", tabRefDuration); }, + function() { animate(0, closeCurrentTab, next); }, ], iconFadeDpi2: [ - function(){ + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next); }, - function(){animate(0, addTab, next);}, - function(){animate(rest, fadeout, next, true, "iconFade-close-DPI2", tabRefDuration);}, - function(){animate(rest, fadein, next, true, "iconFade-open-DPI2", tabRefDuration);}, - function(){animate(0, closeCurrentTab, next);}, + function() { animate(0, addTab, next); }, + function() { animate(rest, fadeout, next, true, "iconFade-close-DPI2", tabRefDuration); }, + function() { animate(rest, fadein, next, true, "iconFade-open-DPI2", tabRefDuration); }, + function() { animate(0, closeCurrentTab, next); }, ], lastTabFadeDpiCurrent: [ - function(){self._win.gBrowser.selectedTab = self._win.gBrowser.tabs[gBrowser.tabs.length - 1]; - next();}, - function(){animate(rest, fadeout, next, true, "lastTabFade-close-DPIcurrent", tabRefDuration);}, - function(){animate(rest, fadein, next, true, "lastTabFade-open-DPIcurrent", tabRefDuration);}, + function() { + self._win.gBrowser.selectedTab = self._win.gBrowser.tabs[gBrowser.tabs.length - 1]; + next(); +}, + function() { animate(rest, fadeout, next, true, "lastTabFade-close-DPIcurrent", tabRefDuration); }, + function() { animate(rest, fadein, next, true, "lastTabFade-open-DPIcurrent", tabRefDuration); }, ], customize: [ // Test australis customize mode animation with default DPI. - function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1"); next();}, + function() { Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1"); next(); }, // Adding a non-newtab since the behavior of exiting customize mode which was entered on newtab may change. See bug 957202. - function(){animate(0, addSomeTab, next);}, + function() { animate(0, addSomeTab, next); }, // The prefixes 1- and 2- were added because talos cuts common prefixes on all "pages", which ends up as "customize-e" prefix. - function(){animate(rest, customizeEnter, next, true, "1-customize-enter", custRefDuration);}, - function(){animate(rest, customizeExit, next, true, "2-customize-exit", custRefDuration);}, + function() { animate(rest, customizeEnter, next, true, "1-customize-enter", custRefDuration); }, + function() { animate(rest, customizeExit, next, true, "2-customize-exit", custRefDuration); }, // Measures the CSS-animation-only part of entering into customize mode - function(){animate(rest, customizeEnterCss, next, true, "3-customize-enter-css", custRefDuration);}, - function(){animate(0, customizeExit, next);}, + function() { animate(rest, customizeEnterCss, next, true, "3-customize-enter-css", custRefDuration); }, + function() { animate(0, customizeExit, next); }, - function(){animate(0, closeCurrentTab, next);} + function() { animate(0, closeCurrentTab, next); } ] }; @@ -676,8 +678,8 @@ Tart.prototype = { this._doSequence(sequenceArray, this._doneInternal); }, - startTest: function(doneCallback, config) { - this._onTestComplete = function (results) { + startTest(doneCallback, config) { + this._onTestComplete = function(results) { Profiler.mark("TART - end", true); doneCallback(results); }; diff --git a/testing/talos/talos/tests/video/video_playback.html b/testing/talos/talos/tests/video/video_playback.html index f158525c76e8..39bc0fe5c8d1 100644 --- a/testing/talos/talos/tests/video/video_playback.html +++ b/testing/talos/talos/tests/video/video_playback.html @@ -15,9 +15,9 @@ var start2 = 0; var paintedFramesStart2 = 0; var testIndex = 0; var test = [ - 'testsrc.240p.120fps.mp4', - 'testsrc.480p.60fps.webm', - 'testsrc.1080p.60fps.mp4', + "testsrc.240p.120fps.mp4", + "testsrc.480p.60fps.webm", + "testsrc.1080p.60fps.mp4", ]; var viewModeIndex = 0; // Remove fullscreen mode since it causes intermittent failures on try server. See bug 1192317. @@ -29,10 +29,10 @@ function init() { } function content_focused() { - vdo = document.getElementById('vdo'); - vdo.addEventListener('loadeddata', prepare, false); - document.addEventListener('fullscreenchange', fullscreen); - document.addEventListener('mozfullscreenchange', fullscreen); + vdo = document.getElementById("vdo"); + vdo.addEventListener("loadeddata", prepare); + document.addEventListener("fullscreenchange", fullscreen); + document.addEventListener("mozfullscreenchange", fullscreen); runTest(); } @@ -47,18 +47,18 @@ function fullscreen(event) { function runTest() { // Windows XP cannot play mp4 clip due to the lack of gmp-eme-plugin, so skip it. - if (window.navigator.oscpu == 'Windows NT 5.1' && test[testIndex].indexOf('mp4') >= 0) { + if (window.navigator.oscpu == "Windows NT 5.1" && test[testIndex].indexOf("mp4") >= 0) { nextTest(); } - vdo.setAttribute('src', 'clips/' + test[testIndex]); + vdo.setAttribute("src", "clips/" + test[testIndex]); vdo.load(); } function prepare() { - if (viewMode[viewModeIndex] == 'fullscreen') { + if (viewMode[viewModeIndex] == "fullscreen") { // Fullscreen mode - vdo.setAttribute('width', '100%'); - vdo.setAttribute('height', '100%'); + vdo.setAttribute("width", "100%"); + vdo.setAttribute("height", "100%"); if (document.body.requestFullscreen) { document.body.requestFullscreen(); } else if (document.body.mozRequestFullScreen) { @@ -66,8 +66,8 @@ function prepare() { } } else { readyToStart = true; - vdo.setAttribute('width', vdo.videoWidth * viewMode[viewModeIndex]); - vdo.setAttribute('height', vdo.videoHeight * viewMode[viewModeIndex]); + vdo.setAttribute("width", vdo.videoWidth * viewMode[viewModeIndex]); + vdo.setAttribute("height", vdo.videoHeight * viewMode[viewModeIndex]); startTest(); } } @@ -90,12 +90,12 @@ function measurementEnded() { var paintedFramesEnd = vdo.mozPaintedFrames; var timePerFrame1 = (start2 - start1) / (paintedFramesStart2 - paintedFramesStart1); var timePerFrame2 = (end - start2) / (paintedFramesEnd - paintedFramesStart2); - testResult.names.push(test[testIndex] + '_scale_' + viewMode[viewModeIndex] + '_startup'); + testResult.names.push(test[testIndex] + "_scale_" + viewMode[viewModeIndex] + "_startup"); testResult.values.push(timePerFrame1); - testResult.names.push(test[testIndex] + '_scale_' + viewMode[viewModeIndex] + '_inclip'); + testResult.names.push(test[testIndex] + "_scale_" + viewMode[viewModeIndex] + "_inclip"); testResult.values.push(timePerFrame2); - if (viewMode[viewModeIndex] == 'fullscreen') { + if (viewMode[viewModeIndex] == "fullscreen") { // Exit fullscreen mode if (document.exitFullscreen) { document.exitFullscreen(); @@ -122,20 +122,20 @@ function nextTest() { } function reportResult() { - var msg = ''; + var msg = ""; for (var i = 0; i < testResult.names.length; i++) { - msg += testResult.names[i] + ' = ' + testResult.values[i] + ' ms/frame\n\n'; + msg += testResult.names[i] + " = " + testResult.values[i] + " ms/frame\n\n"; } dump(msg); // Put the readable report at talos run-log if (window.tpRecordTime) { // Within talos - report the results - return tpRecordTime(testResult.values.join(','), 0, testResult.names.join(',')); - } else { + return tpRecordTime(testResult.values.join(","), 0, testResult.names.join(",")); + } // Local run in a plain browser, display the formatted report alert(msg); - } + } diff --git a/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html b/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html index fad9c992406b..937125db0799 100644 --- a/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html +++ b/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html @@ -7,12 +7,12 @@ diff --git a/testing/talos/talos/webextensions/dummy/background.js b/testing/talos/talos/webextensions/dummy/background.js index 9ffacaf99912..cf1cf9562b85 100644 --- a/testing/talos/talos/webextensions/dummy/background.js +++ b/testing/talos/talos/webextensions/dummy/background.js @@ -1,3 +1,3 @@ -"use strict"; - +"use strict"; + // Empty background script diff --git a/testing/talos/talos/webextensions/dummy/content.js b/testing/talos/talos/webextensions/dummy/content.js index 4bb8e4eb2145..c3653ae99cb4 100644 --- a/testing/talos/talos/webextensions/dummy/content.js +++ b/testing/talos/talos/webextensions/dummy/content.js @@ -1,3 +1,3 @@ -"use strict"; - +"use strict"; + // Empty content script diff --git a/tools/rewriting/ThirdPartyPaths.txt b/tools/rewriting/ThirdPartyPaths.txt index 9367247f6caa..f6f6fac7ced0 100644 --- a/tools/rewriting/ThirdPartyPaths.txt +++ b/tools/rewriting/ThirdPartyPaths.txt @@ -65,7 +65,10 @@ security/nss/ security/sandbox/chromium/ testing/gtest/gmock/ testing/gtest/gtest/ +testing/talos/talos/tests/canvasmark/ testing/talos/talos/tests/dromaeo/ +testing/talos/talos/tests/kraken/ +testing/talos/talos/tests/v8_7/ third_party/aom/ third_party/python/blessings/ third_party/python/configobj/