--- a/browser/components/migration/tests/unit/test_fx_telemetry.js
+++ b/browser/components/migration/tests/unit/test_fx_telemetry.js
@@ -1,17 +1,13 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
-function run_test() {
- run_next_test();
-}
-
function readFile(file) {
let stream = Cc["@mozilla.org/network/file-input-stream;1"]
.createInstance(Ci.nsIFileInputStream);
stream.init(file, -1, -1, Ci.nsIFileInputStream.CLOSE_ON_EOF);
let sis = Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(Ci.nsIScriptableInputStream);
sis.init(stream);
--- a/browser/components/newtab/tests/xpcshell/test_NewTabPrefsProvider.js
+++ b/browser/components/newtab/tests/xpcshell/test_NewTabPrefsProvider.js
@@ -2,20 +2,16 @@
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
"resource:///modules/NewTabPrefsProvider.jsm");
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_observe() {
let prefsMap = NewTabPrefsProvider.prefs.prefsMap;
for (let prefName of prefsMap.keys()) {
let prefValueType = prefsMap.get(prefName);
let beforeVal;
let afterVal;
--- a/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js
+++ b/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js
@@ -7,20 +7,16 @@ Cu.import("resource://gre/modules/Servic
XPCOMUtils.defineLazyModuleGetter(this, "NewTabSearchProvider",
"resource:///modules/NewTabSearchProvider.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContentSearch",
"resource:///modules/ContentSearch.jsm");
// ensure a profile exists
do_get_profile();
-function run_test() {
- run_next_test();
-}
-
function hasProp(obj) {
return function(aProp) {
ok(obj.hasOwnProperty(aProp), `expect to have property ${aProp}`);
};
}
add_task(async function test_search() {
ContentSearch.init();
--- a/browser/components/places/tests/unit/test_421483.js
+++ b/browser/components/places/tests/unit/test_421483.js
@@ -7,20 +7,16 @@
const SMART_BOOKMARKS_PREF = "browser.places.smartBookmarksVersion";
var gluesvc = Cc["@mozilla.org/browser/browserglue;1"].
getService(Ci.nsIObserver);
// Avoid default bookmarks import.
gluesvc.observe(null, "initial-migration-will-import-default-bookmarks", "");
-function run_test() {
- run_next_test();
-}
-
add_task(async function smart_bookmarks_disabled() {
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", -1);
await rebuildSmartBookmarks();
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
Assert.equal(smartBookmarkItemIds.length, 0);
--- a/browser/components/places/tests/unit/test_PUIU_makeTransaction.js
+++ b/browser/components/places/tests/unit/test_PUIU_makeTransaction.js
@@ -323,12 +323,8 @@ add_test(function check_annotations() {
PlacesUtils.annotations.getItemsWithAnnotation(PlacesUIUtils.DESCRIPTION_ANNO, {});
do_check_eq(descriptions.length, 4);
// Only the original bookmarks should have this annotation.
let others = PlacesUtils.annotations.getItemsWithAnnotation("random-anno", {});
do_check_eq(others.length, 3);
run_next_test();
});
-
-function run_test() {
- run_next_test();
-}
--- a/browser/components/places/tests/unit/test_browserGlue_urlbar_defaultbehavior_migration.js
+++ b/browser/components/places/tests/unit/test_browserGlue_urlbar_defaultbehavior_migration.js
@@ -7,20 +7,16 @@ const TOPIC_BROWSERGLUE_TEST = "browser-
const TOPICDATA_BROWSERGLUE_TEST = "force-ui-migration";
const DEFAULT_BEHAVIOR_PREF = "browser.urlbar.default.behavior";
const AUTOCOMPLETE_PREF = "browser.urlbar.autocomplete.enabled";
var gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"]
.getService(Ci.nsIObserver);
var gGetBoolPref = Services.prefs.getBoolPref;
-function run_test() {
- run_next_test();
-}
-
do_register_cleanup(cleanup);
function cleanup() {
let prefix = "browser.urlbar.suggest.";
for (let type of ["history", "bookmark", "openpage", "history.onlyTyped"]) {
Services.prefs.clearUserPref(prefix + type);
}
Services.prefs.clearUserPref("browser.migration.version");
--- a/browser/components/places/tests/unit/test_clearHistory_shutdown.js
+++ b/browser/components/places/tests/unit/test_clearHistory_shutdown.js
@@ -34,20 +34,16 @@ const FTP_URL = "ftp://localhost/clearHi
var formHistoryStartup = Cc["@mozilla.org/satchel/form-history-startup;1"].
getService(Ci.nsIObserver);
formHistoryStartup.observe(null, "profile-after-change", null);
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
var timeInMicroseconds = Date.now() * 1000;
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_execute() {
do_print("Initialize browserglue before Places");
// Avoid default bookmarks import.
let glue = Cc["@mozilla.org/browser/browserglue;1"].
getService(Ci.nsIObserver);
glue.observe(null, "initial-migration-will-import-default-bookmarks", null);
glue.observe(null, "test-initialize-sanitizer", null);
--- a/browser/components/sessionstore/test/unit/test_backup_once.js
+++ b/browser/components/sessionstore/test/unit/test_backup_once.js
@@ -14,20 +14,16 @@ var SessionFile;
Cu.import("resource://testing-common/AppInfo.jsm", this);
updateAppInfo({
name: "SessionRestoreTest",
ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}",
version: "1",
platformVersion: "",
});
-function run_test() {
- run_next_test();
-}
-
add_task(async function init() {
// Make sure that we have a profile before initializing SessionFile
let profd = do_get_profile();
SessionFile = Cu.import("resource:///modules/sessionstore/SessionFile.jsm", {}).SessionFile;
Paths = SessionFile.Paths;
let source = do_get_file("data/sessionstore_valid.js");
source.copyTo(profd, "sessionstore.js");
--- a/browser/components/sessionstore/test/unit/test_histogram_corrupt_files.js
+++ b/browser/components/sessionstore/test/unit/test_histogram_corrupt_files.js
@@ -105,12 +105,8 @@ add_task(async function test_all_files_c
await SessionFile.read();
// Checking if the histogram is positively updated.
let h = Telemetry.getHistogramById(HistogramId);
let s = h.snapshot();
Assert.equal(s.counts[1], 1, "One probe for the 'true' bucket.");
Assert.equal(s.counts[0], 0, "No probes in the 'false' bucket.");
});
-
-function run_test() {
- run_next_test();
-}
--- a/browser/components/sessionstore/test/unit/test_migration_lz4compression.js
+++ b/browser/components/sessionstore/test/unit/test_migration_lz4compression.js
@@ -10,20 +10,16 @@ var SessionFile;
Cu.import("resource://testing-common/AppInfo.jsm", this);
updateAppInfo({
name: "SessionRestoreTest",
ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}",
version: "1",
platformVersion: "",
});
-function run_test() {
- run_next_test();
-}
-
function promise_check_exist(path, shouldExist) {
return (async function() {
do_print("Ensuring that " + path + (shouldExist ? " exists" : " does not exist"));
if ((await OS.File.exists(path)) != shouldExist) {
throw new Error("File " + path + " should " + (shouldExist ? "exist" : "not exist"));
}
})();
}
--- a/browser/experiments/test/xpcshell/test_activate.js
+++ b/browser/experiments/test/xpcshell/test_activate.js
@@ -19,20 +19,16 @@ function ManifestEntry(data) {
this.xpiHash = data.xpiHash || EXPERIMENT1_XPI_SHA1;
this.appName = data.appName || ["XPCShell"];
this.channel = data.appName || ["nightly"];
this.startTime = data.startTime || new Date(2010, 0, 1, 12).getTime() / 1000;
this.endTime = data.endTime || new Date(9001, 0, 1, 12).getTime() / 1000;
this.maxActiveSeconds = data.maxActiveSeconds || 5 * SEC_IN_ONE_DAY;
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
gPolicy = new Experiments.Policy();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let port = gHttpServer.identity.primaryPort;
gHttpRoot = "http://localhost:" + port + "/";
--- a/browser/experiments/test/xpcshell/test_api.js
+++ b/browser/experiments/test/xpcshell/test_api.js
@@ -34,20 +34,16 @@ function uninstallExperimentAddons() {
function testCleanup(experimentsInstance) {
return (async function() {
await promiseRestartManager();
await uninstallExperimentAddons();
await removeCacheFile();
})();
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let port = gHttpServer.identity.primaryPort;
gHttpRoot = "http://localhost:" + port + "/";
gDataRoot = gHttpRoot + "data/";
--- a/browser/experiments/test/xpcshell/test_cache.js
+++ b/browser/experiments/test/xpcshell/test_cache.js
@@ -14,20 +14,16 @@ const MS_IN_ONE_DAY = SEC_IN_ONE_DAY *
var gHttpServer = null;
var gHttpRoot = null;
var gDataRoot = null;
var gPolicy = null;
var gManifestObject = null;
var gManifestHandlerURI = null;
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
await removeCacheFile();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let port = gHttpServer.identity.primaryPort;
gHttpRoot = "http://localhost:" + port + "/";
--- a/browser/experiments/test/xpcshell/test_cacherace.js
+++ b/browser/experiments/test/xpcshell/test_cacherace.js
@@ -14,20 +14,16 @@ const MS_IN_ONE_DAY = SEC_IN_ONE_DAY *
var gHttpServer = null;
var gHttpRoot = null;
var gDataRoot = null;
var gPolicy = null;
var gManifestObject = null;
var gManifestHandlerURI = null;
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
await removeCacheFile();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let port = gHttpServer.identity.primaryPort;
gHttpRoot = "http://localhost:" + port + "/";
--- a/browser/experiments/test/xpcshell/test_conditions.js
+++ b/browser/experiments/test/xpcshell/test_conditions.js
@@ -33,20 +33,16 @@ function ManifestEntry(data) {
function applicableFromManifestData(data, policy) {
let manifestData = new ManifestEntry(data);
let entry = new Experiments.ExperimentEntry(policy);
entry.initFromManifestData(manifestData);
return entry.isApplicable();
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
createAppInfo();
do_get_profile();
startAddonManagerOnly();
await TelemetryController.testSetup();
gPolicy = new Experiments.Policy();
patchPolicy(gPolicy, {
--- a/browser/experiments/test/xpcshell/test_disableExperiments.js
+++ b/browser/experiments/test/xpcshell/test_disableExperiments.js
@@ -16,20 +16,16 @@ const MS_IN_ONE_DAY = SEC_IN_ONE_DAY *
var gHttpServer = null;
var gHttpRoot = null;
var gDataRoot = null;
var gPolicy = null;
var gManifestObject = null;
var gManifestHandlerURI = null;
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let port = gHttpServer.identity.primaryPort;
gHttpRoot = "http://localhost:" + port + "/";
gDataRoot = gHttpRoot + "data/";
--- a/browser/experiments/test/xpcshell/test_nethang_bug1012924.js
+++ b/browser/experiments/test/xpcshell/test_nethang_bug1012924.js
@@ -3,20 +3,16 @@
"use strict";
Cu.import("resource://testing-common/httpd.js");
Cu.import("resource:///modules/experiments/Experiments.jsm");
const MANIFEST_HANDLER = "manifests/handler";
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
do_get_profile();
let httpServer = new HttpServer();
httpServer.start(-1);
let port = httpServer.identity.primaryPort;
let httpRoot = "http://localhost:" + port + "/";
--- a/browser/experiments/test/xpcshell/test_previous_provider.js
+++ b/browser/experiments/test/xpcshell/test_previous_provider.js
@@ -6,20 +6,16 @@
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource:///modules/experiments/Experiments.jsm");
Cu.import("resource://testing-common/httpd.js");
var gDataRoot;
var gHttpServer;
var gManifestObject;
-function run_test() {
- run_next_test();
-}
-
add_task(function test_setup() {
loadAddonManager();
do_get_profile();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let httpRoot = "http://localhost:" + gHttpServer.identity.primaryPort + "/";
gDataRoot = httpRoot + "data/";
--- a/browser/experiments/test/xpcshell/test_telemetry.js
+++ b/browser/experiments/test/xpcshell/test_telemetry.js
@@ -34,20 +34,16 @@ function checkEvent(event, id, data) {
Assert.equal(event.length, data.length + 2, "event entry count should match expected count");
for (var i = 0; i < data.length; ++i) {
Assert.equal(typeof(event[i + 2]), "string", "event entry should be a string");
Assert.equal(event[i + 2], data[i], "event entry should match expected entry");
}
}
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
loadAddonManager();
gHttpServer = new HttpServer();
gHttpServer.start(-1);
let port = gHttpServer.identity.primaryPort;
gHttpRoot = "http://localhost:" + port + "/";
gDataRoot = gHttpRoot + "data/";
--- a/browser/experiments/test/xpcshell/test_upgrade.js
+++ b/browser/experiments/test/xpcshell/test_upgrade.js
@@ -41,12 +41,8 @@ add_task(async function test_upgrade() {
Assert.ok(e.enabled);
});
add_task(async function test_missing() {
let e = new Experiments.ExperimentEntry();
delete cacheData._name;
Assert.ok(!e.initFromCacheData(cacheData));
});
-
-function run_test() {
- run_next_test();
-}
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_01.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_01.js
@@ -4,20 +4,16 @@
"use strict";
// Test clearSnapshots deletes snapshots with READ censuses
let { takeSnapshotAndCensus, clearSnapshots } = require("devtools/client/memory/actions/snapshot");
let { actions } = require("devtools/client/memory/constants");
const { treeMapState } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
dispatch(takeSnapshotAndCensus(front, heapWorker));
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_02.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_02.js
@@ -3,20 +3,16 @@
"use strict";
// Test clearSnapshots preserves snapshots with state != READ or ERROR
let { takeSnapshotAndCensus, clearSnapshots, takeSnapshot } = require("devtools/client/memory/actions/snapshot");
let { snapshotState: states, treeMapState, actions } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
ok(true, "create a snapshot with a census in SAVED state");
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_03.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_03.js
@@ -3,20 +3,16 @@
"use strict";
// Test clearSnapshots deletes snapshots with state ERROR
let { takeSnapshotAndCensus, clearSnapshots } = require("devtools/client/memory/actions/snapshot");
let { snapshotState: states, treeMapState, actions } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
ok(true, "create a snapshot with a treeMap");
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_04.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_04.js
@@ -3,20 +3,16 @@
"use strict";
// Test clearSnapshots deletes several snapshots
let { takeSnapshotAndCensus, clearSnapshots } = require("devtools/client/memory/actions/snapshot");
let { snapshotState: states, actions, treeMapState } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
ok(true, "create 3 snapshots with a saved census");
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_05.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_05.js
@@ -3,20 +3,16 @@
"use strict";
// Test clearSnapshots deletes several snapshots
let { takeSnapshotAndCensus, clearSnapshots } = require("devtools/client/memory/actions/snapshot");
let { actions, treeMapState } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
ok(true, "create 2 snapshots with a saved census");
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_06.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_06.js
@@ -13,20 +13,16 @@ const {
actions,
treeMapState
} = require("devtools/client/memory/constants");
const {
toggleDiffing,
selectSnapshotForDiffingAndRefresh
} = require("devtools/client/memory/actions/diffing");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
ok(true, "create 2 snapshots with a saved census");
--- a/devtools/client/memory/test/unit/test_action-export-snapshot.js
+++ b/devtools/client/memory/test/unit/test_action-export-snapshot.js
@@ -4,20 +4,16 @@
"use strict";
// Test exporting a snapshot to a user specified location on disk.
let { exportSnapshot } = require("devtools/client/memory/actions/io");
let { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
let { actions, treeMapState } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
let destPath = yield createTempFile();
--- a/devtools/client/memory/test/unit/test_action-filter-01.js
+++ b/devtools/client/memory/test/unit/test_action-filter-01.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test setting the filter string.
let { setFilterString } = require("devtools/client/memory/actions/filter");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
equal(getState().filter, null, "no filter by default");
dispatch(setFilterString("my filter"));
equal(getState().filter, "my filter", "now we have the expected filter");
--- a/devtools/client/memory/test/unit/test_action-filter-02.js
+++ b/devtools/client/memory/test/unit/test_action-filter-02.js
@@ -5,20 +5,16 @@
// Test that changing filter state properly refreshes the selected census.
let { viewState, censusState } = require("devtools/client/memory/constants");
let { setFilterStringAndRefresh } = require("devtools/client/memory/actions/filter");
let { takeSnapshotAndCensus, selectSnapshotAndRefresh } = require("devtools/client/memory/actions/snapshot");
let { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action-filter-03.js
+++ b/devtools/client/memory/test/unit/test_action-filter-03.js
@@ -6,20 +6,16 @@
// Test that changing filter state in the middle of taking a snapshot results in
// the properly fitered census.
let { snapshotState: states, censusState, viewState } = require("devtools/client/memory/constants");
let { setFilterString, setFilterStringAndRefresh } = require("devtools/client/memory/actions/filter");
let { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
let { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action-import-snapshot-and-census.js
+++ b/devtools/client/memory/test/unit/test_action-import-snapshot-and-census.js
@@ -7,20 +7,16 @@
* Tests the task creator `importSnapshotAndCensus()` for the whole flow of
* importing a snapshot, and its sub-actions.
*/
let { actions, snapshotState: states, treeMapState } = require("devtools/client/memory/constants");
let { exportSnapshot, importSnapshotAndCensus } = require("devtools/client/memory/actions/io");
let { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { subscribe, dispatch, getState } = store;
let destPath = yield createTempFile();
--- a/devtools/client/memory/test/unit/test_action-import-snapshot-dominator-tree.js
+++ b/devtools/client/memory/test/unit/test_action-import-snapshot-dominator-tree.js
@@ -9,20 +9,16 @@
* should be computed.
*/
let { snapshotState, dominatorTreeState, viewState, treeMapState } =
require("devtools/client/memory/constants");
let { importSnapshotAndCensus } = require("devtools/client/memory/actions/io");
let { changeViewAndRefresh } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { subscribe, dispatch, getState } = store;
dispatch(changeViewAndRefresh(viewState.DOMINATOR_TREE, heapWorker));
--- a/devtools/client/memory/test/unit/test_action-select-snapshot.js
+++ b/devtools/client/memory/test/unit/test_action-select-snapshot.js
@@ -5,20 +5,16 @@
/**
* Tests the reducer responding to the action `selectSnapshot(snapshot)`
*/
let actions = require("devtools/client/memory/actions/snapshot");
let { snapshotState: states } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
yield front.attach();
let store = Store();
for (let i = 0; i < 5; i++) {
store.dispatch(actions.takeSnapshot(front));
}
--- a/devtools/client/memory/test/unit/test_action-set-display-and-refresh-01.js
+++ b/devtools/client/memory/test/unit/test_action-set-display-and-refresh-01.js
@@ -10,20 +10,16 @@
* `setCensusDisplayAndRefresh`.
*/
let { censusDisplays, censusState, viewState } = require("devtools/client/memory/constants");
let { setCensusDisplayAndRefresh } = require("devtools/client/memory/actions/census-display");
let { takeSnapshotAndCensus, selectSnapshotAndRefresh } = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
// We test setting an invalid display, which triggers an assertion failure.
EXPECTED_DTU_ASSERT_FAILURE_COUNT = 1;
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
--- a/devtools/client/memory/test/unit/test_action-set-display-and-refresh-02.js
+++ b/devtools/client/memory/test/unit/test_action-set-display-and-refresh-02.js
@@ -18,20 +18,16 @@ let CUSTOM = {
tooltip: "Custom tooltip",
inverted: false,
breakdown: {
by: "internalType",
then: { by: "count", bytes: true, count: false }
}
};
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action-set-display.js
+++ b/devtools/client/memory/test/unit/test_action-set-display.js
@@ -9,20 +9,16 @@
* action for that.
*/
let { censusDisplays, censusState, viewState } = require("devtools/client/memory/constants");
let { setCensusDisplay } = require("devtools/client/memory/actions/census-display");
let { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
// We test setting an invalid display, which triggers an assertion failure.
EXPECTED_DTU_ASSERT_FAILURE_COUNT = 1;
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
--- a/devtools/client/memory/test/unit/test_action-take-census.js
+++ b/devtools/client/memory/test/unit/test_action-take-census.js
@@ -6,20 +6,16 @@
/**
* Tests the async reducer responding to the action `takeCensus(heapWorker, snapshot)`
*/
var { snapshotState: states, censusDisplays, censusState, viewState } = require("devtools/client/memory/constants");
var actions = require("devtools/client/memory/actions/snapshot");
var { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
// This tests taking a census on a snapshot that is still being read, which
// triggers an assertion failure.
EXPECTED_DTU_ASSERT_FAILURE_COUNT = 1;
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
--- a/devtools/client/memory/test/unit/test_action-take-snapshot-and-census.js
+++ b/devtools/client/memory/test/unit/test_action-take-snapshot-and-census.js
@@ -6,20 +6,16 @@
/**
* Tests the task creator `takeSnapshotAndCensus()` for the whole flow of
* taking a snapshot, and its sub-actions.
*/
let { snapshotState: states, treeMapState } = require("devtools/client/memory/constants");
let actions = require("devtools/client/memory/actions/snapshot");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let snapshotI = 0;
let censusI = 0;
--- a/devtools/client/memory/test/unit/test_action-take-snapshot.js
+++ b/devtools/client/memory/test/unit/test_action-take-snapshot.js
@@ -5,20 +5,16 @@
/**
* Tests the async reducer responding to the action `takeSnapshot(front)`
*/
let actions = require("devtools/client/memory/actions/snapshot");
let { snapshotState: states } = require("devtools/client/memory/constants");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
yield front.attach();
let store = Store();
let unsubscribe = store.subscribe(checkState);
let foundPendingState = false;
--- a/devtools/client/memory/test/unit/test_action-toggle-inverted-and-refresh-01.js
+++ b/devtools/client/memory/test/unit/test_action-toggle-inverted-and-refresh-01.js
@@ -15,20 +15,16 @@ const {
setCensusDisplayAndRefresh
} = require("devtools/client/memory/actions/census-display");
const {
takeSnapshotAndCensus,
selectSnapshotAndRefresh,
} = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action-toggle-inverted-and-refresh-02.js
+++ b/devtools/client/memory/test/unit/test_action-toggle-inverted-and-refresh-02.js
@@ -9,20 +9,16 @@
const { censusDisplays, snapshotState: states, censusState, viewState } = require("devtools/client/memory/constants");
const { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
const {
setCensusDisplay,
setCensusDisplayAndRefresh,
} = require("devtools/client/memory/actions/census-display");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action-toggle-inverted.js
+++ b/devtools/client/memory/test/unit/test_action-toggle-inverted.js
@@ -3,20 +3,16 @@
"use strict";
// Test toggling the top level inversion state of the tree.
const { censusDisplays } = require("devtools/client/memory/constants");
const { setCensusDisplay } = require("devtools/client/memory/actions/census-display");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let store = Store();
const { getState, dispatch } = store;
dispatch(setCensusDisplay(censusDisplays.allocationStack));
equal(getState().censusDisplay.inverted, false,
"not inverted initially");
--- a/devtools/client/memory/test/unit/test_action-toggle-recording-allocations.js
+++ b/devtools/client/memory/test/unit/test_action-toggle-recording-allocations.js
@@ -4,20 +4,16 @@
"use strict";
/**
* Test toggling the recording of allocation stacks.
*/
let { toggleRecordingAllocationStacks } = require("devtools/client/memory/actions/allocations");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
equal(getState().allocations.recording, false, "not recording by default");
equal(getState().allocations.togglingInProgress, false,
--- a/devtools/client/memory/test/unit/test_action_diffing_01.js
+++ b/devtools/client/memory/test/unit/test_action_diffing_01.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test toggling of diffing.
const { toggleDiffing } = require("devtools/client/memory/actions/diffing");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
equal(getState().diffing, null, "not diffing by default");
--- a/devtools/client/memory/test/unit/test_action_diffing_02.js
+++ b/devtools/client/memory/test/unit/test_action_diffing_02.js
@@ -5,20 +5,16 @@
// Test that toggling diffing unselects all snapshots.
const { censusState, viewState } = require("devtools/client/memory/constants");
const { toggleDiffing } = require("devtools/client/memory/actions/diffing");
const { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action_diffing_03.js
+++ b/devtools/client/memory/test/unit/test_action_diffing_03.js
@@ -8,20 +8,16 @@
const { diffingState, snapshotState, viewState } = require("devtools/client/memory/constants");
const {
toggleDiffing,
selectSnapshotForDiffing
} = require("devtools/client/memory/actions/diffing");
const { takeSnapshot } = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
// We test that you (1) cannot select a snapshot that is not in a diffable
// state, and (2) cannot select more than 2 snapshots for diffing. Both attempts
// trigger assertion failures.
EXPECTED_DTU_ASSERT_FAILURE_COUNT = 2;
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
--- a/devtools/client/memory/test/unit/test_action_diffing_04.js
+++ b/devtools/client/memory/test/unit/test_action_diffing_04.js
@@ -15,20 +15,16 @@ const {
selectSnapshotForDiffingAndRefresh
} = require("devtools/client/memory/actions/diffing");
const {
takeSnapshot,
readSnapshot
} = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_action_diffing_05.js
+++ b/devtools/client/memory/test/unit/test_action_diffing_05.js
@@ -22,20 +22,16 @@ const {
setFilterStringAndRefresh,
} = require("devtools/client/memory/actions/filter");
const {
takeSnapshot,
readSnapshot,
} = require("devtools/client/memory/actions/snapshot");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
const { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_dominator_trees_01.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_01.js
@@ -9,20 +9,16 @@ let {
dominatorTreeState,
treeMapState,
} = require("devtools/client/memory/constants");
let {
takeSnapshotAndCensus,
computeAndFetchDominatorTree,
} = require("devtools/client/memory/actions/snapshot");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(takeSnapshotAndCensus(front, heapWorker));
--- a/devtools/client/memory/test/unit/test_dominator_trees_02.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_02.js
@@ -13,20 +13,16 @@ const {
} = require("devtools/client/memory/constants");
const {
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
const {
changeViewAndRefresh
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(takeSnapshotAndCensus(front, heapWorker));
--- a/devtools/client/memory/test/unit/test_dominator_trees_03.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_03.js
@@ -12,20 +12,16 @@ const {
} = require("devtools/client/memory/constants");
const {
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
const {
changeView
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.DOMINATOR_TREE));
--- a/devtools/client/memory/test/unit/test_dominator_trees_04.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_04.js
@@ -13,20 +13,16 @@ const {
} = require("devtools/client/memory/constants");
const {
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
const {
changeView
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
for (let intermediateSnapshotState of [states.SAVING, states.READING, states.READ]) {
dumpn("Testing switching to the DOMINATOR_TREE view in the middle of the " +
`${intermediateSnapshotState} snapshot state`);
--- a/devtools/client/memory/test/unit/test_dominator_trees_05.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_05.js
@@ -13,20 +13,16 @@ let {
} = require("devtools/client/memory/constants");
let {
takeSnapshotAndCensus,
selectSnapshotAndRefresh,
} = require("devtools/client/memory/actions/snapshot");
let { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(takeSnapshotAndCensus(front, heapWorker));
--- a/devtools/client/memory/test/unit/test_dominator_trees_06.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_06.js
@@ -13,20 +13,16 @@ const {
takeSnapshotAndCensus,
fetchImmediatelyDominated,
} = require("devtools/client/memory/actions/snapshot");
const DominatorTreeLazyChildren
= require("devtools/client/memory/dominator-tree-lazy-children");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.DOMINATOR_TREE));
--- a/devtools/client/memory/test/unit/test_dominator_trees_07.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_07.js
@@ -14,20 +14,16 @@ const {
takeSnapshotAndCensus,
fetchImmediatelyDominated,
} = require("devtools/client/memory/actions/snapshot");
const DominatorTreeLazyChildren
= require("devtools/client/memory/dominator-tree-lazy-children");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.DOMINATOR_TREE));
--- a/devtools/client/memory/test/unit/test_dominator_trees_08.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_08.js
@@ -17,20 +17,16 @@ const {
} = require("devtools/client/memory/actions/label-display");
const {
changeView,
} = require("devtools/client/memory/actions/view");
const {
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.DOMINATOR_TREE));
--- a/devtools/client/memory/test/unit/test_dominator_trees_09.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_09.js
@@ -17,20 +17,16 @@ const {
} = require("devtools/client/memory/actions/label-display");
const {
changeView,
} = require("devtools/client/memory/actions/view");
const {
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.DOMINATOR_TREE));
--- a/devtools/client/memory/test/unit/test_dominator_trees_10.js
+++ b/devtools/client/memory/test/unit/test_dominator_trees_10.js
@@ -17,20 +17,16 @@ let {
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
} = require("devtools/client/memory/actions/view");
const {
setLabelDisplayAndRefresh,
} = require("devtools/client/memory/actions/label-display");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.DOMINATOR_TREE));
--- a/devtools/client/memory/test/unit/test_individuals_01.js
+++ b/devtools/client/memory/test/unit/test_individuals_01.js
@@ -13,20 +13,16 @@ const {
const {
fetchIndividuals,
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
const EXPECTED_INDIVIDUAL_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_individuals_02.js
+++ b/devtools/client/memory/test/unit/test_individuals_02.js
@@ -16,20 +16,16 @@ const {
fetchIndividuals,
takeSnapshotAndCensus,
computeDominatorTree,
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
const EXPECTED_INDIVIDUAL_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_individuals_03.js
+++ b/devtools/client/memory/test/unit/test_individuals_03.js
@@ -18,20 +18,16 @@ const {
const {
changeView,
popViewAndRefresh,
} = require("devtools/client/memory/actions/view");
const {
selectSnapshotForDiffingAndRefresh,
} = require("devtools/client/memory/actions/diffing");
-function run_test() {
- run_next_test();
-}
-
const EXPECTED_INDIVIDUAL_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_individuals_04.js
+++ b/devtools/client/memory/test/unit/test_individuals_04.js
@@ -16,20 +16,16 @@ const {
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
} = require("devtools/client/memory/actions/view");
const {
setFilterString,
} = require("devtools/client/memory/actions/filter");
-function run_test() {
- run_next_test();
-}
-
const EXPECTED_INDIVIDUAL_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_individuals_05.js
+++ b/devtools/client/memory/test/unit/test_individuals_05.js
@@ -17,20 +17,16 @@ const {
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
} = require("devtools/client/memory/actions/view");
const {
setCensusDisplay,
} = require("devtools/client/memory/actions/census-display");
-function run_test() {
- run_next_test();
-}
-
const EXPECTED_INDIVIDUAL_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_individuals_06.js
+++ b/devtools/client/memory/test/unit/test_individuals_06.js
@@ -15,20 +15,16 @@ const {
fetchIndividuals,
takeSnapshotAndCensus,
clearSnapshots,
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
const EXPECTED_INDIVIDUAL_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_pop_view_01.js
+++ b/devtools/client/memory/test/unit/test_pop_view_01.js
@@ -14,20 +14,16 @@ const {
fetchIndividuals,
takeSnapshotAndCensus,
} = require("devtools/client/memory/actions/snapshot");
const {
changeView,
popViewAndRefresh,
} = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
const TEST_STATES = [
individualsState.COMPUTING_DOMINATOR_TREE,
individualsState.FETCHING,
individualsState.FETCHED,
];
add_task(function* () {
let front = new StubbedMemoryFront();
--- a/devtools/client/memory/test/unit/test_tree-map-01.js
+++ b/devtools/client/memory/test/unit/test_tree-map-01.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { drawBox } = require("devtools/client/memory/components/tree-map/draw");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let fillRectValues, strokeRectValues;
let ctx = {
fillRect: (...args) => {
fillRectValues = args;
},
strokeRect: (...args) => {
strokeRectValues = args;
--- a/devtools/client/memory/test/unit/test_tree-map-02.js
+++ b/devtools/client/memory/test/unit/test_tree-map-02.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { drawText } = require("devtools/client/memory/components/tree-map/draw");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
// Mock out the Canvas2dContext
let ctx = {
fillText: (...args) => fillTextValues.push(args),
measureText: (text) => {
let width = text ? text.length * 10 : 0;
return { width };
}
--- a/devtools/client/memory/test/unit/test_utils-get-snapshot-totals.js
+++ b/devtools/client/memory/test/unit/test_utils-get-snapshot-totals.js
@@ -9,20 +9,16 @@
*/
const { censusDisplays, viewState, censusState } = require("devtools/client/memory/constants");
const { getSnapshotTotals } = require("devtools/client/memory/utils");
const { takeSnapshotAndCensus } = require("devtools/client/memory/actions/snapshot");
const { setCensusDisplayAndRefresh } = require("devtools/client/memory/actions/census-display");
const { changeView } = require("devtools/client/memory/actions/view");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let front = new StubbedMemoryFront();
let heapWorker = new HeapAnalysesClient();
yield front.attach();
let store = Store();
let { getState, dispatch } = store;
dispatch(changeView(viewState.CENSUS));
--- a/devtools/client/memory/test/unit/test_utils.js
+++ b/devtools/client/memory/test/unit/test_utils.js
@@ -8,20 +8,16 @@
* taking a snapshot, and its sub-actions. Tests the formatNumber and
* formatPercent methods.
*/
let utils = require("devtools/client/memory/utils");
let { snapshotState: states, viewState } = require("devtools/client/memory/constants");
let { Preferences } = require("resource://gre/modules/Preferences.jsm");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let s1 = utils.createSnapshot({ view: { state: viewState.CENSUS } });
let s2 = utils.createSnapshot({ view: { state: viewState.CENSUS } });
equal(s1.state, states.SAVING,
"utils.createSnapshot() creates snapshot in saving state");
ok(s1.id !== s2.id, "utils.createSnapshot() creates snapshot with unique ids");
let custom = { by: "internalType", then: { by: "count", bytes: true }};
--- a/devtools/client/performance/test/unit/test_frame-utils-01.js
+++ b/devtools/client/performance/test/unit/test_frame-utils-01.js
@@ -37,20 +37,16 @@ const CHROME_LOCATIONS = [
{ location: "Startup::XRE_InitChildProcess", line: 456, column: 123 },
{ location: "chrome://browser/content/content.js", line: 456, column: 123 },
"setTimeout_timer (resource://gre/foo.js:123:434)",
"hello/<.world (jar:file://Users/mcurie/Dev/jetpacks.js)",
"hello/<.world (resource://foo.js -> http://bar/baz.js:123:987)",
"EnterJIT",
].map(argify);
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
const { computeIsContentAndCategory, parseLocation } = require("devtools/client/performance/modules/logic/frame-utils");
let isContent = (frame) => {
computeIsContentAndCategory(frame);
return frame.isContent;
};
for (let frame of CONTENT_LOCATIONS) {
--- a/devtools/client/performance/test/unit/test_frame-utils-02.js
+++ b/devtools/client/performance/test/unit/test_frame-utils-02.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests the function testing whether or not a frame is content or chrome
* works properly.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let FrameUtils = require("devtools/client/performance/modules/logic/frame-utils");
let isContent = (frame) => {
FrameUtils.computeIsContentAndCategory(frame);
return frame.isContent;
};
--- a/devtools/client/performance/test/unit/test_jit-graph-data.js
+++ b/devtools/client/performance/test/unit/test_jit-graph-data.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Unit test for `createTierGraphDataFromFrameNode` function.
*/
-function run_test() {
- run_next_test();
-}
-
const SAMPLE_COUNT = 1000;
const RESOLUTION = 50;
const TIME_PER_SAMPLE = 5;
// Offset needed since ThreadNode requires the first sample to be strictly
// greater than its start time. This lets us still have pretty numbers
// in this test to keep it (more) simple, which it sorely needs.
const TIME_OFFSET = 5;
--- a/devtools/client/performance/test/unit/test_jit-model-01.js
+++ b/devtools/client/performance/test/unit/test_jit-model-01.js
@@ -3,20 +3,16 @@
"use strict";
/**
* Tests that JITOptimizations track optimization sites and create
* an OptimizationSiteProfile when adding optimization sites, like from the
* FrameNode, and the returning of that data is as expected.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { JITOptimizations } = require("devtools/client/performance/modules/logic/jit");
let rawSites = [];
rawSites.push(gRawSite2);
rawSites.push(gRawSite2);
rawSites.push(gRawSite1);
rawSites.push(gRawSite1);
--- a/devtools/client/performance/test/unit/test_jit-model-02.js
+++ b/devtools/client/performance/test/unit/test_jit-model-02.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that JITOptimizations create OptimizationSites, and the underlying
* hasSuccessfulOutcome/isSuccessfulOutcome work as intended.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let {
JITOptimizations, hasSuccessfulOutcome, isSuccessfulOutcome, SUCCESSFUL_OUTCOMES
} = require("devtools/client/performance/modules/logic/jit");
let rawSites = [];
rawSites.push(gRawSite2);
rawSites.push(gRawSite2);
--- a/devtools/client/performance/test/unit/test_marker-blueprint.js
+++ b/devtools/client/performance/test/unit/test_marker-blueprint.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if the timeline blueprint has a correct structure.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { TIMELINE_BLUEPRINT } = require("devtools/client/performance/modules/markers");
ok(TIMELINE_BLUEPRINT,
"A timeline blueprint should be available.");
ok(Object.keys(TIMELINE_BLUEPRINT).length,
"The timeline blueprint has at least one entry.");
--- a/devtools/client/performance/test/unit/test_marker-utils.js
+++ b/devtools/client/performance/test/unit/test_marker-utils.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests the marker utils methods.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { TIMELINE_BLUEPRINT } = require("devtools/client/performance/modules/markers");
let { PREFS } = require("devtools/client/performance/modules/global");
let { MarkerBlueprintUtils } = require("devtools/client/performance/modules/marker-blueprint-utils");
PREFS.registerObserver();
Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
--- a/devtools/client/performance/test/unit/test_perf-utils-allocations-to-samples.js
+++ b/devtools/client/performance/test/unit/test_perf-utils-allocations-to-samples.js
@@ -3,20 +3,16 @@
"use strict";
/**
* Tests if allocations data received from the performance actor is properly
* converted to something that follows the same structure as the samples data
* received from the profiler.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
const { getProfileThreadFromAllocations } = require("devtools/shared/performance/recording-utils");
let output = getProfileThreadFromAllocations(TEST_DATA);
equal(output.toSource(), EXPECTED_OUTPUT.toSource(), "The output is correct.");
});
var TEST_DATA = {
sites: [0, 0, 1, 2, 3],
--- a/devtools/client/performance/test/unit/test_profiler-categories.js
+++ b/devtools/client/performance/test/unit/test_profiler-categories.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if the profiler categories are mapped correctly.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { CATEGORIES, CATEGORY_MAPPINGS } = require("devtools/client/performance/modules/categories");
let { L10N } = require("devtools/client/performance/modules/global");
let count = CATEGORIES.length;
ok(count,
"Should have a non-empty list of categories available.");
--- a/devtools/client/performance/test/unit/test_tree-model-01.js
+++ b/devtools/client/performance/test/unit/test_tree-model-01.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if a call tree model can be correctly computed from a samples array.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
const { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
// Create a root node from a given samples array.
let threadNode = new ThreadNode(gThread, { startTime: 0, endTime: 20 });
let root = getFrameNodePath(threadNode, "(root)");
--- a/devtools/client/performance/test/unit/test_tree-model-02.js
+++ b/devtools/client/performance/test/unit/test_tree-model-02.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if a call tree model ignores samples with no timing information.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
// Create a root node from a given samples array.
let thread = new ThreadNode(gThread, { startTime: 0, endTime: 10 });
let root = getFrameNodePath(thread, "(root)");
--- a/devtools/client/performance/test/unit/test_tree-model-03.js
+++ b/devtools/client/performance/test/unit/test_tree-model-03.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if a call tree model can be correctly computed from a samples array,
* while at the same time filtering by duration.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
// Create a root node from a given samples array, filtering by time.
//
// Filtering from 5 to 18 includes the 2nd and 3rd samples. The 2nd sample
// starts exactly on 5 and ends at 11. The 3rd sample starts at 11 and ends
// exactly at 18.
--- a/devtools/client/performance/test/unit/test_tree-model-04.js
+++ b/devtools/client/performance/test/unit/test_tree-model-04.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if a call tree model can be correctly computed from a samples array,
* while at the same time filtering by duration and content-only frames.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
// Create a root node from a given samples array, filtering by time.
let startTime = 5;
let endTime = 18;
let thread = new ThreadNode(gThread, { startTime, endTime, contentOnly: true });
--- a/devtools/client/performance/test/unit/test_tree-model-05.js
+++ b/devtools/client/performance/test/unit/test_tree-model-05.js
@@ -38,20 +38,16 @@ var gThread = synthesizeProfileForTest([
frames: [
{ location: "(root)" },
{ location: "A" },
{ location: "B" },
{ location: "F" }
]
}]);
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let root = new ThreadNode(gThread, { invertTree: true, startTime: 0, endTime: 4 });
equal(root.calls.length, 2,
"Should get the 2 youngest frames, not the 1 oldest frame");
--- a/devtools/client/performance/test/unit/test_tree-model-06.js
+++ b/devtools/client/performance/test/unit/test_tree-model-06.js
@@ -3,20 +3,16 @@
"use strict";
/**
* Tests that when constructing FrameNodes, if optimization data is available,
* the FrameNodes have the correct optimization data after iterating over samples,
* and only youngest frames capture optimization data.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let root = getFrameNodePath(new ThreadNode(gThread, { startTime: 0,
endTime: 30 }), "(root)");
let A = getFrameNodePath(root, "A");
let B = getFrameNodePath(A, "B");
let C = getFrameNodePath(B, "C");
--- a/devtools/client/performance/test/unit/test_tree-model-07.js
+++ b/devtools/client/performance/test/unit/test_tree-model-07.js
@@ -3,20 +3,16 @@
"use strict";
/**
* Tests that when displaying only content nodes, platform nodes are generalized.
*/
var { CATEGORY_MASK } = require("devtools/client/performance/modules/categories");
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let url = (n) => `http://content/${n}`;
// Create a root node from a given samples array.
let root = getFrameNodePath(new ThreadNode(gThread, { startTime: 5, endTime: 30,
contentOnly: true }), "(root)");
--- a/devtools/client/performance/test/unit/test_tree-model-08.js
+++ b/devtools/client/performance/test/unit/test_tree-model-08.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Verifies if FrameNodes retain and parse their data appropriately.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let FrameUtils = require("devtools/client/performance/modules/logic/frame-utils");
let { FrameNode } = require("devtools/client/performance/modules/logic/tree-model");
let { CATEGORY_MASK } = require("devtools/client/performance/modules/categories");
let compute = frame => {
FrameUtils.computeIsContentAndCategory(frame);
return frame;
};
--- a/devtools/client/performance/test/unit/test_tree-model-09.js
+++ b/devtools/client/performance/test/unit/test_tree-model-09.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that when displaying only content nodes, platform nodes are generalized.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let url = (n) => `http://content/${n}`;
// Create a root node from a given samples array.
let root = getFrameNodePath(new ThreadNode(gThread, { startTime: 5, endTime: 25,
contentOnly: true }), "(root)");
--- a/devtools/client/performance/test/unit/test_tree-model-10.js
+++ b/devtools/client/performance/test/unit/test_tree-model-10.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that the tree model calculates correct costs/percentages for
* frame nodes. The model-only version of browser_profiler-tree-view-10.js
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let thread = new ThreadNode(gThread, { invertTree: true, startTime: 0, endTime: 50 });
/**
* Samples
*
* A->C
--- a/devtools/client/performance/test/unit/test_tree-model-11.js
+++ b/devtools/client/performance/test/unit/test_tree-model-11.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that the costs for recursive frames does not overcount the collapsed
* samples.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let thread = new ThreadNode(gThread, { startTime: 0, endTime: 50,
flattenRecursion: true });
/**
* Samples
*
--- a/devtools/client/performance/test/unit/test_tree-model-12.js
+++ b/devtools/client/performance/test/unit/test_tree-model-12.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that uninverting the call tree works correctly when there are stacks
// in the profile that prefixes of other stacks.
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let thread = new ThreadNode(gThread, { startTime: 0, endTime: 50 });
let root = getFrameNodePath(thread, "(root)");
/**
* Samples
*
--- a/devtools/client/performance/test/unit/test_tree-model-13.js
+++ b/devtools/client/performance/test/unit/test_tree-model-13.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Like test_tree-model-12, but inverted.
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
let root = new ThreadNode(gThread, { invertTree: true, startTime: 0, endTime: 50 });
/**
* Samples
*
* A->B
--- a/devtools/client/performance/test/unit/test_tree-model-allocations-01.js
+++ b/devtools/client/performance/test/unit/test_tree-model-allocations-01.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that the tree model calculates correct costs/percentages for
* allocation frame nodes.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
const { getProfileThreadFromAllocations } = require("devtools/shared/performance/recording-utils");
let allocationData = getProfileThreadFromAllocations(TEST_DATA);
let thread = new ThreadNode(allocationData, { startTime: 0, endTime: 1000 });
/* eslint-disable max-len */
/**
--- a/devtools/client/performance/test/unit/test_tree-model-allocations-02.js
+++ b/devtools/client/performance/test/unit/test_tree-model-allocations-02.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that the tree model calculates correct costs/percentages for
* allocation frame nodes. Inverted version of test_tree-model-allocations-01.js
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
let { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model");
const { getProfileThreadFromAllocations } = require("devtools/shared/performance/recording-utils");
let allocationData = getProfileThreadFromAllocations(TEST_DATA);
let thread = new ThreadNode(allocationData, { invertTree: true, startTime: 0,
endTime: 1000 });
/* eslint-disable max-len */
--- a/devtools/client/performance/test/unit/test_waterfall-utils-collapse-01.js
+++ b/devtools/client/performance/test/unit/test_waterfall-utils-collapse-01.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if the waterfall collapsing logic works properly.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
const WaterfallUtils = require("devtools/client/performance/modules/logic/waterfall-utils");
let rootMarkerNode = WaterfallUtils.createParentNode({ name: "(root)" });
WaterfallUtils.collapseMarkersIntoNode({
rootNode: rootMarkerNode,
markersList: gTestMarkers
--- a/devtools/client/performance/test/unit/test_waterfall-utils-collapse-02.js
+++ b/devtools/client/performance/test/unit/test_waterfall-utils-collapse-02.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if the waterfall collapsing logic works properly for console.time/console.timeEnd
* markers, as they should ignore any sort of collapsing.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
const WaterfallUtils = require("devtools/client/performance/modules/logic/waterfall-utils");
let rootMarkerNode = WaterfallUtils.createParentNode({ name: "(root)" });
WaterfallUtils.collapseMarkersIntoNode({
rootNode: rootMarkerNode,
markersList: gTestMarkers
--- a/devtools/client/performance/test/unit/test_waterfall-utils-collapse-03.js
+++ b/devtools/client/performance/test/unit/test_waterfall-utils-collapse-03.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests that the waterfall collapsing works when atleast two
* collapsible markers downward, and the following marker is outside of both ranges.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
const WaterfallUtils = require("devtools/client/performance/modules/logic/waterfall-utils");
let rootMarkerNode = WaterfallUtils.createParentNode({ name: "(root)" });
WaterfallUtils.collapseMarkersIntoNode({
rootNode: rootMarkerNode,
markersList: gTestMarkers
--- a/devtools/client/performance/test/unit/test_waterfall-utils-collapse-04.js
+++ b/devtools/client/performance/test/unit/test_waterfall-utils-collapse-04.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if the waterfall collapsing logic works properly
* when filtering parents and children.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
const WaterfallUtils = require("devtools/client/performance/modules/logic/waterfall-utils");
[
[["DOMEvent"], gExpectedOutputNoDOMEvent],
[["Javascript"], gExpectedOutputNoJS],
[["DOMEvent", "Javascript"], gExpectedOutputNoDOMEventOrJS],
].forEach(([filter, expected]) => {
--- a/devtools/client/performance/test/unit/test_waterfall-utils-collapse-05.js
+++ b/devtools/client/performance/test/unit/test_waterfall-utils-collapse-05.js
@@ -2,20 +2,16 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Tests if the waterfall collapsing logic works properly
* when dealing with OTMT markers.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function test() {
const WaterfallUtils = require("devtools/client/performance/modules/logic/waterfall-utils");
let rootMarkerNode = WaterfallUtils.createParentNode({ name: "(root)" });
WaterfallUtils.collapseMarkersIntoNode({
rootNode: rootMarkerNode,
markersList: gTestMarkers
--- a/devtools/client/shared/test/unit/test_source-utils.js
+++ b/devtools/client/shared/test/unit/test_source-utils.js
@@ -5,20 +5,16 @@
/**
* Tests utility functions contained in `source-utils.js`
*/
const { require } = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
const sourceUtils = require("devtools/client/shared/source-utils");
-function run_test() {
- run_next_test();
-}
-
const CHROME_URLS = [
"chrome://foo", "resource://baz", "jar:file:///Users/root"
];
const CONTENT_URLS = [
"http://mozilla.org", "https://mozilla.org", "file:///Users/root", "app://fxosapp",
"blob:http://mozilla.org", "blob:https://mozilla.org"
];
--- a/devtools/server/tests/unit/test_profiler_events-01.js
+++ b/devtools/server/tests/unit/test_profiler_events-01.js
@@ -4,20 +4,16 @@
"use strict";
/**
* Tests the event notification service for the profiler actor.
*/
const { ProfilerFront } = require("devtools/shared/fronts/profiler");
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let [client, form] = yield getChromeActors();
let front = new ProfilerFront(client, form);
let events = [0, 0, 0, 0];
front.on("console-api-profiler", () => events[0]++);
front.on("profiler-started", () => events[1]++);
front.on("profiler-stopped", () => events[2]++);
--- a/devtools/server/tests/unit/test_profiler_events-02.js
+++ b/devtools/server/tests/unit/test_profiler_events-02.js
@@ -7,20 +7,16 @@
* Tests the event notification service for the profiler actor.
*/
const Profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
const MAX_PROFILER_ENTRIES = 10000000;
const { ProfilerFront } = require("devtools/shared/fronts/profiler");
const { waitForTime } = DevToolsUtils;
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
let [client, form] = yield getChromeActors();
let front = new ProfilerFront(client, form);
// Ensure the profiler is not running when the test starts (it could
// happen if the MOZ_PROFILER_STARTUP environment variable is set).
Profiler.StopProfiler();
let eventsCalled = 0;
--- a/devtools/shared/discovery/tests/unit/test_discovery.js
+++ b/devtools/shared/discovery/tests/unit/test_discovery.js
@@ -71,20 +71,16 @@ discovery._factories.Transport = TestTra
// Ignore name generation on b2g and force a fixed value
Object.defineProperty(discovery.device, "name", {
get: function () {
return "test-device";
}
});
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
// At startup, no remote devices are known
deepEqual(discovery.getRemoteDevicesWithService("devtools"), []);
deepEqual(discovery.getRemoteDevicesWithService("penguins"), []);
discovery.scan();
// No services added yet, still empty
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the HeapAnalyses{Client,Worker} "computeDominatorTree" request.
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
const snapshotFilePath = saveNewHeapSnapshot();
yield client.readHeapSnapshot(snapshotFilePath);
ok(true, "Should have read the heap snapshot");
const dominatorTreeId = yield client.computeDominatorTree(snapshotFilePath);
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the HeapAnalyses{Client,Worker} "computeDominatorTree" request with bad
// file paths.
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
let threw = false;
try {
yield client.computeDominatorTree("/etc/passwd");
} catch (_) {
threw = true;
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can delete heap snapshots.
-function run_test() {
- run_next_test();
-}
-
const breakdown = {
by: "coarseType",
objects: { by: "count", count: true, bytes: true },
scripts: { by: "count", count: true, bytes: true },
strings: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
};
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test deleteHeapSnapshot is a noop if the provided path matches no snapshot
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
let threw = false;
try {
yield client.deleteHeapSnapshot("path-does-not-exist");
} catch (_) {
threw = true;
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test other dominatorTrees can still be retrieved after deleting a snapshot
-function run_test() {
- run_next_test();
-}
-
const breakdown = {
by: "coarseType",
objects: { by: "count", count: true, bytes: true },
scripts: { by: "count", count: true, bytes: true },
strings: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
};
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can get census individuals.
-function run_test() {
- run_next_test();
-}
-
const COUNT = { by: "count", count: true, bytes: true };
const CENSUS_BREAKDOWN = {
by: "coarseType",
objects: COUNT,
strings: COUNT,
scripts: COUNT,
other: COUNT,
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
@@ -7,20 +7,16 @@
function waitForThirtyMilliseconds() {
const start = Date.now();
while (Date.now() - start < 30) {
// do nothing
}
}
-function run_test() {
- run_next_test();
-}
-
const BREAKDOWN = {
by: "internalType",
then: { by: "count", count: true, bytes: true }
};
add_task(function* () {
const client = new HeapAnalysesClient();
const start = Date.now() * 1000;
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the HeapAnalyses{Client,Worker} "getDominatorTree" request.
-function run_test() {
- run_next_test();
-}
-
const breakdown = {
by: "coarseType",
objects: { by: "count", count: true, bytes: true },
scripts: { by: "count", count: true, bytes: true },
strings: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
};
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the HeapAnalyses{Client,Worker} "getDominatorTree" request with bad
// dominator tree ids.
-function run_test() {
- run_next_test();
-}
-
const breakdown = {
by: "coarseType",
objects: { by: "count", count: true, bytes: true },
scripts: { by: "count", count: true, bytes: true },
strings: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
};
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the HeapAnalyses{Client,Worker} "getImmediatelyDominated" request.
-function run_test() {
- run_next_test();
-}
-
const breakdown = {
by: "coarseType",
objects: { by: "count", count: true, bytes: true },
scripts: { by: "count", count: true, bytes: true },
strings: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
};
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can read heap snapshots.
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
const snapshotFilePath = saveNewHeapSnapshot();
yield client.readHeapSnapshot(snapshotFilePath);
ok(true, "Should have read the heap snapshot");
client.destroy();
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take diffs between censuses.
-function run_test() {
- run_next_test();
-}
-
const BREAKDOWN = {
by: "objectClass",
then: { by: "count", count: true, bytes: false },
other: { by: "count", count: true, bytes: false },
};
add_task(function* () {
const client = new HeapAnalysesClient();
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take diffs between censuses as
// inverted trees.
-function run_test() {
- run_next_test();
-}
-
const BREAKDOWN = {
by: "coarseType",
objects: {
by: "objectClass",
then: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
},
scripts: {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take censuses.
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
const snapshotFilePath = saveNewHeapSnapshot();
yield client.readHeapSnapshot(snapshotFilePath);
ok(true, "Should have read the heap snapshot");
const { report } = yield client.takeCensus(snapshotFilePath);
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take censuses with breakdown
// options.
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
const snapshotFilePath = saveNewHeapSnapshot();
yield client.readHeapSnapshot(snapshotFilePath);
ok(true, "Should have read the heap snapshot");
const { report } = yield client.takeCensus(snapshotFilePath, {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} bubbles errors properly when things
// go wrong.
-function run_test() {
- run_next_test();
-}
-
add_task(function* () {
const client = new HeapAnalysesClient();
// Snapshot file path to a file that doesn't exist.
let failed = false;
try {
yield client.readHeapSnapshot(getFilePath("foo-bar-baz" + Math.random(), true));
} catch (e) {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can send SavedFrame stacks from
// by-allocation-stack reports from the worker.
-function run_test() {
- run_next_test();
-}
-
add_task(function* test() {
const client = new HeapAnalysesClient();
// Track some allocation stacks.
const g = newGlobal();
const dbg = new Debugger(g);
g.eval(` // 1
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take censuses and return
// a CensusTreeNode.
-function run_test() {
- run_next_test();
-}
-
const BREAKDOWN = {
by: "internalType",
then: { by: "count", count: true, bytes: true }
};
add_task(function* () {
const client = new HeapAnalysesClient();
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take censuses by
// "allocationStack" and return a CensusTreeNode.
-function run_test() {
- run_next_test();
-}
-
const BREAKDOWN = {
by: "objectClass",
then: {
by: "allocationStack",
then: { by: "count", count: true, bytes: true },
noStack: { by: "count", count: true, bytes: true }
},
other: { by: "count", count: true, bytes: true }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the HeapAnalyses{Client,Worker} can take censuses and return
// an inverted CensusTreeNode.
-function run_test() {
- run_next_test();
-}
-
const BREAKDOWN = {
by: "coarseType",
objects: {
by: "objectClass",
then: { by: "count", count: true, bytes: true },
other: { by: "count", count: true, bytes: true },
},
scripts: {
--- a/devtools/shared/performance/test/test_perf-utils-allocations-to-samples.js
+++ b/devtools/shared/performance/test/test_perf-utils-allocations-to-samples.js
@@ -4,20 +4,16 @@
"use strict";
/**
* Tests if allocations data received from the performance actor is properly
* converted to something that follows the same structure as the samples data
* received from the profiler.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(function () {
const { getProfileThreadFromAllocations } = require("devtools/shared/performance/recording-utils");
let output = getProfileThreadFromAllocations(TEST_DATA);
equal(output.toSource(), EXPECTED_OUTPUT.toSource(), "The output is correct.");
});
var TEST_DATA = {
sites: [0, 0, 1, 2, 3],
--- a/security/manager/ssl/tests/unit/test_signed_apps.js
+++ b/security/manager/ssl/tests/unit/test_signed_apps.js
@@ -109,20 +109,16 @@ function truncateEntry(entry, entryInput
let content = Cc["@mozilla.org/io/string-input-stream;1"]
.createInstance(Ci.nsIStringInputStream);
content.data = "";
return [entry, content];
}
-function run_test() {
- run_next_test();
-}
-
function check_open_result(name, expectedRv) {
return function openSignedAppFileCallback(rv, aZipReader, aSignerCert) {
do_print("openSignedAppFileCallback called for " + name);
equal(rv, expectedRv, "Actual and expected return value should match");
equal(aZipReader != null, Components.isSuccessCode(expectedRv),
"ZIP reader should be null only if the return value denotes failure");
equal(aSignerCert != null, Components.isSuccessCode(expectedRv),
"Signer cert should be null only if the return value denotes failure");
--- a/services/common/tests/unit/test_logmanager.js
+++ b/services/common/tests/unit/test_logmanager.js
@@ -3,20 +3,16 @@
// NOTE: The sync test_errorhandler_* tests have quite good coverage for
// other aspects of this.
Cu.import("resource://services-common/logmanager.js");
Cu.import("resource://gre/modules/Log.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
-function run_test() {
- run_next_test();
-}
-
// Returns an array of [consoleAppender, dumpAppender, [fileAppenders]] for
// the specified log. Note that fileAppenders will usually have length=1
function getAppenders(log) {
let capps = log.appenders.filter(app => app instanceof Log.ConsoleAppender);
equal(capps.length, 1, "should only have one console appender");
let dapps = log.appenders.filter(app => app instanceof Log.DumpAppender);
equal(dapps.length, 1, "should only have one dump appender");
let fapps = log.appenders.filter(app => app instanceof Log.StorageStreamAppender);
--- a/services/common/tests/unit/test_observers.js
+++ b/services/common/tests/unit/test_observers.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
Components.utils.import("resource://services-common/observers.js");
var gSubject = {};
-function run_test() {
- run_next_test();
-}
-
add_test(function test_function_observer() {
let foo = false;
let onFoo = function(subject, data) {
foo = !foo;
do_check_eq(subject, gSubject);
do_check_eq(data, "some data");
};
--- a/services/common/tests/unit/test_uptake_telemetry.js
+++ b/services/common/tests/unit/test_uptake_telemetry.js
@@ -1,15 +1,10 @@
const { UptakeTelemetry } = Cu.import("resource://services-common/uptake-telemetry.js", {});
-
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_unknown_status_is_not_reported() {
const source = "update-source";
const startHistogram = getUptakeTelemetrySnapshot(source);
UptakeTelemetry.report(source, "unknown-status");
const endHistogram = getUptakeTelemetrySnapshot(source);
const expectedIncrements = {};
--- a/services/common/tests/unit/test_utils_convert_string.js
+++ b/services/common/tests/unit/test_utils_convert_string.js
@@ -19,20 +19,16 @@ const TEST_BYTES = [207, 128, 207, 140,
180, 39, 32, 225, 188, 128, 206, 187,
207, 142, 207, 128, 206, 183, 206, 190,
44, 32, 225, 188, 128, 206, 187, 206,
187, 39, 32, 225, 188, 144, 207, 135,
225, 191, 150, 206, 189, 206, 191, 207,
130, 32, 225, 188, 147, 206, 189, 32,
206, 188, 206, 173, 206, 179, 206, 177];
-function run_test() {
- run_next_test();
-}
-
add_test(function test_compress_string() {
const INPUT = "hello";
let result = CommonUtils.convertString(INPUT, "uncompressed", "deflate");
do_check_eq(result.length, 13);
let result2 = CommonUtils.convertString(INPUT, "uncompressed", "deflate");
do_check_eq(result, result2);
--- a/services/common/tests/unit/test_utils_dateprefs.js
+++ b/services/common/tests/unit/test_utils_dateprefs.js
@@ -11,20 +11,16 @@ var prefs = new Preferences("servicescom
function DummyLogger() {
this.messages = [];
}
DummyLogger.prototype.warn = function warn(message) {
this.messages.push(message);
};
-function run_test() {
- run_next_test();
-}
-
add_test(function test_set_basic() {
let now = new Date();
CommonUtils.setDatePref(prefs, "test00", now);
let value = prefs.get("test00");
do_check_eq(value, "" + now.getTime());
let now2 = CommonUtils.getDatePref(prefs, "test00");
--- a/services/common/tests/unit/test_utils_encodeBase64URL.js
+++ b/services/common/tests/unit/test_utils_encodeBase64URL.js
@@ -1,17 +1,13 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
Cu.import("resource://services-common/utils.js");
-function run_test() {
- run_next_test();
-}
-
add_test(function test_simple() {
let expected = {
hello: "aGVsbG8=",
"<>?": "PD4_",
};
for (let [k, v] of Object.entries(expected)) {
do_check_eq(CommonUtils.encodeBase64URL(k), v);
--- a/services/common/tests/unit/test_utils_namedTimer.js
+++ b/services/common/tests/unit/test_utils_namedTimer.js
@@ -1,17 +1,13 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
Cu.import("resource://services-common/utils.js");
-function run_test() {
- run_next_test();
-}
-
add_test(function test_required_args() {
try {
CommonUtils.namedTimer(function callback() {
do_throw("Shouldn't fire.");
}, 0);
do_throw("Should have thrown!");
} catch (ex) {
run_next_test();
--- a/services/common/tests/unit/test_utils_sets.js
+++ b/services/common/tests/unit/test_utils_sets.js
@@ -22,20 +22,16 @@ var setEqual = CommonUtils.setEqual;
function do_check_setEqual(a, b) {
do_check_true(setEqual(a, b));
}
function do_check_not_setEqual(a, b) {
do_check_false(setEqual(a, b));
}
-function run_test() {
- run_next_test();
-}
-
add_test(function test_setEqual() {
do_check_setEqual(EMPTY, EMPTY);
do_check_setEqual(EMPTY, new Set());
do_check_setEqual(A, A);
do_check_setEqual(A, new Set(["a"]));
do_check_setEqual(new Set(["a"]), A);
do_check_not_setEqual(A, EMPTY);
do_check_not_setEqual(EMPTY, A);
--- a/services/crypto/tests/unit/test_crypto_service.js
+++ b/services/crypto/tests/unit/test_crypto_service.js
@@ -117,12 +117,8 @@ function test_base64UrlDecode() {
run_next_test();
}
add_test(test_base64_roundtrip);
add_test(test_dsa);
add_test(test_rsa);
add_test(test_base64UrlEncode);
add_test(test_base64UrlDecode);
-
-function run_test() {
- run_next_test();
-}
--- a/services/crypto/tests/unit/test_jwcrypto.js
+++ b/services/crypto/tests/unit/test_jwcrypto.js
@@ -267,12 +267,8 @@ var TESTS = [
test_get_assertion_with_offset,
test_assertion_lifetime,
test_audience_encoding_bug972582,
];
TESTS = TESTS.concat([test_rsa, test_dsa]);
TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
--- a/services/crypto/tests/unit/test_utils_pbkdf2.js
+++ b/services/crypto/tests/unit/test_utils_pbkdf2.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
Cu.import("resource://services-crypto/utils.js");
Cu.import("resource://services-common/utils.js");
var {bytesAsHex: b2h} = CommonUtils;
-function run_test() {
- run_next_test();
-}
-
add_task(function test_pbkdf2() {
let symmKey16 = CryptoUtils.pbkdf2Generate("secret phrase", "DNXPzPpiwn", 4096, 16);
do_check_eq(symmKey16.length, 16);
do_check_eq(btoa(symmKey16), "d2zG0d2cBfXnRwMUGyMwyg==");
do_check_eq(CommonUtils.encodeBase32(symmKey16), "O5WMNUO5TQC7LZ2HAMKBWIZQZI======");
let symmKey32 = CryptoUtils.pbkdf2Generate("passphrase", "salt", 4096, 32);
do_check_eq(symmKey32.length, 32);
});
--- a/services/fxaccounts/tests/xpcshell/test_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_client.js
@@ -5,20 +5,16 @@
Cu.import("resource://gre/modules/FxAccountsClient.jsm");
Cu.import("resource://services-common/utils.js");
Cu.import("resource://services-common/hawkrequest.js");
Cu.import("resource://services-crypto/utils.js");
const FAKE_SESSION_TOKEN = "a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf";
-function run_test() {
- run_next_test();
-}
-
// https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#.2Faccount.2Fkeys
var ACCOUNT_KEYS = {
keyFetch: h("8081828384858687 88898a8b8c8d8e8f" +
"9091929394959697 98999a9b9c9d9e9f"),
response: h("ee5c58845c7c9412 b11bbd20920c2fdd" +
"d83c33c9cd2c2de2 d66b222613364636" +
"c2c0f8cfbb7c6304 72c0bd88451342c6" +
--- a/services/fxaccounts/tests/xpcshell/test_credentials.js
+++ b/services/fxaccounts/tests/xpcshell/test_credentials.js
@@ -92,16 +92,12 @@ add_task(async function test_client_stre
do_check_eq(expected.authPW, b2h(results.authPW),
"authPW is wrong");
});
// End of tests
// Utility functions follow
-function run_test() {
- run_next_test();
-}
-
// turn formatted test vectors into normal hex strings
function h(hexStr) {
return hexStr.replace(/\s+/g, "");
}
--- a/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js
+++ b/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js
@@ -25,20 +25,16 @@ LoginManagerStorage.prototype.__defineGe
function setLoginMgrLoggedInState(loggedIn) {
isLoggedIn = loggedIn;
}
initTestLogging("Trace");
-function run_test() {
- run_next_test();
-}
-
function getLoginMgrData() {
let logins = Services.logins.findLogins({}, FXA_PWDMGR_HOST, null, FXA_PWDMGR_REALM);
if (logins.length == 0) {
return null;
}
Assert.equal(logins.length, 1, "only 1 login available");
return logins[0];
}
--- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
@@ -245,20 +245,16 @@ add_test(function errorTests() {
do_check_eq(fields2.errno, statusCode);
do_check_eq(fields2.error, "Error");
do_check_eq(fields2.message, "Something");
do_check_true(error2.toString().indexOf("Something") >= 0);
run_next_test();
});
-function run_test() {
- run_next_test();
-}
-
/**
* Quick way to test the "FxAccountsOAuthGrantClient" constructor.
*
* @param {Object} options
* FxAccountsOAuthGrantClient constructor options
* @param {String} expected
* Expected error message
* @returns {*}
--- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client_server.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client_server.js
@@ -62,12 +62,8 @@ add_task(async function getAndRevokeToke
equal(result.access_token, "token0");
equal(numTokenFetches, 1, "we hit the server to fetch a token");
await client.destroyToken("token0");
equal(activeTokens.size, 0, "We hit the server to revoke it");
await promiseStopServer(server);
});
// XXX - TODO - we should probably add more tests for unexpected responses etc.
-
-function run_test() {
- run_next_test();
-}
--- a/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js
@@ -115,19 +115,16 @@ async function createMockFxA() {
kB: "cafe",
verified: true
};
await fxa.setSignedInUser(credentials);
return fxa;
}
// The tests.
-function run_test() {
- run_next_test();
-}
add_task(async function testCacheStorage() {
let fxa = await createMockFxA();
// Hook what the impl calls to save to disk.
let cas = fxa.internal.currentAccountState;
let origPersistCached = cas._persistCachedTokens.bind(cas)
cas._persistCachedTokens = function() {
--- a/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js
@@ -120,19 +120,16 @@ async function createMockFxA(mockGrantCl
verified: true
};
await fxa.setSignedInUser(credentials);
return fxa;
}
// The tests.
-function run_test() {
- run_next_test();
-}
function MockFxAccountsOAuthGrantClient() {
this.activeTokens = new Set();
}
MockFxAccountsOAuthGrantClient.prototype = {
serverURL: {href: "http://localhost"},
getTokenFromAssertion(assertion, scope) {
--- a/services/fxaccounts/tests/xpcshell/test_profile.js
+++ b/services/fxaccounts/tests/xpcshell/test_profile.js
@@ -449,20 +449,16 @@ add_test(function getProfile_fetchAndCac
return profile.getProfile()
.then(result => {
do_check_eq(result.avatar, "myimg");
run_next_test();
});
});
-function run_test() {
- run_next_test();
-}
-
function makeObserver(aObserveTopic, aObserveFunc) {
let callback = function(aSubject, aTopic, aData) {
log.debug("observed " + aTopic + " " + aData);
if (aTopic == aObserveTopic) {
removeMe();
aObserveFunc(aSubject, aTopic, aData);
}
};
--- a/services/fxaccounts/tests/xpcshell/test_profile_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_profile_client.js
@@ -396,20 +396,16 @@ add_test(function errorTests() {
do_check_eq(fields2.errno, statusCode);
do_check_eq(fields2.error, "Error");
do_check_eq(fields2.message, "Something");
do_check_true(error2.toString().indexOf("Something") >= 0);
run_next_test();
});
-function run_test() {
- run_next_test();
-}
-
/**
* Quick way to test the "FxAccountsProfileClient" constructor.
*
* @param {Object} options
* FxAccountsProfileClient constructor options
* @param {String} expected
* Expected error message
* @returns {*}
--- a/services/fxaccounts/tests/xpcshell/test_storage_manager.js
+++ b/services/fxaccounts/tests/xpcshell/test_storage_manager.js
@@ -469,12 +469,8 @@ add_task(async function checkQueuedDelet
let resultPromise = sm.deleteAccountData();
Assert.ok(!_deleteCalled);
resolveBlocked();
await resultPromise;
Assert.ok(_deleteCalled);
await sm.finalize();
});
-
-function run_test() {
- run_next_test();
-}
--- a/services/fxaccounts/tests/xpcshell/test_web_channel.js
+++ b/services/fxaccounts/tests/xpcshell/test_web_channel.js
@@ -812,20 +812,16 @@ add_task(async function test_helpers_cha
await helpers.changePassword({});
do_check_false("changePassword should have rejected");
} catch (_) {
do_check_true(wasCalled.updateUserAccountData);
do_check_false(wasCalled.updateDeviceRegistration);
}
});
-function run_test() {
- run_next_test();
-}
-
function makeObserver(aObserveTopic, aObserveFunc) {
let callback = function(aSubject, aTopic, aData) {
log.debug("observed " + aTopic + " " + aData);
if (aTopic == aObserveTopic) {
removeMe();
aObserveFunc(aSubject, aTopic, aData);
}
};
--- a/services/sync/tests/unit/test_engine_abort.js
+++ b/services/sync/tests/unit/test_engine_abort.js
@@ -61,12 +61,8 @@ add_task(async function test_processInco
await promiseStopServer(server);
Svc.Prefs.resetBranch("");
Service.recordManager.clearCache();
engine._tracker.clearChangedIDs();
await engine.finalize();
});
-
-function run_test() {
- run_next_test();
-}
--- a/services/sync/tests/unit/test_errorhandler_eol.js
+++ b/services/sync/tests/unit/test_errorhandler_eol.js
@@ -43,20 +43,16 @@ function sync_httpd_setup(infoHandler) {
return httpd_setup(handlers);
}
async function setUp(server) {
await configureIdentity({username: "johndoe"}, server);
new FakeCryptoService();
}
-function run_test() {
- run_next_test();
-}
-
function do_check_soft_eol(eh, start) {
// We subtract 1000 because the stored value is in second precision.
do_check_true(eh.earliestNextAlert >= (start + eh.MINIMUM_ALERT_INTERVAL_MSEC - 1000));
do_check_eq("soft-eol", eh.currentAlertMode);
}
function do_check_hard_eol(eh, start) {
// We subtract 1000 because the stored value is in second precision.
do_check_true(eh.earliestNextAlert >= (start + eh.MINIMUM_ALERT_INTERVAL_MSEC - 1000));
--- a/services/sync/tests/unit/test_extension_storage_tracker.js
+++ b/services/sync/tests/unit/test_extension_storage_tracker.js
@@ -32,12 +32,8 @@ add_task(async function test_changing_ex
tracker.resetScore();
await withSyncContext(async function(context) {
await extensionStorageSync.remove(extension, "a", context);
});
do_check_eq(tracker.score, SCORE_INCREMENT_MEDIUM);
Svc.Obs.notify("weave:engine:stop-tracking");
});
-
-function run_test() {
- run_next_test();
-}
--- a/services/sync/tests/unit/test_form_validator.js
+++ b/services/sync/tests/unit/test_form_validator.js
@@ -78,12 +78,8 @@ add_task(async function test_formValidat
equal(clientRecords.length, 2);
equal(records.length, 3);
equal(deletedRecords.length, 0);
let expected = validator.emptyProblemData();
deepEqual(problemData, expected);
});
-
-function run_test() {
- run_next_test();
-}
--- a/services/sync/tests/unit/test_password_validator.js
+++ b/services/sync/tests/unit/test_password_validator.js
@@ -140,13 +140,8 @@ add_task(async function test_deleted() {
equal(clientRecords.length, 3);
equal(records.length, 4);
deepEqual(deletedRecords, [deletionRecord]);
let expected = validator.emptyProblemData();
deepEqual(problemData, expected);
});
-
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js
+++ b/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js
@@ -1,18 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_no_condition() {
for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
do_print("Testing a barrier with no condition (" + kind + ")");
let lock = makeLock(kind);
await lock.wait();
do_print("Barrier with no condition didn't lock");
}
});
--- a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown_leave_uncaught.js
+++ b/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown_leave_uncaught.js
@@ -5,20 +5,16 @@
//
// This file contains tests that need to leave uncaught asynchronous
// errors. If your test catches all its asynchronous errors, please
// put it in another file.
//
Cu.import("resource://testing-common/PromiseTestUtils.jsm");
PromiseTestUtils.thisTestLeaksUncaughtRejectionsAndShouldBeFixed();
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_phase_simple_async() {
do_print("Testing various combinations of a phase with a single condition");
for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
for (let arg of [undefined, null, "foo", 100, new Error("BOOM")]) {
for (let resolution of [arg, Promise.reject(arg)]) {
for (let success of [false, true]) {
for (let state of [[null],
[],
--- a/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
+++ b/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
@@ -85,12 +85,8 @@ add_test(function autocomplete_defaultIn
// Should not try to autoFill to an empty value.
do_check_eq(input.textValue, "moz");
// Clean up.
unregisterAutoCompleteSearch(searchBadIndex);
run_next_test();
};
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
+++ b/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
@@ -10,20 +10,16 @@ AutoCompleteResult.prototype = Object.cr
function AutoCompleteInput(aSearches) {
this.searches = aSearches;
this.popup.selectedIndex = -1;
this.completeDefaultIndex = true;
}
AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-function run_test() {
- run_next_test();
-}
-
add_test(function test_keyNavigation() {
doSearch("MOZ", "mozilla", function(aController) {
do_check_eq(aController.input.textValue, "MOZilla");
aController.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_RIGHT);
do_check_eq(aController.input.textValue, "mozilla");
});
});
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
+++ b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
@@ -10,20 +10,16 @@ function AutoCompleteResult(aValues, aFi
AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
function AutoCompleteInput(aSearches) {
this.searches = aSearches;
this.popup.selectedIndex = -1;
}
AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-function run_test() {
- run_next_test();
-}
-
add_test(function test_handleEnterWithDirectMatchCompleteSelectedIndex() {
doSearch("moz", "mozilla.com", "http://www.mozilla.com",
{ forceComplete: true, completeSelectedIndex: true }, function(aController) {
do_check_eq(aController.input.textValue, "moz");
do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
aController.handleEnter(false);
// After enter the final complete value should be shown in the input.
do_check_eq(aController.input.textValue, "http://www.mozilla.com");
--- a/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
+++ b/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
@@ -11,20 +11,16 @@ AutoCompleteResult.prototype = Object.cr
function AutoCompleteInput(aSearches) {
this.searches = aSearches;
this.popup.selectedIndex = -1;
this.completeDefaultIndex = true;
}
AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-function run_test() {
- run_next_test();
-}
-
add_test(function test_keyNavigation() {
doSearch("moz", "mozilla.com", "http://www.mozilla.com", function(aController) {
do_check_eq(aController.input.textValue, "mozilla.com");
aController.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_RIGHT);
do_check_eq(aController.input.textValue, "mozilla.com");
});
});
--- a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
+++ b/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
@@ -22,20 +22,16 @@ function AutoCompleteDelayedSearch(aName
AutoCompleteDelayedSearch.prototype = Object.create(AutoCompleteSearchBase.prototype);
function AutoCompleteResult(aValues, aDefaultIndex) {
this._values = aValues;
this.defaultIndex = aDefaultIndex;
}
AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-function run_test() {
- run_next_test();
-}
-
/**
* An immediate search should be executed synchronously.
*/
add_test(function test_immediate_search() {
let inputStr = "moz";
let immediateSearch = new AutoCompleteImmediateSearch(
"immediate", new AutoCompleteResult(["moz-immediate"], 0));
--- a/toolkit/components/crashes/tests/xpcshell/test_crash_service.js
+++ b/toolkit/components/crashes/tests/xpcshell/test_crash_service.js
@@ -6,20 +6,16 @@
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/osfile.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://testing-common/AppData.jsm", this);
Cu.import("resource://testing-common/CrashManagerTest.jsm", this);
var bsp = Cu.import("resource://gre/modules/CrashManager.jsm", {});
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_instantiation() {
Assert.ok(!bsp.gCrashManager, "CrashManager global instance not initially defined.");
do_get_profile();
await makeFakeAppDir();
// Fake profile creation.
Cc["@mozilla.org/crashservice;1"]
--- a/toolkit/components/crashes/tests/xpcshell/test_crash_store.js
+++ b/toolkit/components/crashes/tests/xpcshell/test_crash_store.js
@@ -41,20 +41,16 @@ function getStore() {
let s = new CrashStore(storeDir);
await s.load();
return s;
})();
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_constructor() {
let s = new CrashStore("/some/path");
Assert.ok(s instanceof CrashStore);
});
add_task(async function test_add_crash() {
let s = await getStore();
--- a/toolkit/components/downloads/test/unit/test_app_rep.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep.js
@@ -94,20 +94,16 @@ add_task(async function test_setup() {
return (async function() {
await new Promise(resolve => {
gHttpServ.stop(resolve);
});
})();
});
});
-function run_test() {
- run_next_test();
-}
-
function check_telemetry(aCount,
aShouldBlockCount,
aListCounts) {
let count = Cc["@mozilla.org/base/telemetry;1"]
.getService(Ci.nsITelemetry)
.getHistogramById("APPLICATION_REPUTATION_COUNT")
.snapshot();
do_check_eq(count.counts[1], aCount);
--- a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
@@ -56,20 +56,16 @@ function registerTableUpdate(aTable, aFi
"application/vnd.google.safebrowsing-update", false);
response.setStatusLine(request.httpVersion, 200, "OK");
response.bodyOutputStream.write(contents, contents.length);
});
}
// Tests
-function run_test() {
- run_next_test();
-}
-
add_task(function test_setup() {
// Wait 10 minutes, that is half of the external xpcshell timeout.
do_timeout(10 * 60 * 1000, function() {
if (gStillRunning) {
do_throw("Test timed out.");
}
});
// Set up a local HTTP server to return bad verdicts.
--- a/toolkit/components/downloads/test/unit/test_app_rep_windows.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_windows.js
@@ -149,20 +149,16 @@ function registerTableUpdate(aTable, aFi
"application/vnd.google.safebrowsing-update", false);
response.setStatusLine(request.httpVersion, 200, "OK");
response.bodyOutputStream.write(contents, contents.length);
});
}
// Tests
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
// Wait 10 minutes, that is half of the external xpcshell timeout.
do_timeout(10 * 60 * 1000, function() {
if (gStillRunning) {
do_throw("Test timed out.");
}
});
// Set up a local HTTP server to return bad verdicts.
--- a/toolkit/components/lz4/tests/xpcshell/test_lz4.js
+++ b/toolkit/components/lz4/tests/xpcshell/test_lz4.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
var WORKER_SOURCE_URI = "chrome://test_lz4/content/worker_lz4.js";
do_load_manifest("data/chrome.manifest");
-function run_test() {
- run_next_test();
-}
-
add_task(function() {
let worker = new ChromeWorker(WORKER_SOURCE_URI);
return new Promise((resolve, reject) => {
worker.onmessage = function(event) {
let data = event.data;
switch (data.kind) {
case "do_check_true":
--- a/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
+++ b/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const Cu = Components.utils;
Cu.import("resource://gre/modules/lz4.js");
Cu.import("resource://gre/modules/osfile.jsm");
-function run_test() {
- run_next_test();
-}
-
function compare_arrays(a, b) {
return Array.prototype.join.call(a) == Array.prototype.join.call(a);
}
add_task(async function() {
let path = OS.Path.join("data", "compression.lz");
let data = await OS.File.read(path);
let decompressed = Lz4.decompressFileContent(data);
--- a/toolkit/components/osfile/tests/xpcshell/test_constants.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_constants.js
@@ -1,18 +1,14 @@
"use strict";
Components.utils.import("resource://gre/modules/osfile.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/Services.jsm", this);
-function run_test() {
- run_next_test();
-}
-
// Test that OS.Constants is defined correctly.
add_task(async function check_definition() {
do_check_true(OS.Constants != null);
do_check_true(!!OS.Constants.Win || !!OS.Constants.libc);
do_check_true(OS.Constants.Path != null);
do_check_true(OS.Constants.Sys != null);
// check system name
do_check_eq(Services.appinfo.OS, OS.Constants.Sys.Name);
--- a/toolkit/components/osfile/tests/xpcshell/test_duration.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_duration.js
@@ -95,12 +95,8 @@ add_task(async function duration() {
testOptionIncrements(writeAtomicOptions, "writeAtomicOptions", backupDuration);
OS.File.remove(pathDest);
// Testing an operation that doesn't take arguments at all
let file = await OS.File.open(pathSource);
await file.stat();
await file.close();
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_exception.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_exception.js
@@ -102,12 +102,8 @@ add_test_pair(async function read_non_ex
} catch (ex) {
if (ex.becauseNoSuchFile) {
do_print("Correct exceptions");
} else {
throw ex;
}
}
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_loader.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_loader.js
@@ -4,20 +4,16 @@
"use strict";
/**
* Test that OS.File can be loaded using the CommonJS loader.
*/
var { Loader } = Components.utils.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
let dataDir = Services.io.newFileURI(do_get_file("test_loader/", true)).spec + "/";
let loader = Loader.Loader({
paths: {"": dataDir }
});
let require = Loader.Require(loader, Loader.Module("module_test_loader", "foo"));
--- a/toolkit/components/osfile/tests/xpcshell/test_makeDir.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_makeDir.js
@@ -9,20 +9,16 @@ Components.utils.import("resource://gre/
var Path = OS.Path;
var profileDir;
do_register_cleanup(function() {
Services.prefs.setBoolPref("toolkit.osfile.log", false);
});
-function run_test() {
- run_next_test();
-}
-
/**
* Test OS.File.makeDir
*/
add_task(function init() {
// Set up profile. We create the directory in the profile, because the profile
// is removed after every test run.
do_get_profile();
--- a/toolkit/components/osfile/tests/xpcshell/test_open.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_open.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Components.utils.import("resource://gre/modules/osfile.jsm");
-function run_test() {
- run_next_test();
-}
-
/**
* Test OS.File.open for reading:
* - with an existing file (should succeed);
* - with a non-existing file (should fail);
* - with inconsistent arguments (should fail).
*/
add_task(async function() {
// Attempt to open a file that does not exist, ensure that it yields the
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js
@@ -5,20 +5,16 @@
Components.utils.import("resource://gre/modules/osfile.jsm");
/**
* A test to ensure that OS.File.setDates and OS.File.prototype.setDates are
* working correctly.
* (see bug 924916)
*/
-function run_test() {
- run_next_test();
-}
-
// Non-prototypical tests, operating on path names.
add_task(async function test_nonproto() {
// First, create a file we can mess with.
let path = OS.Path.join(OS.Constants.Path.tmpDir,
"test_osfile_async_setDates_nonproto.tmp");
await OS.File.writeAtomic(path, new Uint8Array(1));
try {
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js
@@ -92,12 +92,8 @@ add_task(async function test_file_setPer
}
} finally {
await fd.close();
}
} finally {
await OS.File.remove(path);
}
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_error.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_error.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
var {OS: {File, Path, Constants}} = Components.utils.import("resource://gre/modules/osfile.jsm", {});
-function run_test() {
- run_next_test();
-}
-
add_task(async function testFileError_with_writeAtomic() {
let DEFAULT_CONTENTS = "default contents" + Math.random();
let path = Path.join(Constants.Path.tmpDir,
"testFileError.tmp");
await File.remove(path);
await File.writeAtomic(path, DEFAULT_CONTENTS);
let exception;
try {
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js
@@ -89,12 +89,8 @@ add_task(async function test_kill_race()
// worker (and this usage here should not be vulnerable even with the
// bug present), so when this completes the secondRequest has either been
// resolved or lost.
await OS.File.exists("foo.goz");
ok(secondResolved,
"The second request was resolved so we avoided the bug. Victory!");
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_win_async_setPermissions.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_win_async_setPermissions.js
@@ -103,12 +103,8 @@ add_task(async function test_closed_file
await fd.close();
Assert.rejects(fd.setPermissions(path, {winAttributes: {readOnly: true}}),
/The handle is invalid/,
"setPermissions failed as expected on a invalid file handle");
} finally {
await OS.File.remove(path);
}
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_backupTo_option.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_backupTo_option.js
@@ -26,20 +26,16 @@ async function clearFiles() {
"test_backupTo_option_with_backup_file.tmp"];
for (let file of files) {
let path = Path.join(Constants.Path.tmpDir, file);
await File.remove(path);
await File.remove(path + ".backup");
}
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function init() {
await clearFiles();
});
/**
* test when
* |backupTo| specified
* |tmpPath| specified
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_zerobytes.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_zerobytes.js
@@ -16,12 +16,8 @@ add_test_pair(async function test_osfile
await OS.File.writeAtomic(SHARED_PATH, outbin);
let decoder = new TextDecoder();
let bin = await OS.File.read(SHARED_PATH);
let string2 = decoder.decode(bin);
// Checking if writeAtomic supports writing encoded zero-byte strings
Assert.equal(string2, string1, "Read the expected (empty) string.");
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_path_constants.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_path_constants.js
@@ -2,21 +2,16 @@
* 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/. */
"use strict";
Cu.import("resource://gre/modules/ctypes.jsm", this);
Cu.import("resource://testing-common/AppData.jsm", this);
-
-function run_test() {
- run_next_test();
-}
-
function compare_paths(ospath, key) {
let file;
try {
file = Services.dirsvc.get(key, Components.interfaces.nsIFile);
} catch (ex) {}
if (file) {
do_check_true(!!ospath);
--- a/toolkit/components/osfile/tests/xpcshell/test_queue.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_queue.js
@@ -1,16 +1,12 @@
"use strict";
Components.utils.import("resource://gre/modules/osfile.jsm");
-function run_test() {
- run_next_test();
-}
-
// Check if Scheduler.queue returned by OS.File.queue is resolved initially.
add_task(async function check_init() {
await OS.File.queue;
do_print("Function resolved");
});
// Check if Scheduler.queue returned by OS.File.queue is resolved
// after an operation is successful.
--- a/toolkit/components/osfile/tests/xpcshell/test_read_write.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_read_write.js
@@ -95,13 +95,8 @@ add_test_pair(async function read_write_
})();
}
await test_with_options({tmpPath: TMP_PATH}, "Renaming, not flushing");
await test_with_options({tmpPath: TMP_PATH, flush: true}, "Renaming, flushing");
await test_with_options({}, "Not renaming, not flushing");
await test_with_options({flush: true}, "Not renaming, flushing");
});
-
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_reset.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_reset.js
@@ -92,12 +92,8 @@ add_task(async function finish_with_a_re
// Arbitrary operation, just to wake up the worker
try {
await OS.File.read("/foo");
} catch (ex) {
}
// Now reset
/* don't yield*/ OS.File.resetWorker();
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_shutdown.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_shutdown.js
@@ -89,13 +89,8 @@ add_task(async function system_shutdown(
do_print("Testing for leaks of file descriptor: " + TEST_FILE);
let openedFile = await OS.File.open(TEST_FILE, { create: true} );
do_print("At this stage, we leak the file");
do_check_true((await testLeaksOf(TEST_FILE, "test.shutdown.file.leak")));
await openedFile.close();
do_print("At this stage, we don't leak the file anymore");
do_check_false((await testLeaksOf(TEST_FILE, "test.shutdown.file.leak.2")));
});
-
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/osfile/tests/xpcshell/test_telemetry.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_telemetry.js
@@ -52,12 +52,8 @@ add_task(async function test_writeAtomic
// Perform a write.
let path = Path.join(Constants.Path.profileDir, "test_osfile_telemetry.tmp");
await File.writeAtomic(path, LABEL, { tmpPath: path + ".tmp" } );
let after = Services.telemetry.histogramSnapshots.parent;
do_check_eq(getCount(after[LABEL]), getCount(before[LABEL]) + 1);
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/migration/head_migration.js
+++ b/toolkit/components/places/tests/migration/head_migration.js
@@ -37,11 +37,8 @@ var setupPlacesDatabase = async function
// Ensure that our database doesn't already exist.
let dest = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
Assert.ok(!(await OS.File.exists(dest)), "Database file should not exist yet");
await OS.File.copy(src, dest);
};
// This works provided all tests in this folder use add_task.
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/unit/test_454977.js
+++ b/toolkit/components/places/tests/unit/test_454977.js
@@ -78,19 +78,16 @@ function check_results(aExpectedCount, a
root = PlacesUtils.history.executeQuery(query, options).root;
root.containerOpen = true;
// Children with hidden ones
do_check_eq(root.childCount, aExpectedCountWithHidden);
root.containerOpen = false;
}
// main
-function run_test() {
- run_next_test();
-}
add_task(async function test_execute() {
const TEST_URI = uri("http://test.mozilla.org/");
// Add a visit that force hidden
await task_add_visit(TEST_URI, TRANSITION_EMBED);
check_results(0, 0);
--- a/toolkit/components/places/tests/unit/test_463863.js
+++ b/toolkit/components/places/tests/unit/test_463863.js
@@ -35,20 +35,16 @@ function runQuery(aResultType) {
let node = root.getChild(i);
// Check that all transition types but EMBED and FRAMED appear in results
do_check_neq(node.uri.substr(6, 1), TRANSITION_EMBED);
do_check_neq(node.uri.substr(6, 1), TRANSITION_FRAMED_LINK);
}
root.containerOpen = false;
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_execute() {
// add visits, one for each transition type
for (let transition of transitions) {
await PlacesTestUtils.addVisits({
uri: uri("http://" + transition + ".mozilla.org/"),
transition
});
}
--- a/toolkit/components/places/tests/unit/test_bookmark_catobs.js
+++ b/toolkit/components/places/tests/unit/test_bookmark_catobs.js
@@ -1,15 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
-function run_test() {
- run_next_test()
-}
-
add_task(async function test_observers() {
do_load_manifest("nsDummyObserver.manifest");
let dummyCreated = false;
let dummyReceivedOnItemAdded = false;
Services.obs.addObserver(function created() {
Services.obs.removeObserver(created, "dummy-observer-created");
--- a/toolkit/components/places/tests/unit/test_history.js
+++ b/toolkit/components/places/tests/unit/test_history.js
@@ -25,19 +25,16 @@ function uri_in_db(aURI) {
var root = result.root;
root.containerOpen = true;
var cc = root.childCount;
root.containerOpen = false;
return (cc == 1);
}
// main
-function run_test() {
- run_next_test();
-}
add_task(async function test_execute() {
// we have a new profile, so we should have imported bookmarks
do_check_eq(histsvc.databaseStatus, histsvc.DATABASE_STATUS_CREATE);
// add a visit
var testURI = uri("http://mozilla.com");
await PlacesTestUtils.addVisits(testURI);
--- a/toolkit/components/places/tests/unit/test_sql_guid_functions.js
+++ b/toolkit/components/places/tests/unit/test_sql_guid_functions.js
@@ -90,12 +90,8 @@ function test_guid_on_background() {
}
// Test Runner
[
test_guid_invariants,
test_guid_on_background,
].forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/terminator/tests/xpcshell/test_terminator_record.js
+++ b/toolkit/components/terminator/tests/xpcshell/test_terminator_record.js
@@ -97,12 +97,8 @@ add_task(async function test_record() {
"The file contains the expected keys");
Assert.equal(data[PHASE0], duration, "Duration of phase 0 hasn't changed");
let duration2 = data[PHASE1];
Assert.equal(typeof duration2, "number");
Assert.ok(duration2 >= WAIT_MS / 2000, "We have waited at least " + (WAIT_MS / 2000) + " ticks");
Assert.ok(duration2 <= Math.ceil((t2 - t1) / 1000) + 1,
"Duration is reasonable");
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js
+++ b/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js
@@ -72,12 +72,8 @@ add_task(async function test_reload() {
let count = 0;
for (let x of snapshot.counts) {
count += x;
}
Assert.equal(count, 1, "We have added one item");
}
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/crashreporter/test/unit/test_event_files.js
+++ b/toolkit/crashreporter/test/unit/test_event_files.js
@@ -3,20 +3,16 @@
"use strict";
var {utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://testing-common/AppData.jsm", this);
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setup() {
do_get_profile();
await makeFakeAppDir();
});
add_task(async function test_main_process_crash() {
let cm = Services.crashmanager;
Assert.ok(cm, "CrashManager available.");
--- a/toolkit/modules/tests/xpcshell/test_CanonicalJSON.js
+++ b/toolkit/modules/tests/xpcshell/test_CanonicalJSON.js
@@ -134,12 +134,8 @@ add_task(async function test_canonicalJS
"id": "1"}]
const expected =
'[{"a":{"a":"a","b":"b","c":{"a":"a","b":"b","c":["b","a","c"],' +
'"d":{"a":"a","b":"b"},"e":1,"f":[2,3,1],"g":{' +
'"1":{"a":"a","b":"b","c":"c"},"2":2,"3":3},"id":"1"}},"id":"1"}]';
do_check_eq(CanonicalJSON.stringify(records), expected);
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/modules/tests/xpcshell/test_DeferredTask.js
+++ b/toolkit/modules/tests/xpcshell/test_DeferredTask.js
@@ -26,20 +26,16 @@ const T = 100;
* Waits for the specified timeout before resolving the returned promise.
*/
function promiseTimeout(aTimeoutMs) {
return new Promise(resolve => {
do_timeout(aTimeoutMs, resolve);
});
}
-function run_test() {
- run_next_test();
-}
-
// Tests
/**
* Creates a simple DeferredTask and executes it once.
*/
add_test(function test_arm_simple() {
new DeferredTask(run_next_test, 10).arm();
});
--- a/toolkit/modules/tests/xpcshell/test_FileUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_FileUtils.js
@@ -215,12 +215,8 @@ add_test(function test_newFile() {
let testfile = FileUtils.getFile("ProfD", ["test"]);
let testpath = testfile.path;
let file = new FileUtils.File(testpath);
do_check_true(file instanceof Components.interfaces.nsIFile);
do_check_true(file.equals(testfile));
do_check_eq(file.path, testpath);
run_next_test();
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ b/toolkit/modules/tests/xpcshell/test_Log.js
@@ -25,20 +25,16 @@ function MockAppender(formatter) {
MockAppender.prototype = {
__proto__: Log.Appender.prototype,
doAppend: function DApp_doAppend(message) {
this.messages.push(message);
}
};
-function run_test() {
- run_next_test();
-}
-
add_task(function test_Logger() {
let log = Log.repository.getLogger("test.logger");
let appender = new MockAppender(new Log.BasicFormatter());
log.level = Log.Level.Debug;
appender.level = Log.Level.Info;
log.addAppender(appender);
log.info("info test");
--- a/toolkit/modules/tests/xpcshell/test_ObjectUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_ObjectUtils.js
@@ -1,14 +1,10 @@
Components.utils.import("resource://gre/modules/ObjectUtils.jsm");
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_deepEqual() {
let deepEqual = ObjectUtils.deepEqual.bind(ObjectUtils);
// CommonJS 7.2
Assert.ok(deepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14)), "deepEqual date");
Assert.ok(deepEqual(new Date(NaN), new Date(NaN)), "deepEqual invalid dates");
Assert.ok(!deepEqual(new Date(), new Date(2000, 3, 14)), "deepEqual date");
--- a/toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js
+++ b/toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js
@@ -18,12 +18,8 @@ add_task(async function test_strict() {
strict.b; // Should not throw.
PromiseTestUtils.expectUncaughtRejection(/No such property: "c"/);
Assert.throws(() => strict.c, /No such property: "c"/);
"c" in strict; // Should not throw.
loose.c = 3;
strict.c; // Should not throw.
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/modules/tests/xpcshell/test_Preferences.js
+++ b/toolkit/modules/tests/xpcshell/test_Preferences.js
@@ -1,19 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components;
Cu.import("resource://gre/modules/Preferences.jsm");
-function run_test() {
- run_next_test();
-}
-
add_test(function test_set_get_pref() {
Preferences.set("test_set_get_pref.integer", 1);
do_check_eq(Preferences.get("test_set_get_pref.integer"), 1);
Preferences.set("test_set_get_pref.string", "foo");
do_check_eq(Preferences.get("test_set_get_pref.string"), "foo");
Preferences.set("test_set_get_pref.boolean", true);
--- a/toolkit/modules/tests/xpcshell/test_PromiseUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_PromiseUtils.js
@@ -4,19 +4,16 @@
"use strict";
Components.utils.import("resource://gre/modules/PromiseUtils.jsm");
Components.utils.import("resource://gre/modules/Timer.jsm");
Components.utils.import("resource://testing-common/PromiseTestUtils.jsm");
// Tests for PromiseUtils.jsm
-function run_test() {
- run_next_test();
-}
// Tests for PromiseUtils.defer()
/* Tests for checking the resolve method of the Deferred object
* returned by PromiseUtils.defer() */
add_task(async function test_resolve_string() {
let def = PromiseUtils.defer();
let expected = "The promise is resolved " + Math.random();
--- a/toolkit/modules/tests/xpcshell/test_ZipUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_ZipUtils.js
@@ -11,20 +11,16 @@ const ENTRIES = ["beyond.txt", SYMLINK,
Components.utils.import("resource://gre/modules/ZipUtils.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
const archive = do_get_file(ARCHIVE, false);
const dir = do_get_profile().clone();
dir.append("test_ZipUtils");
-function run_test() {
- run_next_test();
-}
-
function ensureExtracted(target) {
target.append(SUBDIR);
do_check_true(target.exists());
for (let i = 0; i < ENTRIES.length; i++) {
let entry = target.clone();
entry.append(ENTRIES[i]);
do_print("ENTRY " + entry.path);
--- a/toolkit/modules/tests/xpcshell/test_readCertPrefs.js
+++ b/toolkit/modules/tests/xpcshell/test_readCertPrefs.js
@@ -1,20 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/CertUtils.jsm");
const PREF_PREFIX = "certutils.certs.";
-function run_test() {
- run_next_test();
-}
-
function resetPrefs() {
var prefs = Services.prefs.getChildList(PREF_PREFIX);
prefs.forEach(Services.prefs.clearUserPref);
}
function attributes_match(aCert, aExpected) {
if (Object.keys(aCert).length != Object.keys(aExpected).length)
return false;
--- a/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
+++ b/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
@@ -50,20 +50,16 @@ function sleep(ms) {
notify() {
resolve();
},
}, ms, timer.TYPE_ONE_SHOT);
});
}
-function run_test() {
- run_next_test();
-}
-
//
// ----------- Don't add a test after this one, as it shuts down Sqlite.jsm
//
add_task(async function test_shutdown_clients() {
do_print("Ensuring that Sqlite.jsm doesn't shutdown before its clients");
let assertions = [];
--- a/toolkit/modules/tests/xpcshell/test_timer.js
+++ b/toolkit/modules/tests/xpcshell/test_timer.js
@@ -3,20 +3,16 @@
"use strict";
// Tests exports from Timer.jsm
var imported = {};
Components.utils.import("resource://gre/modules/Timer.jsm", imported);
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_setTimeout() {
let timeout1 = imported.setTimeout(() => do_throw("Should not be called"), 100);
do_check_eq(typeof timeout1, "number", "setTimeout returns a number");
do_check_true(timeout1 > 0, "setTimeout returns a positive number");
imported.clearTimeout(timeout1);
await new Promise((resolve) => {
--- a/toolkit/modules/tests/xpcshell/test_web_channel.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel.js
@@ -21,20 +21,16 @@ var MockWebChannelBroker = {
this._channelMap.set(channel);
}
},
unregisterChannel(channelToRemove) {
this._channelMap.delete(channelToRemove)
}
};
-function run_test() {
- run_next_test();
-}
-
/**
* Web channel tests
*/
/**
* Test channel listening with originOrPermission being an nsIURI.
*/
add_task(function test_web_channel_listen() {
--- a/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
@@ -7,20 +7,16 @@ var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/WebChannel.jsm");
const VALID_WEB_CHANNEL_ID = "id";
const URL_STRING = "http://example.com";
const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING);
-function run_test() {
- run_next_test();
-}
-
/**
* Test WebChannelBroker channel map
*/
add_test(function test_web_channel_broker_channel_map() {
let channel = {};
let channel2 = {};
do_check_eq(WebChannelBroker._channelMap.size, 0);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
@@ -485,20 +485,16 @@ async function check_initialized_cache(a
await check_cache(aExpectedToFind, true);
await promiseRestartManager();
// If cache is disabled, then expect results immediately
let cacheEnabled = Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ENABLED);
await check_cache(aExpectedToFind, !cacheEnabled);
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function setup() {
// Setup for test
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
startupManager();
// Install XPI add-ons
await promiseInstallAllFiles(ADDON_FILES);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_DeferredSave.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_DeferredSave.js
@@ -137,20 +137,16 @@ function setPromiseMockTimer() {
* Return a Promise<null> that resolves after the specified number of milliseconds
*/
function delay(aDelayMS) {
return new Promise(resolve => {
do_timeout(aDelayMS, () => resolve(null));
});
}
-function run_test() {
- run_next_test();
-}
-
// Modify set data once, ask for save, make sure it saves cleanly
add_task(async function test_basic_save_succeeds() {
setQuickMockTimer();
let tester = DeferredSaveTester();
let data = "Test 1 Data";
await tester.save(data);
do_check_eq(tester.writtenData, data);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_asyncBlocklistLoad.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_asyncBlocklistLoad.js
@@ -1,16 +1,12 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
let blocklist = AM_Cc["@mozilla.org/extensions/blocklist;1"].
getService().wrappedJSObject;
let scope = Components.utils.import("resource://gre/modules/osfile.jsm", {});
// sync -> async
blocklist._loadBlocklist();
do_check_true(blocklist._isBlocklistLoaded());
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js
@@ -24,21 +24,16 @@ const SAMPLE_GFX_RECORD = {
function Blocklist() {
let blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService().wrappedJSObject;
blocklist._clear();
return blocklist;
}
-function run_test() {
- run_next_test();
-}
-
-
add_task(async function test_sends_serialized_data() {
const blocklist = Blocklist();
blocklist._gfxEntries = [SAMPLE_GFX_RECORD];
const expected = "blockID:g36\tdevices:0x0a6c,geforce\tdriverVersion:8.17.12.5896\t" +
"driverVersionComparator:LESS_THAN_OR_EQUAL\tfeature:DIRECT3D_9_LAYERS\t" +
"featureStatus:BLOCKED_DRIVER_VERSION\tos:WINNT 6.1\tvendor:0x10de\t" +
"versionRange:0,*";
--- a/toolkit/mozapps/extensions/test/xpcshell/test_isReady.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_isReady.js
@@ -1,14 +1,10 @@
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
equal(AddonManager.isReady, false, "isReady should be false before startup");
let gotStartupEvent = false;
let gotShutdownEvent = false;
let listener = {
onStartup() {
gotStartupEvent = true;
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locked.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locked.js
@@ -532,13 +532,8 @@ add_task(async function run_test_1() {
do_check_true(isThemeInAddonsList(profileDir, t2.id));
try {
shutdownManager();
} catch (e) {
// We're expecting an error here.
}
});
-
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locked2.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locked2.js
@@ -285,12 +285,8 @@ add_task(async function() {
do_check_neq(a6, null);
do_check_true(a6.isActive);
do_check_false(a6.userDisabled);
do_check_false(a6.appDisabled);
do_check_eq(a6.pendingOperations, AddonManager.PENDING_NONE);
do_check_true(isExtensionInAddonsList(profileDir, a6.id));
});
-function run_test() {
- run_next_test();
-}
-
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locked_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locked_strictcompat.js
@@ -552,12 +552,8 @@ add_task(async function run_test_1() {
try {
shutdownManager();
} catch (e) {
// An error is expected here.
}
});
-function run_test() {
- run_next_test();
-}
-
--- a/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js
@@ -7,21 +7,16 @@
// Load XPI Provider to get schema version ID
var XPIScope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
const DB_SCHEMA = XPIScope.DB_SCHEMA;
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-function run_test() {
- // Kick off the task-based tests...
- run_next_test();
-}
-
// Test for a preference to either exist with a specified value, or not exist at all
function checkPending() {
try {
do_check_false(Services.prefs.getBoolPref("extensions.pendingOperations"));
} catch (e) {
// OK
}
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js
@@ -19,20 +19,16 @@ function mockAddonProvider(name) {
get name() {
return name;
},
};
return mockProvider;
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function testMarkSafe() {
do_print("Starting with provider normally");
let provider = mockAddonProvider("Mock1");
AddonManagerPrivate.registerProvider(provider);
startupManager();
ok(!provider.apiAccessed, "Provider API should not have been accessed");
AddonManagerPrivate.unregisterProvider(provider);
await promiseShutdownManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_provider_shutdown.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_provider_shutdown.js
@@ -32,20 +32,16 @@ function mockAddonProvider(aName) {
mockProvider.doneReject = reject;
});
mockProvider.shutdownPromise = new Promise((resolve, reject) => {
mockProvider.shutdownResolve = resolve;
});
return mockProvider;
}
-function run_test() {
- run_next_test();
-}
-
// Helper to find a particular shutdown blocker's status in the JSON blob
function findInStatus(aStatus, aName) {
for (let {name, state} of aStatus.state) {
if (name == aName) {
return state;
}
}
return null;
--- a/toolkit/mozapps/extensions/test/xpcshell/test_provider_unsafe_access_shutdown.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_provider_unsafe_access_shutdown.js
@@ -27,20 +27,16 @@ function mockAddonProvider(name) {
get name() {
return name;
},
};
return mockProvider;
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function unsafeProviderShutdown() {
let firstProvider = mockAddonProvider("Mock1");
AddonManagerPrivate.registerProvider(firstProvider);
let secondProvider = mockAddonProvider("Mock2");
AddonManagerPrivate.registerProvider(secondProvider);
startupManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_provider_unsafe_access_startup.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_provider_unsafe_access_startup.js
@@ -25,20 +25,16 @@ function mockAddonProvider(name) {
get name() {
return name;
},
};
return mockProvider;
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function unsafeProviderStartup() {
let secondProvider = null;
await new Promise(resolve => {
let firstProvider = mockAddonProvider("Mock1");
firstProvider.startupCallback = function() {
resolve(AddonManager.getAddonByID("does-not-exist"));
};
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
@@ -13,22 +13,16 @@ Services.prefs.setBoolPref(PREF_EM_STRIC
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
// Set up an HTTP server to respond to update requests
Components.utils.import("resource://testing-common/httpd.js");
const profileDir = gProfD.clone();
profileDir.append("extensions");
-
-function run_test() {
- // Kick off the task-based tests...
- run_next_test();
-}
-
// Install one extension
// Start download of update check (but delay HTTP response)
// Cancel update check
// - ensure we get cancel notification
// complete HTTP response
// - ensure no callbacks after cancel
// - ensure update is gone
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
@@ -1,15 +1,11 @@
Components.utils.import("resource://gre/modules/addons/AddonSettings.jsm")
-function run_test() {
- run_next_test();
-}
-
let profileDir;
add_task(async function setup() {
profileDir = gProfD.clone();
profileDir.append("extensions");
if (!profileDir.exists())
profileDir.create(AM_Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_paths.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_paths.js
@@ -1,11 +1,8 @@
-function run_test() {
- run_next_test();
-}
let profileDir;
add_task(async function setup() {
profileDir = gProfD.clone();
profileDir.append("extensions");
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
startupManager();
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
@@ -65,11 +65,12 @@ module.exports = {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/uneval
"uneval": false
},
rules: {
"mozilla/import-headjs-globals": "warn",
"mozilla/mark-test-function-used": "warn",
"mozilla/no-arbitrary-setTimeout": "error",
+ "mozilla/no-useless-run-test": "error",
"no-shadow": "error"
}
};