File indexing completed on 2025-01-26 04:57:21
0001 /* 0002 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "localdatabasemanagertest.h" 0008 #include "../localdatabasemanager.h" 0009 #include "../localdatabasemanager_p.h" 0010 0011 #include <QTest> 0012 0013 class TestLocalDatabaseManagerPrivate : public WebEngineViewer::LocalDataBaseManagerPrivate 0014 { 0015 public: 0016 TestLocalDatabaseManagerPrivate() 0017 : WebEngineViewer::LocalDataBaseManagerPrivate() 0018 { 0019 } 0020 0021 protected: 0022 void downloadDataBase(const QString &clientState) override 0023 { 0024 // don't actually download anything 0025 } 0026 }; 0027 0028 class TestLocalDataBaseManager : public WebEngineViewer::LocalDataBaseManager 0029 { 0030 public: 0031 TestLocalDataBaseManager(QObject *parent) 0032 : WebEngineViewer::LocalDataBaseManager(new TestLocalDatabaseManagerPrivate, parent) 0033 { 0034 } 0035 0036 ~TestLocalDataBaseManager() override 0037 { 0038 delete d; 0039 } 0040 0041 void setDownloadInfoSendByServer(const QString &data) 0042 { 0043 mDownloadInfoSendByServer = data; 0044 } 0045 0046 private: 0047 QString mDownloadInfoSendByServer; 0048 }; 0049 0050 LocalDataBaseManagerTest::LocalDataBaseManagerTest(QObject *parent) 0051 : QObject(parent) 0052 { 0053 } 0054 0055 LocalDataBaseManagerTest::~LocalDataBaseManagerTest() = default; 0056 0057 QTEST_GUILESS_MAIN(LocalDataBaseManagerTest) 0058 0059 #include "moc_localdatabasemanagertest.cpp"