mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-06 06:03:23 +01:00
Tidy up AlbumCoverFetcherTest.
This commit is contained in:
parent
7b520ab361
commit
3734f23325
@ -9,8 +9,10 @@
|
|||||||
#include "mock_networkaccessmanager.h"
|
#include "mock_networkaccessmanager.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
int argc = 1;
|
namespace {
|
||||||
char* argv[] = { "test", 0 };
|
|
||||||
|
static int argc = 1;
|
||||||
|
static const char* argv[] = { "test", 0 };
|
||||||
|
|
||||||
class AlbumCoverFetcherTest : public ::testing::Test {
|
class AlbumCoverFetcherTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
@ -34,8 +36,8 @@ class AlbumCoverFetcherTest : public ::testing::Test {
|
|||||||
|
|
||||||
|
|
||||||
TEST_F(AlbumCoverFetcherTest, FetchesAlbumCover) {
|
TEST_F(AlbumCoverFetcherTest, FetchesAlbumCover) {
|
||||||
const char* data = "<lfm status=\"ok\"><album><name>Bar</name><artist>Foo</artist>"
|
QByteArray data("<lfm status=\"ok\"><album><name>Bar</name><artist>Foo</artist>"
|
||||||
"<image size=\"large\">http://example.com/image.jpg</image></album></lfm>";
|
"<image size=\"large\">http://example.com/image.jpg</image></album></lfm>");
|
||||||
|
|
||||||
QMap<QString, QString> params;
|
QMap<QString, QString> params;
|
||||||
params["artist"] = "Foo";
|
params["artist"] = "Foo";
|
||||||
@ -51,10 +53,12 @@ TEST_F(AlbumCoverFetcherTest, FetchesAlbumCover) {
|
|||||||
fetcher.FetchAlbumCover("Foo", "Bar");
|
fetcher.FetchAlbumCover("Foo", "Bar");
|
||||||
|
|
||||||
get_info_reply->Done();
|
get_info_reply->Done();
|
||||||
app_.processEvents(QEventLoop::AllEvents);
|
app_.processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
album_reply->Done();
|
album_reply->Done();
|
||||||
app_.processEvents(QEventLoop::AllEvents);
|
app_.processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
EXPECT_EQ(1, spy.count());
|
EXPECT_EQ(1, spy.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user