telutils/dialpad/tsrc/unit/ut_dialpadlineedit/ut_dialpadlineedit.cpp
changeset 53 25b8d29b7c59
equal deleted inserted replaced
51:12bc758d6a02 53:25b8d29b7c59
       
     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 #include <QtGui>
       
    19 #include <QtTest/QtTest>
       
    20 #include <qevent.h>
       
    21 #include "ut_dialpadlineedit.h"
       
    22 #include "testdialpadlineedit.h"
       
    23 #include "phonesrvtestmain.h"
       
    24 
       
    25 
       
    26 UT_dialpadlineedit::UT_dialpadlineedit()
       
    27     : 
       
    28     m_classUt(0)
       
    29 {
       
    30     
       
    31 }
       
    32 
       
    33 
       
    34 UT_dialpadlineedit::~UT_dialpadlineedit()
       
    35 {
       
    36     delete m_classUt;
       
    37 }
       
    38 
       
    39 
       
    40 void UT_dialpadlineedit::init()
       
    41 {
       
    42     initialize();
       
    43     
       
    44     m_classUt = new TestDialpadLineEdit();
       
    45 }
       
    46 
       
    47 
       
    48 void UT_dialpadlineedit::cleanup()
       
    49 {
       
    50     reset();
       
    51     
       
    52     delete m_classUt;
       
    53     m_classUt = 0;
       
    54 }
       
    55 
       
    56 
       
    57 void UT_dialpadlineedit::t_focusOutEvent()
       
    58 {
       
    59     EXPECT(HbWidget, focusOutEvent);
       
    60     EXPECT(HbAbstractEdit, focusOutEvent).times(0);
       
    61     QFocusEvent event(QEvent::FocusOut);
       
    62     m_classUt->testFocusOutEvent(&event);
       
    63     QVERIFY(verify());
       
    64 }
       
    65 
       
    66 
       
    67 void UT_dialpadlineedit::t_focusInEvent()
       
    68 {
       
    69     EXPECT(HbWidget, focusInEvent);
       
    70     EXPECT(HbAbstractEdit, focusInEvent).times(0);
       
    71     QFocusEvent event(QEvent::FocusIn);
       
    72     m_classUt->testFocusInEvent(&event);
       
    73     QVERIFY(verify());
       
    74 }
       
    75 
       
    76 PHONESRV_TEST_MAIN(UT_dialpadlineedit)