diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-07-31 15:42:35 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-08-21 19:39:21 +0200 |
commit | a6d40467de7b9b07ff0252b6f91f75899aa3d5e1 (patch) | |
tree | 578a052dfcc5628f5e1cd9c2ed6f67f125199ea1 /tests/auto/corelib/io | |
parent | c1b287c531f444dfe57e6bb1353e1c517ad2d416 (diff) |
Make IDB settings work sync with JSPI
IndexedDB version of QSettings will now use solely the sync versions
of data access functions. Those will suspend with JSPI.
This makes IDB settings conform to the QSettings contract - and also
allows us to enable tests in tst_qsettings for the IDB version of
QSettings.
Also, do not treat the IndexedDB format as one defining read/write
functions in QSettings - those are the same as for ini format, as
IndexedDB settings backend uses a backing ini file.
Change-Id: Iee3471cc79c0cea87378923cf9baac58e56d1272
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r-- | tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 337428d01a..0661ac17ca 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -42,9 +42,9 @@ #endif #if defined(Q_OS_WASM) -# include <QtCore/private/qstdweb_p.h> +#include <QtCore/private/qstdweb_p.h> -# include "emscripten/val.h" +#include "emscripten/val.h" #endif Q_DECLARE_METATYPE(QSettings::Format) @@ -89,6 +89,10 @@ static void populateWithFormats() QTest::addColumn<QSettings::Format>("format"); QTest::newRow("native") << QSettings::NativeFormat; +#if defined(Q_OS_WASM) + if (qstdweb::haveJspi()) + QTest::newRow("idb") << QSettings::WebIndexedDBFormat; +#endif // defined(Q_OS_WASM) QTest::newRow("ini") << QSettings::IniFormat; QTest::newRow("custom1") << QSettings::CustomFormat1; QTest::newRow("custom2") << QSettings::CustomFormat2; |