diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/localstorage/test/unit/test_migration_emptyValue.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/localstorage/test/unit/test_migration_emptyValue.js')
-rw-r--r-- | dom/localstorage/test/unit/test_migration_emptyValue.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/dom/localstorage/test/unit/test_migration_emptyValue.js b/dom/localstorage/test/unit/test_migration_emptyValue.js new file mode 100644 index 0000000000..dd09c82e88 --- /dev/null +++ b/dom/localstorage/test/unit/test_migration_emptyValue.js @@ -0,0 +1,37 @@ +/** + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +add_task(async function testSteps() { + const data = { + key: "foo", + value: "", + }; + + info("Clearing"); + + let request = clear(); + await requestFinished(request); + + info("Installing package"); + + // The profile contains storage.sqlite and webappsstore.sqlite. + // The archive migration_emptyValue_profile.zip was created by running + // make_migration_emptyValue.js locally, specifically the special test was + // temporarily activated in xpcshell.ini and then it was run as: + // mach test --interactive dom/localstorage/test/unit/make_migration_emptyValue.js + // Before packaging, additional manual steps are needed: + // 1. Folder "cache2" is removed. + // 2. Folder "crashes" is removed. + // 3. File "mozinfo.json" is removed. + installPackage("migration_emptyValue_profile"); + + info("Getting storage"); + + const storage = getLocalStorage(); + + info("Verifying data"); + + is(storage.getItem(data.key), data.value, "Correct value"); +}); |