test_quicksuggest_migrate_v1.js (1195B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 // Tests Suggest prefs migration from unversioned prefs to version 1. 6 7 "use strict"; 8 9 const TO_VERSION = 1; 10 11 add_setup(async () => { 12 await setUpMigrateTest(); 13 }); 14 15 // No user-branch values set 16 add_task(async function () { 17 await doMigrateTest({ 18 toVersion: TO_VERSION, 19 }); 20 }); 21 22 // Migrating from Suggest disabled 23 add_task(async function () { 24 await doMigrateTest({ 25 toVersion: TO_VERSION, 26 preMigrationUserPrefs: { 27 "suggest.quicksuggest": false, 28 }, 29 expectedPostMigrationUserPrefs: { 30 "suggest.quicksuggest": null, 31 "suggest.quicksuggest.nonsponsored": false, 32 "suggest.quicksuggest.sponsored": false, 33 }, 34 }); 35 }); 36 37 // Migrating from Suggest enabled 38 add_task(async function () { 39 await doMigrateTest({ 40 toVersion: TO_VERSION, 41 preMigrationUserPrefs: { 42 "suggest.quicksuggest": true, 43 }, 44 expectedPostMigrationUserPrefs: { 45 "suggest.quicksuggest": null, 46 "suggest.quicksuggest.nonsponsored": true, 47 }, 48 }); 49 });