diff --git a/.eslintrc.js b/.eslintrc.js index fae91f82b5c0..2d7860758b68 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -190,7 +190,6 @@ module.exports = { // investigation or different solutions. They are also likely to be // a reasonable size. "dom/indexedDB/**", - "dom/localstorage/**", ], rules: { // No declaring variables that are never used diff --git a/dom/localstorage/test/helpers.js b/dom/localstorage/test/helpers.js index 69281b09df9c..d66804234350 100644 --- a/dom/localstorage/test/helpers.js +++ b/dom/localstorage/test/helpers.js @@ -38,17 +38,9 @@ if (!window.runTest) { await requestFinished(clearAllDatabases()); - ok(typeof testSteps === "function", "There should be a testSteps function"); - ok( - testSteps.constructor.name === "AsyncFunction", - "testSteps should be an async function" - ); - SimpleTest.registerCleanupFunction(async function() { await requestFinished(clearAllDatabases()); }); - - add_task(testSteps); }; } diff --git a/dom/localstorage/test/unit/head.js b/dom/localstorage/test/unit/head.js index 0e0cc10f5413..eaca1ed17372 100644 --- a/dom/localstorage/test/unit/head.js +++ b/dom/localstorage/test/unit/head.js @@ -16,36 +16,15 @@ function ok(cond, msg) { Assert.ok(!!cond, msg); } -function run_test() { - runTest(); -} +add_setup(function() { + do_get_profile(); -if (!this.runTest) { - this.runTest = function() { - do_get_profile(); + enableTesting(); - enableTesting(); + Cu.importGlobalProperties(["crypto"]); - Cu.importGlobalProperties(["crypto"]); - - Assert.ok( - typeof testSteps === "function", - "There should be a testSteps function" - ); - Assert.ok( - testSteps.constructor.name === "AsyncFunction", - "testSteps should be an async function" - ); - - registerCleanupFunction(resetTesting); - - add_task(testSteps); - - // Since we defined run_test, we must invoke run_next_test() to start the - // async test. - run_next_test(); - }; -} + registerCleanupFunction(resetTesting); +}); function returnToEventLoop() { return new Promise(function(resolve) { diff --git a/dom/localstorage/test/unit/test_archive.js b/dom/localstorage/test/unit/test_archive.js index 99ac253319f8..51af78db1b24 100644 --- a/dom/localstorage/test/unit/test_archive.js +++ b/dom/localstorage/test/unit/test_archive.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const lsArchiveFile = "storage/ls-archive.sqlite"; const principalInfo = { @@ -75,4 +75,4 @@ async function testSteps() { ok(fileSize > 0, "archive file size is greater than zero"); checkStorage(); -} +}); diff --git a/dom/localstorage/test/unit/test_clientValidation.js b/dom/localstorage/test/unit/test_clientValidation.js index 57c8f0e822d4..26dc2bfdf719 100644 --- a/dom/localstorage/test/unit/test_clientValidation.js +++ b/dom/localstorage/test/unit/test_clientValidation.js @@ -8,7 +8,7 @@ * We turn on client validation for LocalStorage and ensure that we don't have * access to LocalStorage. */ -async function testSteps() { +add_task(async function testSteps() { const principal = getPrincipal("http://example.com"); info("Setting prefs"); @@ -29,4 +29,4 @@ async function testSteps() { is(ex.name, "NS_ERROR_FAILURE", "Threw right Exception"); is(ex.result, Cr.NS_ERROR_FAILURE, "Threw with right result"); } -} +}); diff --git a/dom/localstorage/test/unit/test_corruptedDatabase.js b/dom/localstorage/test/unit/test_corruptedDatabase.js index 61698082fd70..da73bb92f630 100644 --- a/dom/localstorage/test/unit/test_corruptedDatabase.js +++ b/dom/localstorage/test/unit/test_corruptedDatabase.js @@ -36,7 +36,7 @@ async function doTest(profile) { is(request.result.usage, 0, "Correct usage"); } -async function testSteps() { +add_task(async function testSteps() { info("Setting pref"); Services.prefs.setBoolPref( @@ -70,4 +70,4 @@ async function testSteps() { for (const profile of profiles) { await doTest(profile); } -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing1.js b/dom/localstorage/test/unit/test_databaseShadowing1.js index 12c4a646e455..8582f434fc0f 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing1.js +++ b/dom/localstorage/test/unit/test_databaseShadowing1.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { enableNextGenLocalStorage(); storeData(); @@ -20,4 +20,4 @@ async function testSteps() { exportShadowDatabase("shadowdb.sqlite"); // The shadow database is now prepared for test_databaseShadowing2.js -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing2.js b/dom/localstorage/test/unit/test_databaseShadowing2.js index 924564ad1150..f7b0ddb1a2c2 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing2.js +++ b/dom/localstorage/test/unit/test_databaseShadowing2.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { // The shadow database was prepared in test_databaseShadowing1.js disableNextGenLocalStorage(); @@ -14,4 +14,4 @@ async function testSteps() { ok(importShadowDatabase("shadowdb.sqlite"), "Import succeeded"); verifyData([], /* migrated */ true); -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin1.js b/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin1.js index ed05108af741..d88fde52e5da 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin1.js +++ b/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin1.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { enableNextGenLocalStorage(); storeData(); @@ -27,4 +27,4 @@ async function testSteps() { // The shadow database is now prepared for // test_databaseShadowing_clearOrigin2.js -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin2.js b/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin2.js index 3c67722ae722..83d792b496eb 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin2.js +++ b/dom/localstorage/test/unit/test_databaseShadowing_clearOrigin2.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { // The shadow database was prepared in test_databaseShadowing_clearOrigin1.js disableNextGenLocalStorage(); @@ -14,4 +14,4 @@ async function testSteps() { ok(importShadowDatabase("shadowdb-clearedOrigin.sqlite"), "Import succeeded"); verifyData([1], /* migrated */ true); -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern1.js b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern1.js index 961da5aaf766..70367bbeff90 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern1.js +++ b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern1.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { enableNextGenLocalStorage(); storeData(); @@ -26,4 +26,4 @@ async function testSteps() { // The shadow database is now prepared for // test_databaseShadowing_clearOriginsByPattern2.js -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern2.js b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern2.js index ae4b8959bc66..6c4d794d04f0 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern2.js +++ b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPattern2.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { // The shadow database was prepared in // test_databaseShadowing_clearOriginsByPattern1.js @@ -18,4 +18,4 @@ async function testSteps() { ); verifyData([4, 5, 6], /* migrated */ true); -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix1.js b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix1.js index 6680fda93758..2b605e953fad 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix1.js +++ b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix1.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { enableNextGenLocalStorage(); storeData(); @@ -25,4 +25,4 @@ async function testSteps() { // The shadow database is now prepared for // test_databaseShadowing_clearOriginsByPrefix2.js -} +}); diff --git a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix2.js b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix2.js index 0bea6f039498..892a470723da 100644 --- a/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix2.js +++ b/dom/localstorage/test/unit/test_databaseShadowing_clearOriginsByPrefix2.js @@ -6,7 +6,7 @@ /* import-globals-from databaseShadowing-shared.js */ loadSubscript("databaseShadowing-shared.js"); -async function testSteps() { +add_task(async function testSteps() { // The shadow database was prepared in // test_databaseShadowing_clearOriginsByPrefix1.js @@ -18,4 +18,4 @@ async function testSteps() { ); verifyData([2, 3], /* migrated */ true); -} +}); diff --git a/dom/localstorage/test/unit/test_eviction.js b/dom/localstorage/test/unit/test_eviction.js index 9c49e1b393a1..2a69b3e71698 100644 --- a/dom/localstorage/test/unit/test_eviction.js +++ b/dom/localstorage/test/unit/test_eviction.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const globalLimitKB = 5 * 1024; const data = {}; @@ -88,4 +88,4 @@ async function testSteps() { await requestFinished(request); is(request.result.usage, 0, "Zero usage"); -} +}); diff --git a/dom/localstorage/test/unit/test_flushing.js b/dom/localstorage/test/unit/test_flushing.js index 2f7d63172238..b33ef7c0995b 100644 --- a/dom/localstorage/test/unit/test_flushing.js +++ b/dom/localstorage/test/unit/test_flushing.js @@ -9,7 +9,7 @@ * database in the event of early return due to error. See bug 1559029. */ -async function testSteps() { +add_task(async function testSteps() { const principal1 = getPrincipal("http://example1.com"); const usageFile1 = getRelativeFile( @@ -69,4 +69,4 @@ async function testSteps() { // Wait for all database connections to close. let request = reset(); await requestFinished(request); -} +}); diff --git a/dom/localstorage/test/unit/test_groupLimit.js b/dom/localstorage/test/unit/test_groupLimit.js index 1921622b7285..575b7b7b63f2 100644 --- a/dom/localstorage/test/unit/test_groupLimit.js +++ b/dom/localstorage/test/unit/test_groupLimit.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const groupLimitKB = 10 * 1024; const globalLimitKB = groupLimitKB * 5; @@ -82,4 +82,4 @@ async function testSteps() { for (let i = 0; i < urls.length; i++) { storages[i].setItem("B", ""); } -} +}); diff --git a/dom/localstorage/test/unit/test_groupMismatch.js b/dom/localstorage/test/unit/test_groupMismatch.js index ba0fe6f6ade2..46533aa2f72e 100644 --- a/dom/localstorage/test/unit/test_groupMismatch.js +++ b/dom/localstorage/test/unit/test_groupMismatch.js @@ -9,7 +9,7 @@ * quota object. See bug 1516333. */ -async function testSteps() { +add_task(async function testSteps() { const principal = getPrincipal("https://foo.bar.mozilla-iot.org"); info("Clearing"); @@ -42,4 +42,4 @@ async function testSteps() { info("Adding item"); storage.setItem("foo", "bar"); -} +}); diff --git a/dom/localstorage/test/unit/test_largeItems.js b/dom/localstorage/test/unit/test_largeItems.js index c60f6ba3dba6..3ea6bd21b424 100644 --- a/dom/localstorage/test/unit/test_largeItems.js +++ b/dom/localstorage/test/unit/test_largeItems.js @@ -10,7 +10,7 @@ * IPC message size limit would be exceeded, resulting in a crash. */ -async function testSteps() { +add_task(async function testSteps() { const globalLimitKB = 5 * 1024; // 18 and more iterations would produce an IPC message with size greater than @@ -85,4 +85,4 @@ async function testSteps() { await returnToEventLoop(); ok(!storage.hasSnapshot, "Snapshot successfully finished"); -} +}); diff --git a/dom/localstorage/test/unit/test_lsng_enabled.js b/dom/localstorage/test/unit/test_lsng_enabled.js index c9b9aa402a1d..d978aaa90136 100644 --- a/dom/localstorage/test/unit/test_lsng_enabled.js +++ b/dom/localstorage/test/unit/test_lsng_enabled.js @@ -8,7 +8,6 @@ * can lead to a data loss in a combination with disabled shadow writes. */ -// eslint-disable-next-line no-unused-vars -async function testSteps() { +add_task(async function testSteps() { ok(Services.domStorageManager.nextGenLocalStorageEnabled, "LSNG enabled"); -} +}); diff --git a/dom/localstorage/test/unit/test_migration.js b/dom/localstorage/test/unit/test_migration.js index 96dca46162aa..1249eb076fa1 100644 --- a/dom/localstorage/test/unit/test_migration.js +++ b/dom/localstorage/test/unit/test_migration.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const principalInfos = [ { url: "http://localhost", attrs: {} }, { url: "http://www.mozilla.org", attrs: {} }, @@ -124,4 +124,4 @@ async function testSteps() { verifyData(clearedOrigins); } -} +}); diff --git a/dom/localstorage/test/unit/test_migration_emptyValue.js b/dom/localstorage/test/unit/test_migration_emptyValue.js index a4c752e6ab7c..dd09c82e8836 100644 --- a/dom/localstorage/test/unit/test_migration_emptyValue.js +++ b/dom/localstorage/test/unit/test_migration_emptyValue.js @@ -3,8 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -// eslint-disable-next-line no-unused-vars -async function testSteps() { +add_task(async function testSteps() { const data = { key: "foo", value: "", @@ -35,4 +34,4 @@ async function testSteps() { info("Verifying data"); is(storage.getItem(data.key), data.value, "Correct value"); -} +}); diff --git a/dom/localstorage/test/unit/test_old_lsng_pref.js b/dom/localstorage/test/unit/test_old_lsng_pref.js index 9f814d248379..d502ee8779ea 100644 --- a/dom/localstorage/test/unit/test_old_lsng_pref.js +++ b/dom/localstorage/test/unit/test_old_lsng_pref.js @@ -8,11 +8,10 @@ * implementations has no effect anymore. */ -// eslint-disable-next-line no-unused-vars -async function testSteps() { +add_task(async function testSteps() { info("Setting pref"); Services.prefs.setBoolPref("dom.storage.next_gen", false); ok(Services.domStorageManager.nextGenLocalStorageEnabled, "LSNG enabled"); -} +}); diff --git a/dom/localstorage/test/unit/test_orderingAfterRemoveAdd.js b/dom/localstorage/test/unit/test_orderingAfterRemoveAdd.js index d9c1ec914aef..88a2e45d2a13 100644 --- a/dom/localstorage/test/unit/test_orderingAfterRemoveAdd.js +++ b/dom/localstorage/test/unit/test_orderingAfterRemoveAdd.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const url = "http://example.com"; info("Setting pref"); @@ -67,4 +67,4 @@ async function testSteps() { for (let i = 0; i < keys.length; i++) { is(keys[i], savedKeys[i], "Correct key"); } -} +}); diff --git a/dom/localstorage/test/unit/test_originInit.js b/dom/localstorage/test/unit/test_originInit.js index 05ff37b7a978..48afdf971bd9 100644 --- a/dom/localstorage/test/unit/test_originInit.js +++ b/dom/localstorage/test/unit/test_originInit.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const storageDirName = "storage"; const persistenceTypeDefaultDirName = "default"; const persistenceTypePersistentDirName = "permanent"; @@ -369,4 +369,4 @@ async function testSteps() { ok(exists, "ls directory in permanent origin directory does exist"); await clearPersistentTestOrigin(); -} +}); diff --git a/dom/localstorage/test/unit/test_preloading.js b/dom/localstorage/test/unit/test_preloading.js index b1e3393a39a9..977ab10d9974 100644 --- a/dom/localstorage/test/unit/test_preloading.js +++ b/dom/localstorage/test/unit/test_preloading.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const principals = [ getPrincipal("http://example.com", {}), getPrincipal("http://example.com", { privateBrowsingId: 1 }), @@ -81,4 +81,4 @@ async function testSteps() { "Data is not preloaded after clearing origin" ); } -} +}); diff --git a/dom/localstorage/test/unit/test_schema3upgrade.js b/dom/localstorage/test/unit/test_schema3upgrade.js index 7a219ec9c4ec..4b851642ea8b 100644 --- a/dom/localstorage/test/unit/test_schema3upgrade.js +++ b/dom/localstorage/test/unit/test_schema3upgrade.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const url = "http://example.com"; info("Setting pref"); @@ -36,4 +36,4 @@ async function testSteps() { let storage = getLocalStorage(getPrincipal(url)); storage.open(); -} +}); diff --git a/dom/localstorage/test/unit/test_schema4upgrade.js b/dom/localstorage/test/unit/test_schema4upgrade.js index 0160bd4c87a2..a6c308af35d9 100644 --- a/dom/localstorage/test/unit/test_schema4upgrade.js +++ b/dom/localstorage/test/unit/test_schema4upgrade.js @@ -2,9 +2,8 @@ * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -/* eslint no-unused-vars: ["warn", { "varsIgnorePattern": "(testSteps)" }]*/ -async function testSteps() { +add_task(async function testSteps() { const url = "http://example.com"; info("Setting pref"); @@ -37,4 +36,4 @@ async function testSteps() { let storage = getLocalStorage(getPrincipal(url)); storage.open(); -} +}); diff --git a/dom/localstorage/test/unit/test_snapshotting.js b/dom/localstorage/test/unit/test_snapshotting.js index d29cbf020c98..4b639395f7dd 100644 --- a/dom/localstorage/test/unit/test_snapshotting.js +++ b/dom/localstorage/test/unit/test_snapshotting.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const url = "http://example.com"; info("Setting pref"); @@ -327,4 +327,4 @@ async function testSteps() { await returnToEventLoop(); } } -} +}); diff --git a/dom/localstorage/test/unit/test_stringLength.js b/dom/localstorage/test/unit/test_stringLength.js index 87ff7d978a6c..52ee59f7d61f 100644 --- a/dom/localstorage/test/unit/test_stringLength.js +++ b/dom/localstorage/test/unit/test_stringLength.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const principal = getPrincipal("http://example.org"); const data = {}; @@ -71,4 +71,4 @@ async function testSteps() { value = storage.getItem(data.secondKey); ok(value.length === data.value.length, "Correct string length"); -} +}); diff --git a/dom/localstorage/test/unit/test_stringLength2.js b/dom/localstorage/test/unit/test_stringLength2.js index 4c92f21c74ca..f1a1a902cf9d 100644 --- a/dom/localstorage/test/unit/test_stringLength2.js +++ b/dom/localstorage/test/unit/test_stringLength2.js @@ -8,7 +8,7 @@ * database values containing NULs. See bug 1541681. */ -async function testSteps() { +add_task(async function testSteps() { const principal = getPrincipal("http://example.org"); const data = {}; @@ -76,4 +76,4 @@ async function testSteps() { value = storage.getItem(data.secondKey); ok(value.length === data.value.length, "Correct string length"); -} +}); diff --git a/dom/localstorage/test/unit/test_unicodeCharacters.js b/dom/localstorage/test/unit/test_unicodeCharacters.js index 20bd7072e832..9e48274161f5 100644 --- a/dom/localstorage/test/unit/test_unicodeCharacters.js +++ b/dom/localstorage/test/unit/test_unicodeCharacters.js @@ -135,8 +135,7 @@ const fetchFromNewSnapshotNewDatastore = async (itemKey, sample) => { }); }; -/* eslint no-unused-vars: ["warn", { "varsIgnorePattern": "(testSteps)" }]*/ -async function testSteps() { +add_task(async function testSteps() { /* This test is based on bug 1681300 */ Services.prefs.setBoolPref( "dom.storage.enable_unsupported_legacy_implementation", @@ -203,4 +202,4 @@ async function testSteps() { "NewSnapshotNewDatastore", fetchFromNewSnapshotNewDatastore ); -} +}); diff --git a/dom/localstorage/test/unit/test_uri_encoding_edge_cases.js b/dom/localstorage/test/unit/test_uri_encoding_edge_cases.js index 2c29616ef606..0da4e8584d80 100644 --- a/dom/localstorage/test/unit/test_uri_encoding_edge_cases.js +++ b/dom/localstorage/test/unit/test_uri_encoding_edge_cases.js @@ -11,7 +11,7 @@ * of a null quota object. See bug 1516333. */ -async function testSteps() { +add_task(async function testSteps() { /** * The edge cases are specified in this array of origins. Each edge case must * contain two properties uri and path (origin directory path relative to the @@ -66,4 +66,4 @@ async function testSteps() { ok(originDir.exists(), `The origin directory ${origin.path} should exist`); } -} +}); diff --git a/dom/localstorage/test/unit/test_usage.js b/dom/localstorage/test/unit/test_usage.js index 5424173c1721..552a45e4a67f 100644 --- a/dom/localstorage/test/unit/test_usage.js +++ b/dom/localstorage/test/unit/test_usage.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const data = {}; data.key = "key1"; data.value = "value1"; @@ -66,4 +66,4 @@ async function testSteps() { await requestFinished(request); is(request.result.usage, 0, "Correct usage"); -} +}); diff --git a/dom/localstorage/test/unit/test_usageAfterMigration.js b/dom/localstorage/test/unit/test_usageAfterMigration.js index 840d71d81120..a0bd5efd5b75 100644 --- a/dom/localstorage/test/unit/test_usageAfterMigration.js +++ b/dom/localstorage/test/unit/test_usageAfterMigration.js @@ -3,7 +3,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -async function testSteps() { +add_task(async function testSteps() { const principal = getPrincipal("http://example.com"); const dataFile = getRelativeFile( @@ -161,4 +161,4 @@ async function testSteps() { verifyData(); await verifyUsage(/* success */ true); -} +});