From f341988f451c6ba1fc3b8da765c00d1d64eaff30 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Jun 2020 13:11:58 +0200 Subject: Return valid path in Profile::GetPath() for incognito profiles Parts of Chromium depends on it for temporary directories it creates. This also changes the logic of depending on it being empty as indicating an in memory profile, so it required a bit of cleaning up. Note this does subtly change the return value of off-the-record profiles. Task-number: QTBUG-62957 Change-Id: Iec6e24556128c515fce27803171a766b8a9d92e3 Reviewed-by: Michal Klocek --- tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 00d4bae5a..836f1885e 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -136,12 +136,13 @@ void tst_QWebEngineProfile::privateProfile() QCOMPARE(otrProfile.httpCacheType(), QWebEngineProfile::MemoryHttpCache); QCOMPARE(otrProfile.persistentCookiesPolicy(), QWebEngineProfile::NoPersistentCookies); QCOMPARE(otrProfile.cachePath(), QString()); - QCOMPARE(otrProfile.persistentStoragePath(), QString()); + QCOMPARE(otrProfile.persistentStoragePath(), QStandardPaths::writableLocation(QStandardPaths::DataLocation) + + QStringLiteral("/QtWebEngine/OffTheRecord")); // TBD: setters do not really work otrProfile.setCachePath(QStringLiteral("/home/foo/bar")); QCOMPARE(otrProfile.cachePath(), QString()); otrProfile.setPersistentStoragePath(QStringLiteral("/home/foo/bar")); - QCOMPARE(otrProfile.persistentStoragePath(), QString()); + QCOMPARE(otrProfile.persistentStoragePath(), QStringLiteral("/home/foo/bar")); otrProfile.setHttpCacheType(QWebEngineProfile::DiskHttpCache); QCOMPARE(otrProfile.httpCacheType(), QWebEngineProfile::MemoryHttpCache); otrProfile.setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies); -- cgit v1.2.3