summaryrefslogtreecommitdiff
path: root/tests/quicktestbrowser/main.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-12 11:32:02 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-12 11:35:45 +0100
commita077399f4c17f57e911334867c918cc6ddeb15fc (patch)
treec8e4d326d7a074e9d16b68399ecc5f728f8533fe /tests/quicktestbrowser/main.cpp
parent3d698f5de377bde2293e222536bc50171cfdf1b8 (diff)
parent12dd6ff845656eb625e2ee3d0e73392bc2c61983 (diff)
downloadqtwebengine-a077399f4c17f57e911334867c918cc6ddeb15fc.tar.gz
Merge branch '5.6' into dev
Change-Id: I4272eb59cac08c69eaa58dd4d94debf1b8c5cf78
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);