File indexing completed on 2024-04-28 04:48:14

0001 /****************************************************************************************
0002  * Copyright (c) 2012 Jasneet Singh Bhatti <jazneetbhatti@gmail.com>                    *
0003  * This program is free software; you can redistribute it and/or modify it under        *
0004  * the terms of the GNU General Public License as published by the Free Software        *
0005  * Foundation; either version 2 of the License, or (at your option) any later           *
0006  * version.                                                                             *
0007  *                                                                                      *
0008  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0009  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0010  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0011  *                                                                                      *
0012  * You should have received a copy of the GNU General Public License along with         *
0013  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0014  ****************************************************************************************/
0015 
0016 #ifndef MOCKTRACKFORURLWORKER_H
0017 #define MOCKTRACKFORURLWORKER_H
0018 
0019 #include "core/collections/support/TrackForUrlWorker.h"
0020 
0021 #include <QtTest>
0022 
0023 using namespace Amarok;
0024 
0025 class MockTrackForUrlWorker : public TrackForUrlWorker
0026 {
0027     Q_OBJECT
0028 
0029     public:
0030         MockTrackForUrlWorker(const QUrl &url);
0031         MockTrackForUrlWorker(const QString &url);
0032 
0033         /**
0034          * Mock implementation that fetches the track from QTest data-driven testing
0035          * variable named track and assigns it to m_track
0036          */
0037         void run(ThreadWeaver::JobPointer self = QSharedPointer<ThreadWeaver::Job>(), ThreadWeaver::Thread *thread = nullptr) override;
0038 };
0039 
0040 #endif // MOCKTRACKFORURLWORKER_H