summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qtbug-70248/tst_qtbug-70248.cpp
blob: cf5c187c35c4cab91a82a5dc0b53184341c5c29b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "qtwebenginequickglobal.h"
#include <QQuickWebEngineProfile>
#include <QQmlApplicationEngine>
#include <QQuickWindow>
#include <QTest>
#include <QSignalSpy>

class tst_qtbug_70248: public QObject {
    Q_OBJECT
public:
    tst_qtbug_70248(){}
private slots:
    void test();
};

void tst_qtbug_70248::test()
{
    QtWebEngineQuick::initialize();
    QScopedPointer<QQmlApplicationEngine> engine;
    QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
    engine.reset(new QQmlApplicationEngine());
    engine->load(QUrl(QStringLiteral("qrc:/test.qml")));
    QQuickWindow *widnow = qobject_cast<QQuickWindow*>(engine->rootObjects().first());
    QVERIFY(widnow);
}

#include "tst_qtbug-70248.moc"
QTEST_MAIN(tst_qtbug_70248)