}
QString dataLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
- offlineStoragePath = dataLocation.replace(QLatin1Char('/'), QDir::separator()) +
- QDir::separator() + QLatin1String("QML") +
- QDir::separator() + QLatin1String("OfflineStorage");
+ if (!dataLocation.isEmpty())
+ offlineStoragePath = dataLocation.replace(QLatin1Char('/'), QDir::separator())
+ + QDir::separator() + QLatin1String("QML")
+ + QDir::separator() + QLatin1String("OfflineStorage");
}
QQuickWorkerScriptEngine *QQmlEnginePrivate::getWorkerScriptEngine()
void tst_qqmlsqldatabase::initTestCase()
{
+ if (engine->offlineStoragePath().isEmpty())
+ QSKIP("offlineStoragePath is empty, skip this test.");
QQmlDataTest::initTestCase();
removeRecursive(dbDir());
QDir().mkpath(dbDir());
void tst_qqmlsqldatabase::cleanupTestCase()
{
+ if (engine->offlineStoragePath().isEmpty())
+ QSKIP("offlineStoragePath is empty, skip this test.");
removeRecursive(dbDir());
}
void tst_qqmlsqldatabase::checkDatabasePath()
{
+ if (engine->offlineStoragePath().isEmpty())
+ QSKIP("offlineStoragePath is empty, skip this test.");
+
// Check default storage path (we can't use it since we don't want to mess with user's data)
QVERIFY(engine->offlineStoragePath().contains("tst_qqmlsqldatabase"));
QVERIFY(engine->offlineStoragePath().contains("OfflineStorage"));
void tst_qqmlsqldatabase::testQml()
{
+ if (engine->offlineStoragePath().isEmpty())
+ QSKIP("offlineStoragePath is empty, skip this test.");
+
// Tests QML SQL Database support with tests
// that have been validated against Webkit.
//
void tst_qqmlsqldatabase::testQml_cleanopen()
{
+ if (engine->offlineStoragePath().isEmpty())
+ QSKIP("offlineStoragePath is empty, skip this test.");
+
// Same as testQml, but clean connections between tests,
// making it more like the tests are running in new processes.
testQml();
void tst_qqmlsqldatabase::totalDatabases()
{
+ if (engine->offlineStoragePath().isEmpty())
+ QSKIP("offlineStoragePath is empty, skip this test.");
+
QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).count(), total_databases_created_by_tests*2);
}