1 | /* |
2 | * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com> |
3 | * |
4 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
5 | */ |
6 | |
7 | #ifndef MEDIAPLAYERTEST_H |
8 | #define MEDIAPLAYERTEST_H |
9 | |
10 | #include <QList> |
11 | #include <QObject> |
12 | |
13 | #include "bluezdevice1_tst.h" |
14 | #include "bluezmediaplayer1_tst.h" |
15 | #include "dbusproperties_tst.h" |
16 | |
17 | #include "device.h" |
18 | #include "manager.h" |
19 | #include "mediaplayer.h" |
20 | |
21 | class MediaPlayerTest : public QObject |
22 | { |
23 | Q_OBJECT |
24 | |
25 | public: |
26 | explicit MediaPlayerTest(); |
27 | |
28 | private Q_SLOTS: |
29 | void initTestCase(); |
30 | void cleanupTestCase(); |
31 | |
32 | void connectTest(); |
33 | void disconnectTest(); |
34 | void connectProfileTest(); |
35 | |
36 | void getPropertiesTest(); |
37 | void setEqualizerTest(); |
38 | void setRepeatTest(); |
39 | void setShuffleTest(); |
40 | void changeStatusTest(); |
41 | void changeTrackTest(); |
42 | |
43 | void disconnectProfileTest(); |
44 | |
45 | void bug403289(); |
46 | |
47 | private: |
48 | QString equalizerString(const BluezQt::MediaPlayerPtr &mediaPlayer) const; |
49 | QString repeatString(const BluezQt::MediaPlayerPtr &mediaPlayer) const; |
50 | QString shuffleString(const BluezQt::MediaPlayerPtr &mediaPlayer) const; |
51 | QString statusString(const BluezQt::MediaPlayerPtr &mediaPlayer) const; |
52 | QVariantMap trackMap(const BluezQt::MediaPlayerPtr &mediaPlayer) const; |
53 | |
54 | struct MediaPlayerUnit { |
55 | BluezQt::DevicePtr device; |
56 | org::bluez::MediaPlayer1 *dbusMediaPlayer; |
57 | org::freedesktop::DBus::Properties *dbusProperties; |
58 | }; |
59 | |
60 | BluezQt::Manager *m_manager; |
61 | QList<MediaPlayerUnit> m_units; |
62 | }; |
63 | |
64 | #endif // MEDIAPLAYERTEST_H |
65 | |