зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1608025 - Clean up the test for the upgrade from flat origin directories; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D59664 --HG-- rename : dom/quota/test/unit/upgrades/idbSubdirUpgrade1_profile.zip => dom/quota/test/unit/upgrades/indexedDBDirectory_flatOriginDirectories_profile.zip rename : dom/quota/test/unit/upgrades/idbSubdirUpgrade2_profile.zip => dom/quota/test/unit/upgrades/persistentStorageDirectory_flatOriginDirectories_profile.zip rename : dom/quota/test/unit/upgrades/test_idbSubdirUpgrade.js => dom/quota/test/unit/upgrades/test_upgradeFromFlatOriginDirectories.js extra : moz-landing-system : lando
This commit is contained in:
Родитель
e575c0d8c6
Коммит
f8f9157438
|
@ -3,58 +3,76 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
// A flat origin directory is an origin directory with no sub directories for
|
||||
// quota clients. The upgrade was initially done lazily and an empty .metadata
|
||||
// file was used to indicate a successful upgrade.
|
||||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function* testSteps() {
|
||||
const origins = [
|
||||
[
|
||||
{
|
||||
oldPath: "indexedDB/1007+f+app+++system.gaiamobile.org",
|
||||
},
|
||||
const setups = [
|
||||
{
|
||||
// Storage used prior FF 22 (indexedDB/ directory with flat origin
|
||||
// directories).
|
||||
// FF 26 renamed indexedDB/ to storage/persistent and the lazy upgrade
|
||||
// of flat origin directories remained. There's a test for that below.
|
||||
package: "indexedDBDirectory_flatOriginDirectories_profile",
|
||||
origins: [
|
||||
{
|
||||
oldPath: "indexedDB/1007+f+app+++system.gaiamobile.org",
|
||||
},
|
||||
|
||||
{
|
||||
oldPath: "indexedDB/1007+t+https+++developer.cdn.mozilla.net",
|
||||
},
|
||||
{
|
||||
oldPath: "indexedDB/1007+t+https+++developer.cdn.mozilla.net",
|
||||
},
|
||||
|
||||
{
|
||||
oldPath: "indexedDB/http+++www.mozilla.org",
|
||||
newPath: "storage/default/http+++www.mozilla.org",
|
||||
url: "http://www.mozilla.org",
|
||||
persistence: "default",
|
||||
},
|
||||
],
|
||||
{
|
||||
oldPath: "indexedDB/http+++www.mozilla.org",
|
||||
newPath: "storage/default/http+++www.mozilla.org",
|
||||
url: "http://www.mozilla.org",
|
||||
persistence: "default",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
[
|
||||
{
|
||||
oldPath: "storage/persistent/1007+f+app+++system.gaiamobile.org",
|
||||
},
|
||||
{
|
||||
// Storage used by FF 26-35 (storage/persistent/ directory with not yet
|
||||
// upgraded flat origin directories).
|
||||
// FF 36 renamed storage/persistent/ to storage/default/ and all not yet
|
||||
// upgraded flat origin directories were upgraded. There's a separate
|
||||
// test for that.
|
||||
package: "persistentStorageDirectory_flatOriginDirectories_profile",
|
||||
origins: [
|
||||
{
|
||||
oldPath: "storage/persistent/1007+f+app+++system.gaiamobile.org",
|
||||
},
|
||||
|
||||
{
|
||||
oldPath: "storage/persistent/1007+t+https+++developer.cdn.mozilla.net",
|
||||
},
|
||||
{
|
||||
oldPath:
|
||||
"storage/persistent/1007+t+https+++developer.cdn.mozilla.net",
|
||||
},
|
||||
|
||||
{
|
||||
oldPath: "storage/persistent/http+++www.mozilla.org",
|
||||
newPath: "storage/default/http+++www.mozilla.org",
|
||||
url: "http://www.mozilla.org",
|
||||
persistence: "default",
|
||||
},
|
||||
],
|
||||
{
|
||||
oldPath: "storage/persistent/http+++www.mozilla.org",
|
||||
newPath: "storage/default/http+++www.mozilla.org",
|
||||
url: "http://www.mozilla.org",
|
||||
persistence: "default",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const metadataFileName = ".metadata";
|
||||
|
||||
// Test upgrade from FF 21 (no idb subdirs).
|
||||
|
||||
for (let i = 1; i <= 2; i++) {
|
||||
for (const setup of setups) {
|
||||
clear(continueToNextStepSync);
|
||||
yield undefined;
|
||||
|
||||
installPackage("idbSubdirUpgrade" + i + "_profile");
|
||||
installPackage(setup.package);
|
||||
|
||||
info("Checking origin directories");
|
||||
|
||||
for (let origin of origins[i - 1]) {
|
||||
for (const origin of setup.origins) {
|
||||
let originDir = getRelativeFile(origin.oldPath);
|
||||
let exists = originDir.exists();
|
||||
ok(exists, "Origin directory does exist");
|
||||
|
@ -87,7 +105,7 @@ function* testSteps() {
|
|||
|
||||
info("Checking origin directories");
|
||||
|
||||
for (let origin of origins[i - 1]) {
|
||||
for (const origin of setup.origins) {
|
||||
let originDir = getRelativeFile(origin.oldPath);
|
||||
let exists = originDir.exists();
|
||||
ok(!exists, "Origin directory doesn't exist");
|
|
@ -6,20 +6,19 @@
|
|||
head = head.js
|
||||
support-files =
|
||||
defaultStorageUpgrade_profile.zip
|
||||
idbSubdirUpgrade1_profile.zip
|
||||
idbSubdirUpgrade2_profile.zip
|
||||
indexedDBDirectory_flatOriginDirectories_profile.zip
|
||||
localStorageArchive1upgrade_profile.zip
|
||||
localStorageArchive4upgrade_profile.zip
|
||||
localStorageArchiveDowngrade_profile.zip
|
||||
morgueCleanup_profile.zip
|
||||
obsoleteOriginAttributes_profile.zip
|
||||
originAttributesUpgrade_profile.zip
|
||||
persistentStorageDirectory_flatOriginDirectories_profile.zip
|
||||
storagePersistentUpgrade_profile.zip
|
||||
version2_1upgrade_profile.zip
|
||||
version2_2upgrade_profile.zip
|
||||
|
||||
[test_defaultStorageUpgrade.js]
|
||||
[test_idbSubdirUpgrade.js]
|
||||
[test_localStorageArchive1upgrade.js]
|
||||
[test_localStorageArchive4upgrade.js]
|
||||
[test_localStorageArchiveDowngrade.js]
|
||||
|
@ -28,4 +27,5 @@ support-files =
|
|||
[test_obsoleteOrigins.js]
|
||||
[test_originAttributesUpgrade.js]
|
||||
[test_storagePersistentUpgrade.js]
|
||||
[test_upgradeFromFlatOriginDirectories.js]
|
||||
[test_version2_1upgrade.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче