From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- dom/indexedDB/test/unit/test_idbSubdirUpgrade.js | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 dom/indexedDB/test/unit/test_idbSubdirUpgrade.js (limited to 'dom/indexedDB/test/unit/test_idbSubdirUpgrade.js') diff --git a/dom/indexedDB/test/unit/test_idbSubdirUpgrade.js b/dom/indexedDB/test/unit/test_idbSubdirUpgrade.js new file mode 100644 index 0000000000..5a6cf7686e --- /dev/null +++ b/dom/indexedDB/test/unit/test_idbSubdirUpgrade.js @@ -0,0 +1,55 @@ +/** + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +/* exported testGenerator */ +var testGenerator = testSteps(); + +function* testSteps() { + const openParams = [ + // This one lives in storage/default/http+++www.mozilla.org + { url: "http://www.mozilla.org", dbName: "dbB", dbVersion: 1 }, + ]; + + for (let i = 1; i <= 2; i++) { + clearAllDatabases(continueToNextStepSync); + yield undefined; + + installPackagedProfile("idbSubdirUpgrade" + i + "_profile"); + + for (let params of openParams) { + let request = indexedDB.openForPrincipal( + getPrincipal(params.url), + params.dbName, + params.dbVersion + ); + request.onerror = errorHandler; + request.onupgradeneeded = unexpectedSuccessHandler; + request.onsuccess = grabEventAndContinueHandler; + let event = yield undefined; + + is(event.type, "success", "Correct event type"); + } + + resetAllDatabases(continueToNextStepSync); + yield undefined; + + for (let params of openParams) { + let request = indexedDB.openForPrincipal( + getPrincipal(params.url), + params.dbName, + params.dbVersion + ); + request.onerror = errorHandler; + request.onupgradeneeded = unexpectedSuccessHandler; + request.onsuccess = grabEventAndContinueHandler; + let event = yield undefined; + + is(event.type, "success", "Correct event type"); + } + } + + finishTest(); + yield undefined; +} -- cgit v1.2.3