videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h
changeset 15 cf5481c2bc0b
child 17 69946d1824c4
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
       
     1 /**
       
     2 * Copyright (c) 2009 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:   tester for methods in VideoSortFilterProxyModel
       
    15 * 
       
    16 */
       
    17 
       
    18 #ifndef __TESTLISTVIEW_H__
       
    19 #define __TESTLISTVIEW_H__
       
    20 
       
    21 
       
    22 // INCLUDES
       
    23 #include <QtTest/QtTest>
       
    24 #include "hbmessagebox.h"
       
    25 
       
    26 class VideoListView;
       
    27 class VideoSortFilterProxyModel;
       
    28 class VideoCollectionWrapper;
       
    29 class VideoCollectionUiLoader;
       
    30 class VideoListWidget;
       
    31 
       
    32 class TestListView : public QObject
       
    33 {
       
    34     Q_OBJECT
       
    35 
       
    36     /**
       
    37      * Will be called before each testfunction is executed.
       
    38      */
       
    39     void init(bool initTestView = true); 
       
    40      
       
    41     /**
       
    42      * Returns amount of visible menu actions in the video list view.
       
    43      */
       
    44     int visibleMenuActions();
       
    45     
       
    46     /**
       
    47      * Set row count in model.
       
    48      */
       
    49     void setRowCount(int count);
       
    50     
       
    51     // Test functions for the test framework.
       
    52     
       
    53 private slots:
       
    54 
       
    55     /**
       
    56      * Will be called after every testfunction.
       
    57      */
       
    58     void cleanup();
       
    59 
       
    60 	/**
       
    61 	 * Tests creating and deleting the view.
       
    62 	 */
       
    63 	void testCreateDelete();
       
    64 	
       
    65 	/**
       
    66 	 * Tests initializeView.
       
    67 	 */
       
    68 	void testInitializeView();
       
    69 	
       
    70     /**
       
    71 	 * Tests creating menu of the view.
       
    72 	 */
       
    73     void testCreateListMenu();
       
    74     
       
    75     /**
       
    76      * Tests menus.
       
    77      */
       
    78     void testMenus();
       
    79 
       
    80     /**
       
    81      * Tests createAction.
       
    82      */
       
    83     void testCreateAction();
       
    84     
       
    85     /**
       
    86      * Tests activatView.
       
    87      */
       
    88     void testActivateView();
       
    89 
       
    90     /**
       
    91      * Tests deactivateView.
       
    92      */
       
    93     void testDeactivateView();
       
    94 
       
    95     /**
       
    96      * Tests back.
       
    97      */
       
    98     void testBack();
       
    99     
       
   100     /**
       
   101     * Tests modelReadySlot.
       
   102     */
       
   103    void testModelReadySlot();
       
   104 
       
   105     /**
       
   106      * Tests deleteItemsSlot.
       
   107      */
       
   108     void testDeleteItemsSlot();
       
   109 
       
   110     /**
       
   111      * Tests aboutToShowMainMenuSlot.
       
   112      */
       
   113     void testAboutToShowMainMenuSlot();
       
   114     
       
   115     /**
       
   116      * Tests openSortByMenuSlot
       
   117      */
       
   118     void testOpenSortByMenuSlot();
       
   119     
       
   120     /**
       
   121      * Tests handleStatusSlot.
       
   122      */
       
   123     void testHandleStatusSlot();
       
   124 
       
   125     /**
       
   126      * Tests openAllVideosViewSlot.
       
   127      */
       
   128     void testOpenAllVideosViewSlot();
       
   129 
       
   130     /**
       
   131      * Tests openCollectionViewSlot.
       
   132      */
       
   133     void testOpenCollectionViewSlot();
       
   134     
       
   135     /**
       
   136      * Tests openServicesViewSlot.
       
   137      */
       
   138     void testOpenServicesViewSlot();
       
   139     
       
   140     /**
       
   141      * Tests startSortingSlot.
       
   142      */
       
   143     void testStartSortingSlot();
       
   144 
       
   145     /**
       
   146      * Tests view when orientation changes.
       
   147      */
       
   148     void testOrientationSlots();
       
   149     
       
   150     /**
       
   151      * Tests collectionOpenedSlot.
       
   152      */
       
   153     void testCollectionOpenedSlot();
       
   154 
       
   155     /**
       
   156      * Tests updateSubLabel.
       
   157      */
       
   158     void testUpdateSubLabel();
       
   159     
       
   160     /**
       
   161      * Tests showHint
       
   162      */
       
   163     void testShowHint();
       
   164 
       
   165 signals:
       
   166 
       
   167     // Signals needed in tests.
       
   168     void testSignal();
       
   169 
       
   170     void testSignal(int);
       
   171 
       
   172     void testLayoutChangedSignal();
       
   173 
       
   174     void testCollectionOpenedSignal(bool, const QString&);
       
   175 
       
   176     void testStatusSignal(int, QVariant&);
       
   177     
       
   178 private:
       
   179     
       
   180     VideoCollectionUiLoader* mUiLoader;
       
   181     
       
   182     VideoListView* mTestView;
       
   183     
       
   184     VideoListWidget* mListWidget;
       
   185     
       
   186     VideoCollectionWrapper* mWrapper;
       
   187 };
       
   188 
       
   189 
       
   190 #endif  // __TESTCOLLECTIONVIEW_H__
       
   191 
       
   192 // End of file
       
   193