diff options
Diffstat (limited to 'tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp')
-rw-r--r-- | tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp index 734c4ff7a..b4c95d671 100644 --- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp +++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp @@ -1,33 +1,8 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "testwindow.h" -#include "util.h" +#include "quickutil.h" #include <QGuiApplication> #include <QtQml/QQmlEngine> @@ -63,8 +38,8 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::initEngineAndViewComponent() { m_engine = new QQmlEngine(this); QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true); m_component.reset(new QQmlComponent(m_engine, this)); - m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n" - "import QtWebEngine 1.2\n" + m_component->setData(QByteArrayLiteral("import QtQuick\n" + "import QtWebEngine\n" "WebEngineView {}") , QUrl()); } @@ -93,7 +68,7 @@ inline QQuickWebEngineView *tst_QQuickWebEngineDefaultSurfaceFormat::webEngineVi QUrl tst_QQuickWebEngineDefaultSurfaceFormat::urlFromTestPath(const char *localFilePath) { - QString testSourceDirPath = QString::fromLocal8Bit(TESTS_SOURCE_DIR); + QString testSourceDirPath = QDir(QT_TESTCASE_SOURCEDIR).canonicalPath(); if (!testSourceDirPath.endsWith(QLatin1Char('/'))) testSourceDirPath.append(QLatin1Char('/')); @@ -116,7 +91,7 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::customDefaultSurfaceFormat() QSurfaceFormat::setDefaultFormat( format ); QGuiApplication app(argc, argv); - QtWebEngine::initialize(); + QtWebEngineQuick::initialize(); initEngineAndViewComponent(); initWindow(); @@ -126,10 +101,10 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::customDefaultSurfaceFormat() QObject::connect( view, - &QQuickWebEngineView::loadingChanged, [](QQuickWebEngineLoadRequest* request) + &QQuickWebEngineView::loadingChanged, [](const QWebEngineLoadingInfo &info) { - if (request->status() == QQuickWebEngineView::LoadSucceededStatus - || request->status() == QQuickWebEngineView::LoadFailedStatus) + if (info.status() == QWebEngineLoadingInfo::LoadSucceededStatus + || info.status() == QWebEngineLoadingInfo::LoadFailedStatus) QTimer::singleShot(100, qApp, &QCoreApplication::quit); } ); |