summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-11-27 16:15:32 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-12-12 11:28:00 +0000
commit28b08c849efc361b42e79b69e76541d9b0faddd9 (patch)
treea287d3e3856d611137f051c442a1d1f06f3a2bfa /tests
parent66988974a0eba36b6523b771bf6b078aa155a810 (diff)
Make QQuickWebEngineProfile public
Make QQuickWebEngineProfile a publicly exported class. This allows users to set up and manipulate the profile from C++, and removes the ugly hack needed to access the cookie store. Change-Id: I99e1a8c2cb99d9d1a14e1c78bec5948ba1282fb3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp2
-rw-r--r--tests/quicktestbrowser/main.cpp14
2 files changed, 5 insertions, 11 deletions
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 9bb4711fc..face62352 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -46,6 +46,7 @@
#include <QMetaType>
#include <QQmlListProperty>
#include <QtTest/QtTest>
+#include <QtWebEngine/QQuickWebEngineProfile>
#include <private/qquickwebengineview_p.h>
#include <private/qquickwebenginecertificateerror_p.h>
#include <private/qquickwebenginedownloaditem_p.h>
@@ -53,7 +54,6 @@
#include <private/qquickwebengineloadrequest_p.h>
#include <private/qquickwebenginenavigationrequest_p.h>
#include <private/qquickwebenginenewviewrequest_p.h>
-#include <private/qquickwebengineprofile_p.h>
#include <private/qquickwebenginescript_p.h>
#include <private/qquickwebenginesettings_p.h>
#include <private/qquickwebenginesingleton_p.h>
diff --git a/tests/quicktestbrowser/main.cpp b/tests/quicktestbrowser/main.cpp
index 12ebfa2d5..61977a018 100644
--- a/tests/quicktestbrowser/main.cpp
+++ b/tests/quicktestbrowser/main.cpp
@@ -52,6 +52,7 @@ typedef QGuiApplication Application;
#include <QtQml/QQmlContext>
#include <QtQml/QQmlComponent>
#include <QtWebEngine/qtwebengineglobal.h>
+#include <QtWebEngine/QQuickWebEngineProfile>
#include <QtWebEngineCore/qwebenginecookiestore.h>
static QUrl startupUrl()
@@ -84,17 +85,10 @@ int main(int argc, char **argv)
appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
QObject *rootObject = appEngine.rootObjects().first();
- QQmlComponent component(&appEngine);
- component.setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.1\n"
- "WebEngineProfile {\n"
- "storageName: \"Test\"\n"
- "}")
- , QUrl());
- QObject *profile = component.create();
+ QQuickWebEngineProfile *profile = new QQuickWebEngineProfile(rootObject);
+ QWebEngineCookieStore *client = profile->cookieStore();
+
const QMetaObject *rootMeta = rootObject->metaObject();
- QWebEngineCookieStore *client = 0;
- QMetaObject::invokeMethod(profile, "cookieStore", Q_RETURN_ARG(QWebEngineCookieStore*, client));
int index = rootMeta->indexOfProperty("thirdPartyCookiesEnabled");
Q_ASSERT(index != -1);
QMetaProperty thirdPartyCookiesProperty = rootMeta->property(index);