1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef T_RADIOHSWIDGET_H_ |
|
20 #define T_RADIOHSWIDGET_H_ |
|
21 |
|
22 |
|
23 // System includes |
|
24 #include <QtTest/QtTest> |
|
25 |
|
26 // User includes |
|
27 #include "radiohswidget.h" |
|
28 #include "radiohswidgetprofilereader.h" |
|
29 #include "radiohswidgetradioserviceclient.h" |
|
30 |
|
31 /*! |
|
32 \struct SendInfo |
|
33 \brief Helper to store send information on unit tests. |
|
34 */ |
|
35 struct SendInfo { |
|
36 /*! Stores the type of information send. */ |
|
37 int informationType; |
|
38 /*! Stores the information to send. */ |
|
39 QVariant information; |
|
40 /*! Stores the actual data of information send. */ |
|
41 QVariant data; |
|
42 }; |
|
43 |
|
44 |
|
45 class TestRadioHsWidget : public QObject |
|
46 { |
|
47 Q_OBJECT |
|
48 |
|
49 public: |
|
50 |
|
51 TestRadioHsWidget(); |
|
52 ~TestRadioHsWidget(); |
|
53 |
|
54 public slots: |
|
55 |
|
56 private slots: |
|
57 // test framework called slots |
|
58 void initTestCase(); |
|
59 void init(); |
|
60 void cleanup(); |
|
61 void cleanupTestCase(); |
|
62 void offlineModeTest(); |
|
63 void validReplies(); |
|
64 void invalidReplies(); |
|
65 |
|
66 private: |
|
67 void createSendInfo(int informationType, const QVariant information); |
|
68 void verifyReceivedInformation(int informationType, |
|
69 const QVariant &receivedInformation, const QVariant &sendInformation); |
|
70 |
|
71 private: // Data |
|
72 /*! Stores RadioHsWidget stub. */ |
|
73 QScopedPointer<RadioHsWidget> mRadioHsWidgetStub; |
|
74 /*! Stores RadioHsWidgetProfileReader. */ |
|
75 QScopedPointer<RadioHsWidgetProfileReader> mProfileReader; |
|
76 /*! Stores RadioHsWidgetRadioServiceClient. */ |
|
77 QScopedPointer<RadioHsWidgetRadioServiceClient> mServiceClient; |
|
78 |
|
79 /*! Stores refresh request mock. */ |
|
80 //XQAiwRequest *application_manager_mock_refresh_request; |
|
81 |
|
82 /*! Stores send information. */ |
|
83 QList<SendInfo> mSendInfos; |
|
84 }; |
|
85 |
|
86 #endif /* T_RADIOHSWIDGET_H_ */ |
|