1
0
Fork 0
firefox/testing/web-platform/tests/shared-storage-selecturl-limit/resources/utils.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

19 lines
952 B
JavaScript

// META: script=/fenced-frame/resources/utils.js
// Generate a list of URLs to use as input to sharedStorage.selectURL.
// @param {integer} size - The number of URLs to generate
// @param {string} pathPrefix - Prefix of the relative URL to use
// @param {string list} keylist - The list of key UUIDs to be used. Note that
// order matters when extracting the keys
// @return {SharedStorageUrlWithMetadata list} - A list of
// SharedStorageUrlWithMetadata
// dictionaries whose "url"
// values have `keylist` appended
// to their `searchParams`
function generateUrls(size, pathPrefix, keylist) {
return new Array(size).fill(0).map((e, i) => {
return {
url: generateURL(pathPrefix + i.toString() + '.html', keylist)
}
});
}