// -----------------------------------------------------------------------------
// CTestSDKCFD::TestEHKEYHotKeyFromCommandId
// -----------------------------------------------------------------------------
//
TInt CTestSDKEIKHKEYT::TestEHKEYHotKeyFromCommandIdL( CStifItemParser& /*aItem*/ )
    {
    CEikHotKeyTable* hotkeytableptr;
    hotkeytableptr = new( ELeave ) CEikHotKeyTable;
    CleanupStack::PushL( hotkeytableptr );

    TInt commandId( KOne );
    TInt keycode( KTwo );
    TInt modifiers( KZero );
    hotkeytableptr->AddItemL( commandId, keycode, modifiers );
    
    TInt commandId2( KTwo );
    TInt keycode2( KThree );
    TInt modifiers2( KZero );
    hotkeytableptr->AddItemL( commandId2, keycode2, modifiers2 );
    
    TInt returnkeycode;
    TInt returnkeycode2;
    TBool flag;
    TBool flag2;
    flag = hotkeytableptr->HotKeyFromCommandId( commandId, returnkeycode,
        modifiers );
    STIF_ASSERT_TRUE( flag );
    flag2 = hotkeytableptr->HotKeyFromCommandId( commandId2, returnkeycode2,
        modifiers2 );
    STIF_ASSERT_TRUE( flag2 );
    STIF_ASSERT_NOT_EQUALS( returnkeycode, returnkeycode2 );
    
    CleanupStack::PopAndDestroy( hotkeytableptr );
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CTestSDKCFD::TestEHKEYConstructFromResourceL
// -----------------------------------------------------------------------------
//
TInt CTestSDKEIKHKEYT::TestEHKEYConstructFromResourceL( CStifItemParser& /*aItem*/ )
    {
    CEikHotKeyTable* hotkeytableptr = new( ELeave ) CEikHotKeyTable;
    CleanupStack::PushL( hotkeytableptr );
    
    hotkeytableptr->ConstructFromResourceL( R_TEST_HOTKEYS );
    
    TResourceReader reader;
    CCoeEnv::Static()->CreateResourceReaderLC(reader,R_TEST_HOTKEYS);
    
    TInt numberPlain( KZero );
    numberPlain = reader.ReadInt16();
    if( numberPlain )
        {
        const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
        reader.Advance(numberPlain*sizeof(SEikHotKey));
        TBool flag(EFalse);
        TInt keycode( KZero );
        TInt commandId( KZero );
        TInt modifires( KZero );
        commandId = ptr->iCommandId;
        flag = hotkeytableptr->HotKeyFromCommandId( commandId, keycode, modifires );
        STIF_ASSERT_TRUE( flag );
        }
    
    TInt numberCtrl( KZero );
    numberCtrl = reader.ReadInt16();
    if( numberCtrl )
        {
        const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
        reader.Advance(numberCtrl*sizeof(SEikHotKey));
        TBool flag(EFalse);
        TInt keycode( KZero );
        TInt commandId( KZero );
        TInt modifires(EModifierCtrl);
        commandId = ptr->iCommandId;
        flag = hotkeytableptr->HotKeyFromCommandId( commandId, keycode, modifires );
        STIF_ASSERT_TRUE( flag );
        }
    
    TInt numberShiftCtrl( KZero );
    numberShiftCtrl = reader.ReadInt16();
    if( numberShiftCtrl )
        {
        const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
        reader.Advance(numberShiftCtrl*sizeof(SEikHotKey));
        TBool flag(EFalse);
        TInt keycode( KZero );
        TInt commandId( KZero );
        TInt modifires(EModifierShift|EModifierCtrl);
        commandId = ptr->iCommandId;
        flag = hotkeytableptr->HotKeyFromCommandId( commandId, keycode, modifires );
        STIF_ASSERT_TRUE( flag );
        }
    
    CleanupStack::PopAndDestroy( KTwo );//reader, hotkeytableptr
    return KErrNone;
    }
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CTestSDKUiFrameDefinitions::TestADGetPhoneIdleViewId
// -----------------------------------------------------------------------------
//
TInt CTestSDKUiFrameDefinitions::TestADGetPhoneIdleViewId( CStifItemParser& /*aItem*/ )
    {
    TVwsViewId viewId;
    
    TInt flag = AknDef::GetPhoneIdleViewId( viewId );
    
    const TInt KAppUid = 0x2001CB80;
    TUid appUid( TUid::Uid( KAppUid ) );
    
    STIF_ASSERT_TRUE( appUid.iUid = viewId.iAppUid.iUid );
    STIF_ASSERT_TRUE( 0 == flag );
    
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// Ctestsdkindicators::TestIndiCntnerCountComponentControls
// -----------------------------------------------------------------------------
//
TInt CTestSDKIndicators::TestIndiCntnerCountComponentControlsL( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( Ktestsdkindicators, "testsdkindicators" );
    _LIT( KTestIndiCntnerCountComponentControls, "In TestIndiCntnerCountComponentControls" );
    TestModuleIf().Printf( 0, Ktestsdkindicators, KTestIndiCntnerCountComponentControls );
    // Print to log file
    iLog->Log( KTestIndiCntnerCountComponentControls );
    
    TInt err = KErrNone;
    
    CTestSDKIndicatorsIndicators* indicatorExt = new (ELeave) CTestSDKIndicatorsIndicators();
    
    CleanupStack::PushL( indicatorExt );
    
    TResourceReader read;
    
    CCoeEnv::Static()->CreateResourceReaderLC( read, R_AVKON_NAVI_PANE_EDITOR_INDICATORS );
    
    indicatorExt->ConstructFromResourceL( read );
    
    TInt count = indicatorExt->CountComponentControls();
    
    CleanupStack::PopAndDestroy( 2 );
    
    STIF_ASSERT_TRUE( (count==0) );
    
    return err;
    }
// -----------------------------------------------------------------------------
// CTestSDKCFD::TestEHKEYRemoveItem
// -----------------------------------------------------------------------------
//
TInt CTestSDKEIKHKEYT::TestEHKEYRemoveItemL( CStifItemParser& /*aItem*/ )
    {
    CEikHotKeyTable* hotkeytableptr = new( ELeave ) CEikHotKeyTable;
    CleanupStack::PushL( hotkeytableptr );

    TInt commandId( KOne );
    TInt keycode( KTwo );
    TInt modifiers( KZero );
    hotkeytableptr->AddItemL( commandId, keycode, modifiers );
    
    TBool flag;
    TInt returnkeycode;
    TInt returncommandId;
    flag = hotkeytableptr->HotKeyFromCommandId( commandId, returnkeycode,
        modifiers );
    returncommandId = hotkeytableptr->CommandIdFromHotKey( keycode, modifiers );
    
    STIF_ASSERT_TRUE( flag );
    STIF_ASSERT_EQUALS( keycode, returnkeycode );
    STIF_ASSERT_EQUALS( commandId, returncommandId );
    
    hotkeytableptr->RemoveItem( commandId );
    returnkeycode = 0;
    
    flag = hotkeytableptr->HotKeyFromCommandId( commandId, returnkeycode,
        modifiers );
    returncommandId = hotkeytableptr->CommandIdFromHotKey( keycode, modifiers );
    STIF_ASSERT_FALSE( flag );
    STIF_ASSERT_NOT_EQUALS( keycode, returnkeycode );
    STIF_ASSERT_NOT_EQUALS( commandId, returncommandId );
    CleanupStack::PopAndDestroy( hotkeytableptr );
    
    return KErrNone;
    }
Ejemplo n.º 6
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestIIDSetParentIIDL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestIIDSetParentIIDL( CStifItemParser& /*aItem*/ )
    {
    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    TAknsItemID itemID;
    itemData->SetParentIID( itemID );
    STIF_ASSERT_TRUE( itemID.iMajor == itemData->ParentIID().iMajor );
    STIF_ASSERT_TRUE( itemID.iMinor == itemData->ParentIID().iMinor );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestSDKQueries::TestQVNumberCreateEditorL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestQVNumberCreateEditorL( CStifItemParser& /*aItem*/ )
    {
    CAknQueryValueNumber* number = CAknQueryValueNumber::NewLC();
    
    CArrayFix<TInt>* mArray = new( ELeave ) CArrayFixFlat<TInt>( 2 );
    CleanupStack::PushL( mArray );
    
    mArray->AppendL( KNumber1 );
    mArray->AppendL( KNumber2 );
    
    CAknQueryValueNumberArray* numberArray = 
        CAknQueryValueNumberArray::NewL( R_TESTQUERY_NUMBER_FORMAT );
    CleanupStack::PushL( numberArray );
    
    numberArray->SetArray( *mArray );
    
    number->SetArrayL( numberArray );
    
    number->SetCurrentValueIndex( KZero );
    
    TBool flag = number->CreateEditorL();
    STIF_ASSERT_TRUE( flag );
    
    CleanupStack::Pop( KTwo );
    CleanupStack::PopAndDestroy( number );
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CTestSDKQueries::TestPhoneCreateEditorL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestPhoneCreateEditorL( CStifItemParser& /*aItem*/ )
    {
    CAknQueryValuePhone* valuePhone = CAknQueryValuePhone::NewLC();
    STIF_ASSERT_NOT_NULL( valuePhone );
    
    CAknQueryValuePhoneArray* array = CAknQueryValuePhoneArray::NewLC();
    STIF_ASSERT_NOT_NULL( array );
    
    CDesCArray* textArray = new (ELeave) CDesCArrayFlat( 1 );
    CleanupStack::PushL( textArray );
    _LIT( KValue, "123456" );
    textArray->AppendL( KValue );
    
    array->SetArray( *textArray );
    valuePhone->SetArrayL( array );
    
    valuePhone->SetCurrentValueIndex( 0 );
    
    TBool flag = valuePhone->CreateEditorL();
    STIF_ASSERT_TRUE( flag );
    
    CleanupStack::PopAndDestroy( textArray );
    CleanupStack::PopAndDestroy( array );
    CleanupStack::PopAndDestroy( valuePhone );
    
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CTestSDKQueries::TestQVSetQueryModeL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestQVDCreateEditorL( CStifItemParser& /*aItem*/ )
    {
    CAknQueryValueDate* date = CAknQueryValueDate::NewL();
    CleanupStack::PushL( date );
    
    CAknQueryValueDateArray* dateArray = CAknQueryValueDateArray::NewL( R_TESTQUERY_DATE_FORMAT );
    CleanupStack::PushL( dateArray );
    
    CArrayFix<TTime>* timeArray = new( ELeave ) CArrayFixFlat<TTime>( 4 );
    CleanupStack::PushL( timeArray );
    
    TTime time1;
    time1.HomeTime();
    TTime time2;
    time2 = time1 + TTimeIntervalDays( 3 );
    
    timeArray->AppendL( time1 );
    timeArray->AppendL( time2 );
    
    dateArray->SetArray( *timeArray );
    
    date->SetArrayL( dateArray );

    date->SetCurrentValueIndex( KZero );
    
    TBool flag = date->CreateEditorL();
    STIF_ASSERT_TRUE( flag );
    
    CleanupStack::Pop( KTwo );
    CleanupStack::PopAndDestroy( date );
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CTestDOMFindUtil::TestIsWordValidForMatchingL
// -----------------------------------------------------------------------------
//
TInt CTestDOMFindUtil::TestIsWordValidForMatchingL(
        CStifItemParser& aItem )
    {

    // Print to UI
    _LIT( KTestDOMFindUtil, "testdomfindutil" );
    _LIT( KTestIsWordValidForMatching, "In IsWordValidForMatching" );
    TestModuleIf().Printf( 0, KTestDOMFindUtil, KTestIsWordValidForMatching );
    // Print to log file
    iLog->Log( KTestIsWordValidForMatching );

    CFindUtil* util = CFindUtil::NewL();
    CleanupStack::PushL( util );
    MFindUtil* findUtil = util->Interface();

    TPtrC word;
    aItem.GetNextString( word );

    TBool result = findUtil->IsWordValidForMatching( word );
    STIF_ASSERT_TRUE( result );

    CleanupStack::PopAndDestroy( util );
    return KErrNone;

    }
// -----------------------------------------------------------------------------
// CTestSDKHierarchicalLists::TestHLSCLIsThirdColumnEnabledL
// -----------------------------------------------------------------------------
TInt CTestSDKHierarchicalLists::TestHLSCLIsThirdColumnEnabledL( CStifItemParser& /*aItem*/ )
    {
    CTestControl* control = CTestControl::NewL();
    CleanupStack::PushL( control );
    STIF_ASSERT_NOT_NULL( control );
    
    CAknSingleColumnStyleTreeList* treeList = CAknSingleColumnStyleTreeList::NewLC( *control );
    STIF_ASSERT_NOT_NULL( treeList );
    
    _LIT( KFirstColumn, "FirstColumn" );
    _LIT( KSecondColumn, "SecondColumn" );
    _LIT( KThirdColumn, "ThirdColumn" );
    
    TUint32 flags = CAknSingleColumnStyleTreeList::EPersistent;
    TAknTreeItemID id = treeList->AddCoreDataRowL( KAknTreeIIDRoot, KFirstColumn, KSecondColumn, KThirdColumn, flags, ETrue );
    STIF_ASSERT_NOT_EQUALS( 0, id );
    
    treeList->EnableThirdColumn( id, ETrue, ETrue );
    STIF_ASSERT_TRUE( treeList->IsThirdColumnEnabled( id ) );
    
    CleanupStack::PopAndDestroy( treeList );
    CleanupStack::PopAndDestroy( control );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestPlatAlfVisual::TestRealPointMethods
// -----------------------------------------------------------------------------
//
TInt CTestPlatAlfVisual::TestRealPointMethods( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
    _LIT( KTestRealPointMethods, "TestRealPointMethods" );
    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRealPointMethods );
    // Print to log file
    iLog->Log( KTestRealPointMethods );
    
    TAlfRealPoint realPoint1( 1.0, 2.0 );
    TAlfRealPoint realPoint2( 0.0, 1.0 );
    
    TPoint point;
    point += realPoint1;
    
    realPoint1.AsSize();
    
    TAlfRealPoint realPoint3 = realPoint1 - realPoint2;
    TAlfRealPoint realPoint4 = realPoint2 + realPoint3;
    realPoint4 += realPoint3;
    realPoint4 -= realPoint3;
    TBool value = realPoint1 == realPoint4;
    STIF_ASSERT_TRUE( value );
    
    return KErrNone;
    }
Ejemplo n.º 13
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestEQIDSetRefItemL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestEQIDSetRefItemL( CStifItemParser& /*aItem*/ )
    {
    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    TAknsItemID itemID( KAknsIIDQsnCpScrollBgTop );
    itemData->SetRefItem( itemID );
    TAknsItemID itemIDGet = itemData->RefItem();
    STIF_ASSERT_TRUE( itemID.iMajor == itemID.iMajor );
    STIF_ASSERT_TRUE( itemID.iMinor == itemID.iMinor );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
// ============================ MEMBER FUNCTIONS ===============================
// =========================== CLASS CEikCoCtlLibrary===========================
// -----------------------------------------------------------------------------
// CTestSDKInitialization::TestCLResourceFile
// -----------------------------------------------------------------------------
TInt CTestSDKInitialization::TestCLResourceFile( CStifItemParser& /*aItem*/ )
    {
    TFileName fileName = CEikCtlLibrary::ResourceFile();
    _LIT(KFileName,"z:\\resource\\eikctl.rsc");
    STIF_ASSERT_TRUE( 0 == fileName.Compare( KFileName ) );
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestSDKNotes::TestNPICEikProgressInfoSinfoL
// -----------------------------------------------------------------------------
TInt CTestSDKNotes::TestNPICEikProgressInfoSinfoL( CStifItemParser& /*aItem*/ )
    {
    CEikProgressInfo::SInfo sInfo;
    CEikProgressInfo* progress = new (ELeave) CEikProgressInfo( sInfo );
    CleanupStack::PushL( progress );
    STIF_ASSERT_NOT_NULL( progress );
    
    CEikProgressInfo::SInfo sInfoGet = progress->Info();
    STIF_ASSERT_TRUE( sInfo.iFinalValue == sInfoGet.iFinalValue );
    STIF_ASSERT_TRUE( sInfo.iHeight == sInfoGet.iHeight );
    STIF_ASSERT_TRUE( sInfo.iSplitsInBlock == sInfoGet.iSplitsInBlock );
    STIF_ASSERT_TRUE( sInfo.iTextType == sInfoGet.iTextType );
    STIF_ASSERT_TRUE( sInfo.iWidth == sInfoGet.iWidth );

    CleanupStack::PopAndDestroy( progress );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestSDKGrids::TestGridsGridmIndexContainsDataL
// -----------------------------------------------------------------------------
//
TInt CTestSDKGrids::TestGridsGridmIndexContainsDataL( CStifItemParser& /*aItem*/ )
    {
    CAknGridM* grid = new( ELeave ) CAknGridM;
    CleanupStack::PushL( grid );

    CDesCArrayFlat* arr = new(ELeave)CDesCArrayFlat(KSize);
    CleanupStack::PushL( arr );

    HBufC* buf1 = KTom().AllocLC();
    HBufC* buf2 = KJack().AllocLC();
    HBufC* buf3 = KMary().AllocLC();

    arr->AppendL(*buf1);
    arr->AppendL(*buf2);
    arr->AppendL(*buf3);

    grid->SetItemTextArray( arr );

    TBool flag = grid->IndexContainsData( KThree );
    STIF_ASSERT_FALSE( flag );

    flag = grid->IndexContainsData( KSix );
    STIF_ASSERT_FALSE( flag );

    grid->SetStartCells( KThree );
    flag = grid->IndexContainsData( KSix );
    STIF_ASSERT_FALSE( flag );

    flag = grid->IndexContainsData( KThree );
    STIF_ASSERT_TRUE( flag );

    flag = grid->IndexContainsData( KFour );
    STIF_ASSERT_TRUE( flag );

    CleanupStack::PopAndDestroy( buf3 );
    CleanupStack::PopAndDestroy( buf2 );
    CleanupStack::PopAndDestroy( buf1 );
    CleanupStack::Pop( arr );
    CleanupStack::PopAndDestroy( grid );
    return KErrNone;
    }
Ejemplo n.º 17
0
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestIDTypeL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestIDTypeL( CStifItemParser& /*aItem*/ )
    {
    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    TAknsItemType typeGet = itemData->Type();
    STIF_ASSERT_TRUE( typeGet == EAknsITBitmap );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
Ejemplo n.º 18
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestBAIDSetFlashL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestBAIDSetFlashL( CStifItemParser& /*aItem*/ )
    {
    CAknsBmpAnimItemData* itemData = CAknsBmpAnimItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    itemData->SetFlash( ETrue );
    STIF_ASSERT_TRUE( itemData->Flash() );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestSDKQueries::TestPhoneValueL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestPhoneValueL( CStifItemParser& /*aItem*/ )
    {
    CAknQueryValuePhone* valuePhone = CAknQueryValuePhone::NewLC();
    STIF_ASSERT_NOT_NULL( valuePhone );
    
    HBufC* value = valuePhone->Value();
    CleanupStack::PushL( value );
    STIF_ASSERT_TRUE( value->Length() == 0 );
    
    CleanupStack::Pop( value );
    CleanupStack::PopAndDestroy( valuePhone );
    
    return KErrNone;
    }
Ejemplo n.º 20
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestECSetEffectUidL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestECSetEffectUidL( CStifItemParser& /*aItem*/ )
    {
    CAknsEffectCommand* itemData = CAknsEffectCommand::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    TUid uid = TUid::Uid( 0 );
    itemData->SetEffectUid( uid );
    STIF_ASSERT_TRUE( uid == itemData->EffectUid() );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
Ejemplo n.º 21
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestEQIDSetOutputLayerModeL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestEQIDSetOutputLayerModeL( CStifItemParser& /*aItem*/ )
    {
    CAknsEffectQueueItemData* itemData = CAknsEffectQueueItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    itemData->SetOutputLayerMode( 1 );
    TInt outputLayerModeGet = itemData->OutputLayerMode();
    STIF_ASSERT_TRUE( 1 == outputLayerModeGet );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestSDKNotes::TestNPIConstructFromResourceL
// -----------------------------------------------------------------------------
TInt CTestSDKNotes::TestNPIConstructFromResourceL( CStifItemParser& /*aItem*/ )
    {
    CEikProgressInfo* progress = new (ELeave) CEikProgressInfo;
    CleanupStack::PushL( progress );
    STIF_ASSERT_NOT_NULL( progress );
    
    TResourceReader reader;
    CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TESTSDK_NOTESPROGI );
    progress->ConstructFromResourceL( reader );
    
    CEikProgressInfo::SInfo sInfoGet = progress->Info();
    const TInt KFinalValue = 200;
    const TInt KWidth = 120;
    STIF_ASSERT_TRUE( sInfoGet.iFinalValue == KFinalValue );
    STIF_ASSERT_TRUE( sInfoGet.iHeight == KLength );
    STIF_ASSERT_TRUE( sInfoGet.iSplitsInBlock == 0 );
    STIF_ASSERT_TRUE( sInfoGet.iTextType == 0 );
    STIF_ASSERT_TRUE( sInfoGet.iWidth == KWidth );
    
    CleanupStack::PopAndDestroy( 2 );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestSDKserverApplication::TestASHandleAllClientsClosedL
// -----------------------------------------------------------------------------
//
TInt CTestSDKserverApplication::TestASHandleAllClientsClosedL( CStifItemParser& /*aItem*/ )
    {
    CAknAppServer* server = new (ELeave) CAknAppServer;
    CleanupStack::PushL( server );
    STIF_ASSERT_NOT_NULL( server );
    
    _LIT( KName, "server" );
    server->ConstructL( KName );
    
    CTestSDKAppServiceBase* observer = new (ELeave) CTestSDKAppServiceBase;
    CleanupStack::PushL( observer );
    STIF_ASSERT_NOT_NULL( observer );
    
    CDocumentHandler* documentHandler = CDocumentHandler::NewLC( CEikonEnv::Static()->Process() );
    STIF_ASSERT_NOT_NULL( documentHandler );
    documentHandler->SetExitObserver( observer );
    
    _LIT( KFile, "\\system\\apps\\testdocumenthandler.txt" );
    _LIT8( KContext, "Content Text" );
    const TInt KLength = 50;
    TBuf8<KLength> context( KContext );
    
    RFs& fs = CEikonEnv::Static()->FsSession();
    
    RFile file;
    CleanupClosePushL( file );
    STIF_ASSERT_NOT_NULL( &file );
    
    TDataType dataType;
    if( file.Open( fs, KFile, EFileWrite | EFileShareAny ) != KErrNone )
        {
        file.Create( fs, KFile, EFileWrite | EFileShareAny );
        }
    
    file.Write( context );
    TInt flag = documentHandler->OpenFileL( file, dataType );
    STIF_ASSERT_TRUE( flag == KErrNone );
    
    server->HandleAllClientsClosed();
    
    CleanupStack::PopAndDestroy( &file );
    CleanupStack::PopAndDestroy( documentHandler );
    CleanupStack::PopAndDestroy( observer );
    CleanupStack::PopAndDestroy( server );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// CTestDOMStatusPane::TestSgccLayoutConfigBuf
// -----------------------------------------------------------------------------
//
TInt CTestDOMStatusPane::TestSgccLayoutConfigBuf( CStifItemParser& /*aItem*/ )
    {

    // Print to UI
    _LIT( KTestDOMStatusPane, "testdomstatuspane" );
    _LIT( KTestSgccLayoutConfigBuf, "In SgccLayoutConfigBuf" );
    TestModuleIf().Printf( 0, KTestDOMStatusPane, KTestSgccLayoutConfigBuf );
    // Print to log file
    iLog->Log( KTestSgccLayoutConfigBuf );

    TBuf8<KBufSize> configBuf = CAknSgcClient::LayoutConfigBuf();
    STIF_ASSERT_TRUE( 0 == configBuf.Length() );

    return KErrNone;

    }
// -----------------------------------------------------------------------------
// CTestPlatAlfVisual::TestTxtMgrImagePathL
// -----------------------------------------------------------------------------
//
TInt CTestPlatAlfVisual::TestTxtMgrImagePathL( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
    _LIT( KTestTxtMgrImagePathL, "TestTxtMgrImagePathL" );
    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrImagePathL );
    // Print to log file
    iLog->Log( KTestTxtMgrImagePathL );
    
    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
    txtMgr->SetImagePathL( KEmptyImagePath );
    const TDesC& path = txtMgr->ImagePath();
    STIF_ASSERT_TRUE( path == KEmptyImagePath );
    
    return KErrNone;
    }
Ejemplo n.º 26
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestITIDNumberOfImagesL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestITIDNumberOfImagesL( CStifItemParser& /*aItem*/ )
    {
    CAknsImageTableItemData* itemData = CAknsImageTableItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );

    TAknsItemID itemID;
    itemData->SetImagesL( 1, &itemID );
    TInt num = itemData->NumberOfImages();
    STIF_ASSERT_TRUE( 1 == num );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
Ejemplo n.º 27
0
// -----------------------------------------------------------------------------
// CTestSDKForm::TestFPostLayoutDynInitL
// -----------------------------------------------------------------------------
TInt CTestSDKForm::TestFPostLayoutDynInitL( CStifItemParser& /*aItem*/ )
    {
    CTestSDKFormControl* form = new (ELeave) CTestSDKFormControl;
    CleanupStack::PushL( form );
    STIF_ASSERT_NOT_NULL( form );
    
    form->ConstructL();
    form->PrepareLC( R_TESTSDK_FORM_DIALOG );
    CleanupStack::Pop( form );
    
    form->PostLayoutDynInitL();
    STIF_ASSERT_TRUE( form->IsEditable() );
    CleanupStack::PopAndDestroy( form );
    
    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsIsMifFileL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsIsMifFileL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsismiffilel, "In TestAknIconUtilsIsMifFileL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsismiffilel);
    iLog->Log(Ktestakniconutilsismiffilel);

    TFileName file( KMifFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );

    TBool isMif = AknIconUtils::IsMifFile( file );
    
    STIF_ASSERT_TRUE( isMif );

    return KErrNone;
    }
Ejemplo n.º 29
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestSIDSetStringL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestSIDSetStringL( CStifItemParser& /*aItem*/ )
    {
    CAknsStringItemData* itemData = CAknsStringItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    _LIT( KString, "string" );
    TBuf<KLength> string( KString );
    itemData->SetStringL( string );
    TBuf<KLength> stringGet = itemData->String();
    STIF_ASSERT_TRUE( 0 == stringGet.Compare( string ) );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
Ejemplo n.º 30
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestIIDSetDrawRectL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestIIDSetDrawRectL( CStifItemParser& /*aItem*/ )
    {
    CAknsBitmapItemData* itemData = CAknsBitmapItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    TPoint pointTL( 0, 0 );
    TPoint pointBR( KLength, KLength );
    TRect rect( pointTL, pointBR );
    itemData->SetDrawRect( rect );
    STIF_ASSERT_TRUE( rect == itemData->DrawRect() );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }