Bug 1776578 - Replace init tasks with add_setup in mochitests. r=application-update-reviewers,Standard8

Differential Revision: https://phabricator.services.mozilla.com/D149486
This commit is contained in:
Mathew Hodson
2022-09-26 13:58:49 +00:00
parent 58b38d7c16
commit f84488ba91
84 changed files with 84 additions and 84 deletions

View File

@@ -44,7 +44,7 @@ function promiseTestOnWindow(aIsPrivate, aValue) {
})();
}
add_task(async function init() {
add_setup(async function() {
forgetClosedWindows();
while (ss.getClosedTabCount(window) > 0) {
ss.forgetClosedTab(window, 0);

View File

@@ -22,7 +22,7 @@ async function reInitSessionFile() {
await SessionFile.read();
}
add_task(async function init() {
add_setup(async function() {
// Make sure that we are not racing with SessionSaver's time based
// saves.
Services.prefs.setIntPref(PREF_SS_INTERVAL, 10000000);

View File

@@ -34,7 +34,7 @@ function getClosedState() {
var CLOSED_STATE;
add_task(async function init() {
add_setup(async function() {
forgetClosedWindows();
while (ss.getClosedTabCount(window) > 0) {
ss.forgetClosedTab(window, 0);

View File

@@ -9,7 +9,7 @@ const HISTOGRAM_NAME = "FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM";
* to Telemetry.
*/
add_task(async function init() {
add_setup(async function() {
Services.telemetry.canRecordExtended = true;
});

View File

@@ -36,7 +36,7 @@ async function getUpgradeBackups() {
return children.filter(path => path.startsWith(Paths.upgradeBackupPrefix));
}
add_task(async function init() {
add_setup(async function() {
// Wait until initialization is complete
await SessionStore.promiseInitialized;
});

View File

@@ -25,7 +25,7 @@ updateAppInfo({
platformVersion: "",
});
add_task(async function init() {
add_setup(async function() {
let source = do_get_file("data/sessionstore_valid.js");
source.copyTo(profd, "sessionstore.js");
await writeCompressedFile(Paths.clean.replace("jsonlz4", "js"), Paths.clean);