diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/publicapi/tst_publicapi.cpp | 2 | ||||
-rw-r--r-- | tests/quicktestbrowser/main.cpp | 14 |
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); |