summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/quicktestbrowser/main.cpp')
-rw-r--r--tests/quicktestbrowser/main.cpp14
1 files changed, 4 insertions, 10 deletions
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);