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