qtmobility/tests/auto/testqgeopositioninfosource_p.h
changeset 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef TESTQGEOPOSITIONINFOSOURCE_P_H
       
    43 #define TESTQGEOPOSITIONINFOSOURCE_P_H
       
    44 
       
    45 #include <qmobilityglobal.h>
       
    46 #include <QTest>
       
    47 #include <QObject>
       
    48 
       
    49 QTM_BEGIN_NAMESPACE
       
    50 class QGeoPositionInfoSource;
       
    51 QTM_END_NAMESPACE
       
    52 
       
    53 QTM_USE_NAMESPACE
       
    54 class TestQGeoPositionInfoSource : public QObject
       
    55 {
       
    56     Q_OBJECT
       
    57 
       
    58 public:
       
    59     TestQGeoPositionInfoSource(QObject *parent = 0);
       
    60 
       
    61     static TestQGeoPositionInfoSource *createDefaultSourceTest();
       
    62 
       
    63 public slots:
       
    64     void test_slot1();
       
    65     void test_slot2();
       
    66 
       
    67 protected:
       
    68     virtual QGeoPositionInfoSource *createTestSource() = 0;
       
    69 
       
    70     // MUST be called by subclasses if they override respective test slots
       
    71     void base_initTestCase();
       
    72     void base_init();
       
    73     void base_cleanup();
       
    74     void base_cleanupTestCase();
       
    75 
       
    76 private slots:
       
    77     void initTestCase();
       
    78     void init();
       
    79     void cleanup();
       
    80     void cleanupTestCase();
       
    81 
       
    82     void constructor_withParent();
       
    83 
       
    84     void constructor_noParent();
       
    85 
       
    86     void updateInterval();
       
    87 
       
    88     void setPreferredPositioningMethods();
       
    89     void setPreferredPositioningMethods_data();
       
    90 
       
    91     void preferredPositioningMethods();
       
    92 
       
    93     void createDefaultSource();
       
    94 
       
    95     void setUpdateInterval();
       
    96     void setUpdateInterval_data();
       
    97 
       
    98     void lastKnownPosition();
       
    99     void lastKnownPosition_data();
       
   100 
       
   101     void minimumUpdateInterval();
       
   102 
       
   103     void startUpdates_testIntervals();
       
   104     void startUpdates_testIntervalChangesWhileRunning();
       
   105     void startUpdates_testDefaultInterval();
       
   106     void startUpdates_testZeroInterval();
       
   107     void startUpdates_moreThanOnce();
       
   108 
       
   109     void stopUpdates();
       
   110     void stopUpdates_withoutStart();
       
   111 
       
   112     void requestUpdate();
       
   113     void requestUpdate_data();
       
   114 
       
   115     void requestUpdate_validTimeout();
       
   116     void requestUpdate_defaultTimeout();
       
   117     void requestUpdate_timeoutLessThanMinimumInterval();
       
   118     void requestUpdate_repeatedCalls();
       
   119     void requestUpdate_overlappingCalls();
       
   120 
       
   121     void requestUpdateAfterStartUpdates_ZeroInterval();
       
   122     void requestUpdateAfterStartUpdates_SmallInterval();
       
   123     void requestUpdateBeforeStartUpdates_ZeroInterval();
       
   124     void requestUpdateBeforeStartUpdates_SmallInterval();
       
   125 
       
   126     void removeSlotForRequestTimeout();
       
   127     void removeSlotForPositionUpdated();
       
   128 
       
   129 private:
       
   130     QGeoPositionInfoSource *m_source;
       
   131     bool m_testingDefaultSource;
       
   132     bool m_testSlot2Called;
       
   133 };
       
   134 
       
   135 
       
   136 #endif