cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.h
changeset 20 9c97ad6591ae
child 27 489cf6208544
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
       
     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 * Control Panel WLAN AP plugin unit testing.
       
    16 */
       
    17 
       
    18 #include <QStringList>
       
    19 #include <QtTest/QtTest>
       
    20 #include <cmmanagerdefines_shim.h>
       
    21 
       
    22 class HbDialog;
       
    23 class HbMainWindow;
       
    24 class HbAutoTestMainWindow;
       
    25 class HbDataFormModelItem;
       
    26 class HbAction;
       
    27 class CpWlanApView;
       
    28 class CpBearerApPluginInterface;
       
    29 
       
    30 enum NetworkStatus {
       
    31     HiddenStatus,
       
    32     PublicStatus
       
    33 };
       
    34 
       
    35 class TestCpWlanApPlugin : public QObject
       
    36 {
       
    37     Q_OBJECT
       
    38 
       
    39     signals:
       
    40         // Test signals
       
    41         void menuActionTriggered(HbAction *);
       
    42     
       
    43     public slots:
       
    44         // Test framework functions
       
    45         void initTestCase();
       
    46         void cleanupTestCase();
       
    47         void init();
       
    48         void cleanup();
       
    49 
       
    50     private slots:
       
    51         // Test cases
       
    52         void tcChangeConnectionName();
       
    53         void tcChangeConnectionName_data();
       
    54         void tcConnectionNameEmpty();
       
    55         void tcChangeWlanNetworkName();
       
    56         void tcChangeWlanNetworkName_data();
       
    57         void tcWlanNetworkNameEmpty();
       
    58         void tcChangeNetworkStatus();
       
    59         void tcChangeNetworkMode();
       
    60         void tcChangeSecurityMode();
       
    61         void tcChangeHomepage();
       
    62         void tcChangeHomepage_data();
       
    63         void tcAdvancedSettings();
       
    64 
       
    65     private:
       
    66         // Sub test cases
       
    67         void subVerifyString(
       
    68             CMManagerShim::ConnectionMethodAttribute attribute,
       
    69             HbDataFormModelItem *item,
       
    70             QString expected);
       
    71         void subVerifyUint(
       
    72             CMManagerShim::ConnectionMethodAttribute attribute,
       
    73             uint expected);
       
    74         void subVerifyNetworkStatus(
       
    75             NetworkStatus expected);
       
    76         void subClearLineEdit(uint length);
       
    77         void subCreateSettingsView(uint connetionMethodId);
       
    78         void subClickWidget(const QString &name);
       
    79 
       
    80     private:
       
    81         // Code references
       
    82         CpWlanApView *mTestView;
       
    83         
       
    84         // Test data
       
    85         HbAutoTestMainWindow *mMainWindow;
       
    86         CpBearerApPluginInterface *mPlugin;
       
    87 };