1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 03:27:40 +01:00

Fix album cover manager test

This commit is contained in:
David Sansome 2010-10-16 18:21:28 +00:00
parent 37f5c07f45
commit 47004d0ac3
5 changed files with 10 additions and 10 deletions

View File

@ -26,9 +26,9 @@
const int AlbumCoverFetcher::kMaxConcurrentRequests = 5;
AlbumCoverFetcher::AlbumCoverFetcher(QObject* parent)
AlbumCoverFetcher::AlbumCoverFetcher(QObject* parent, QNetworkAccessManager* network)
: QObject(parent),
network_(new NetworkAccessManager(this)),
network_(network ? network : new NetworkAccessManager(this)),
next_id_(0),
request_starter_(new QTimer(this))
{

View File

@ -34,7 +34,7 @@ class AlbumCoverFetcher : public QObject {
Q_OBJECT
public:
AlbumCoverFetcher(QObject* parent = 0);
AlbumCoverFetcher(QObject* parent = 0, QNetworkAccessManager* network = 0);
virtual ~AlbumCoverFetcher() {}
struct SearchResult {

View File

@ -41,13 +41,14 @@
const char* AlbumCoverManager::kSettingsGroup = "CoverManager";
AlbumCoverManager::AlbumCoverManager(LibraryBackend* backend, QWidget *parent)
AlbumCoverManager::AlbumCoverManager(LibraryBackend* backend, QWidget* parent,
QNetworkAccessManager* network)
: QMainWindow(parent),
constructed_(false),
ui_(new Ui_CoverManager),
backend_(backend),
cover_loader_(new BackgroundThreadImplementation<AlbumCoverLoader, AlbumCoverLoader>(this)),
cover_fetcher_(new AlbumCoverFetcher(this)),
cover_fetcher_(new AlbumCoverFetcher(this, network)),
cover_searcher_(new AlbumCoverSearcher(this)),
artist_icon_(IconLoader::Load("x-clementine-artist")),
all_artists_icon_(IconLoader::Load("x-clementine-album")),

View File

@ -34,12 +34,14 @@ class Ui_CoverManager;
class QListWidgetItem;
class QMenu;
class QNetworkAccessManager;
class QProgressBar;
class AlbumCoverManager : public QMainWindow {
Q_OBJECT
public:
AlbumCoverManager(LibraryBackend* backend, QWidget *parent = 0);
AlbumCoverManager(LibraryBackend* backend, QWidget *parent = 0,
QNetworkAccessManager* network = 0);
~AlbumCoverManager();
static const char* kSettingsGroup;

View File

@ -14,7 +14,6 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "core/networkaccessmanager.h"
#include "ui/albumcovermanager.h"
#include "gtest/gtest.h"
@ -26,12 +25,10 @@
class AlbumCoverManagerTest : public ::testing::Test {
protected:
AlbumCoverManagerTest()
: network_(NULL, &mock_network_),
manager_(&network_, NULL) {
: manager_(NULL, NULL, &mock_network_) {
}
MockNetworkAccessManager mock_network_;
NetworkAccessManager network_;
AlbumCoverManager manager_;
};