Bug 1919555 - LSNG: Create a new module for LocalStorage utilities; r=dom-storage-reviewers,asuth

Differential Revision: https://phabricator.services.mozilla.com/D221831
This commit is contained in:
Jan Varga 2024-10-03 11:26:35 +00:00
parent 0477e63a6e
commit deafeb2875
3 changed files with 27 additions and 1 deletions

View File

@ -17,7 +17,7 @@ TEST_HARNESS_FILES.xpcshell.dom.localstorage.test.unit += [
"test/unit/databaseShadowing-shared.js",
]
TEST_DIRS += ["test/gtest"]
TEST_DIRS += ["test"]
XPIDL_SOURCES += [
"nsILocalStorageManager.idl",

View File

@ -0,0 +1,15 @@
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
export const LocalStorageUtils = {
createStorage(principal) {
return Services.domStorageManager.createStorage(
null,
principal,
principal,
""
);
},
};

View File

@ -0,0 +1,11 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TEST_DIRS += ["gtest"]
TESTING_JS_MODULES.dom.localstorage.test.modules += [
"modules/system/LocalStorageUtils.sys.mjs",
]