uifw/AvKon/tsrc/bc/bctestdom5.0/bctestdomaiwakn/src/bctestdomaknctrlcase.cpp
changeset 0 2f259fa3e83a
child 22 75713bee6484
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2007 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:  test case
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <coecntrl.h>
       
    20 #include <aknenv.h> 
       
    21 #include <aknconsts.h>
       
    22 #include <bctestdomaiwakn.rsg>
       
    23 #include <ecom.h>
       
    24 #include <finditemmenu.rsg>
       
    25 #include <aknjavalists.h>       // for testing APIs in aknjavalists.h
       
    26 #include <akninputblock.h>      // for testing APIs in AknInputBlock.h
       
    27 #include <aknindicator.h>       // for testing APIs in aknindicator.h    
       
    28 #include <aknindicatorplugin.h> // for testing APIs in aknindicatorplugin.h
       
    29 #include <aknindicatorpluginimpluids.hrh>
       
    30 #include <aknincallbubblenotify.h>      
       
    31 #include <aknfilefilterfactory.h> 
       
    32 #include <aknglobalpopupprioritycontroller.h> 
       
    33 #include <aknappgrid.h> // for testing APIs in aknappgrid.h
       
    34 
       
    35 
       
    36 #include "bctestdomaknctrlcase.h" 
       
    37 #include "bctestdomaiwakncontainer.h" 
       
    38 #include "bctestdomaiwakn.hrh"
       
    39 #include "bctestdomaiwaknview.h"
       
    40 #include "bctestdomaknanimview.h"  // for testing APIs in aknanimview.h
       
    41 #include "bctestdomaknindicatorcontainer.h" 
       
    42 #include "bctestdomakncharmap.h" // for testing APIs in akncharmap.h
       
    43 #include "bctestdomaknbatterypane.h" 
       
    44 #include "bctestdomaknanimdata.h" 
       
    45 
       
    46 
       
    47 // ======== MEMBER FUNCTIONS ========
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // Symbian 2nd static Constructor
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 CBCTestDomAknCtrlCase* CBCTestDomAknCtrlCase::NewL( 
       
    54     CBCTestDomAiwAknContainer*  aContainer )
       
    55     {
       
    56     CBCTestDomAknCtrlCase* self = new( ELeave ) CBCTestDomAknCtrlCase( 
       
    57         aContainer );
       
    58     CleanupStack::PushL( self );
       
    59     self->ConstructL();
       
    60     CleanupStack::Pop( self );
       
    61     return self;
       
    62     }
       
    63     
       
    64 // ---------------------------------------------------------------------------
       
    65 // C++ default constructor
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 CBCTestDomAknCtrlCase::CBCTestDomAknCtrlCase( 
       
    69     CBCTestDomAiwAknContainer* aContainer )
       
    70     : iContainer( aContainer )
       
    71     {    
       
    72     }
       
    73     
       
    74 // ---------------------------------------------------------------------------
       
    75 // Destructor
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 CBCTestDomAknCtrlCase::~CBCTestDomAknCtrlCase()
       
    79     {  
       
    80     }
       
    81     
       
    82 // ---------------------------------------------------------------------------
       
    83 // Symbian 2nd Constructor
       
    84 // ---------------------------------------------------------------------------
       
    85 //
       
    86 void CBCTestDomAknCtrlCase::ConstructL()
       
    87     { 
       
    88     BuildScriptL();
       
    89     }
       
    90     
       
    91 // ---------------------------------------------------------------------------
       
    92 // CBCTestDomAknCtrlCase::BuildScriptL
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 void CBCTestDomAknCtrlCase::BuildScriptL()
       
    96     { 
       
    97     // Add script as your need.   
       
    98     AddTestL( DELAY(1), 
       
    99               //  EBCTestDomCmdOutline3
       
   100               LeftCBA,REP( Down, 2 ), LeftCBA,
       
   101               
       
   102               TEND );    
       
   103     
       
   104     }
       
   105     
       
   106 // ---------------------------------------------------------------------------
       
   107 // CBCTestDomAknCtrlCase::RunL
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 void CBCTestDomAknCtrlCase::RunL( TInt aCmd )
       
   111     {
       
   112     if ( aCmd != EBCTestDomCmdOutline3 )
       
   113         {
       
   114         return;
       
   115         }        
       
   116 
       
   117     switch ( aCmd )  
       
   118         {
       
   119         case EBCTestDomCmdOutline3:    
       
   120             {   
       
   121             // test Ctrl classes         
       
   122             TestAknBattery();//Ctrl 
       
   123             TestAknCharMap(); //Ctrl  
       
   124              
       
   125             TestAknFileFilterFactory(); //Not Ctrl  
       
   126                           
       
   127             TestAknGlobalPopupPriorityController(); // Not Ctrl                 
       
   128             TestAknIncallBubbleNotify();//Not Ctrl            
       
   129             TestAknIndicator();  //Ctrl           
       
   130             TestAknInputBlock();  //Ctrl     
       
   131                     
       
   132             TestListBox(); ////Ctrl ,skip 1 API   
       
   133             }
       
   134             break;                                            
       
   135         default:            
       
   136             break;
       
   137         }
       
   138     }
       
   139 
       
   140 // ---------------------------------------------------------------------------
       
   141 // From class MEikMenuObserver.
       
   142 // ---------------------------------------------------------------------------
       
   143 //
       
   144 void CBCTestDomAknCtrlCase::ProcessCommandL(TInt /*aCommandId*/) 
       
   145     {    
       
   146     }
       
   147     
       
   148 // ---------------------------------------------------------------------------
       
   149 // From class MEikMenuObserver.
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 void CBCTestDomAknCtrlCase::SetEmphasis(
       
   153     CCoeControl* /*aMenuControl*/,
       
   154     TBool /*aEmphasis*/)
       
   155     {    
       
   156     }    
       
   157      
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // CBCTestDomAknCtrlCase::TestAknBattery()
       
   161 // Indirectly test APIs in aknbattery.h through bctestdomaknbatterypane.h
       
   162 // Test Result: OK,SKIP 1 private API which can NOT be test.
       
   163 //           
       
   164 // ---------------------------------------------------------------------------
       
   165 //      
       
   166 void CBCTestDomAknCtrlCase::TestAknBattery()
       
   167     {
       
   168     CBCTestDomAknBatteryPane*  batteryPane = 
       
   169         new( ELeave ) CBCTestDomAknBatteryPane();
       
   170     CleanupStack::PushL( batteryPane );
       
   171     _LIT( 
       
   172         KCAknBatteryPane, 
       
   173         "CAknBatteryPane() test" );
       
   174     AssertNotNullL( batteryPane,  KCAknBatteryPane);      
       
   175     
       
   176     batteryPane->SetContainerWindowL( *iContainer );
       
   177     
       
   178 
       
   179     TResourceReader resourceReader;
       
   180     CCoeEnv::Static()->CreateResourceReaderLC( 
       
   181         resourceReader, 
       
   182         R_BCTESTDOMAIWAKN_AKNBATTERY_BATTERY_PANE );
       
   183     batteryPane->ConstructFromResourceL(resourceReader);  
       
   184     CleanupStack::PopAndDestroy(); // resourceReader
       
   185     _LIT( 
       
   186         KCAknBatteryPaneConstructL, 
       
   187         "CAknBatteryPane::ConstructL() test" );
       
   188     AssertTrueL( ETrue,  KCAknBatteryPaneConstructL );     
       
   189     _LIT( 
       
   190         KCAknBatteryPaneConstructFromResourceL, 
       
   191         "CAknBatteryPane::ConstructFromResourceL() test" );
       
   192     AssertTrueL( ETrue,  KCAknBatteryPaneConstructFromResourceL );     
       
   193     
       
   194     
       
   195     
       
   196     batteryPane->SetBatteryLevel( 0 ); 
       
   197     _LIT( 
       
   198         KCAknBatteryPaneSetBatteryLevel, 
       
   199         "CAknBatteryPane::SetBatteryLevel() test" );
       
   200     AssertTrueL( ETrue,  KCAknBatteryPaneSetBatteryLevel );     
       
   201         
       
   202     TRect  listboxRect( 0,0,20,20 );    
       
   203     batteryPane->SetRect( listboxRect );
       
   204     _LIT( 
       
   205         KCAknBatteryPaneSizeChanged, 
       
   206         "CAknBatteryPane::SizeChanged() test" );
       
   207     AssertTrueL( ETrue,  KCAknBatteryPaneSizeChanged ); 
       
   208     
       
   209     TPoint  newPosition( 1,1 );
       
   210     batteryPane->SetPosition( newPosition );
       
   211     _LIT( 
       
   212         KCAknBatteryPanePositionChanged, 
       
   213         "CAknBatteryPane::PositionChanged() test" );
       
   214     AssertTrueL( ETrue,  KCAknBatteryPanePositionChanged ); 
       
   215     
       
   216     batteryPane->HandleResourceChange( KEikColorResourceChange ); 
       
   217     _LIT( 
       
   218         KCAknBatteryPaneHandleResourceChange, 
       
   219         "CAknBatteryPane::HandleResourceChange() test" );
       
   220     AssertTrueL( ETrue,  KCAknBatteryPaneHandleResourceChange ); 
       
   221     
       
   222     batteryPane->CountComponentControls(); 
       
   223     _LIT( 
       
   224         KCAknBatteryPaneCountComponentControls, 
       
   225         "CAknBatteryPane::CountComponentControls() test" );
       
   226     AssertTrueL( ETrue,  KCAknBatteryPaneCountComponentControls ); 
       
   227 
       
   228     batteryPane->ComponentControl( 0 ) ; 
       
   229     _LIT( 
       
   230         KCAknBatteryPaneComponentControl, 
       
   231         "CAknBatteryPane::ComponentControl() test" );
       
   232     AssertTrueL( ETrue,  KCAknBatteryPaneComponentControl ); 
       
   233     
       
   234     batteryPane->DrawDeferred( ) ;
       
   235     _LIT( 
       
   236         KCAknBatteryPaneDraw, 
       
   237         "CAknBatteryPane::Draw() test" );
       
   238     AssertTrueL( ETrue,  KCAknBatteryPaneDraw ); 
       
   239     
       
   240     
       
   241 
       
   242     CleanupStack::PopAndDestroy( batteryPane );           
       
   243     _LIT( 
       
   244         KDelCAknBatteryPane, 
       
   245         "~CAknBatteryPane() test" );
       
   246     AssertTrueL( ETrue,  KDelCAknBatteryPane );     
       
   247     
       
   248     }
       
   249          
       
   250 // ---------------------------------------------------------------------------
       
   251 // CBCTestDomAknCtrlCase::TestAknCharMap()
       
   252 // test APIs in AknCharMap.h
       
   253 // Test Result: OK
       
   254 //              
       
   255 // ---------------------------------------------------------------------------
       
   256 //        
       
   257 void   CBCTestDomAknCtrlCase::TestAknCharMap()
       
   258     {   
       
   259     CBCTestDomCAknCharMap*  charMap = 
       
   260         new( ELeave ) CBCTestDomCAknCharMap();// create CAknCharMap
       
   261     CleanupStack::PushL( charMap ) ;       
       
   262     _LIT( 
       
   263         KCAknCharMap, 
       
   264         "CAknCharMap() test" );
       
   265     AssertNotNullL( charMap,  KCAknCharMap);             
       
   266     
       
   267     RWindow* window = (RWindow*)iContainer->DrawableWindow();
       
   268     charMap->SetContainerWindowL( *window ); 
       
   269     charMap->ConstructMenuSctRowFromDialogL( 
       
   270         R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG );
       
   271     _LIT( 
       
   272         KConstructMenuSctRowFromDialogL, 
       
   273         "CAknCharMap::ConstructMenuSctRowFromDialogL() test" );
       
   274     AssertTrueL( ETrue,  KConstructMenuSctRowFromDialogL );         
       
   275         
       
   276     charMap->SetCharacterCaseL( EAknSCTUpperCase  );
       
   277     _LIT( 
       
   278         KCAknCharMapSetCharacterCaseL, 
       
   279         "CAknCharMap::SetCharacterCaseL() test" );
       
   280     AssertTrueL( ETrue,  KCAknCharMapSetCharacterCaseL );         
       
   281         
       
   282     TBuf<4> specialChars;
       
   283     charMap->SetBuffer( specialChars );
       
   284     _LIT( 
       
   285         KCAknCharMapSetBuffer, 
       
   286         "CAknCharMap::SetBuffer() test" );
       
   287     AssertTrueL( ETrue,  KCAknCharMapSetBuffer );         
       
   288     
       
   289      
       
   290     const TRect menuSctRect( 0, 0, 200, 200 );    
       
   291     charMap->SetMenuSctRect( menuSctRect );
       
   292     _LIT( 
       
   293         KCAknCharMapSetMenuSctRect, 
       
   294         "CAknCharMap::SetMenuSctRect() test" );
       
   295     AssertTrueL( ETrue,  KCAknCharMapSetMenuSctRect ); 
       
   296       
       
   297     charMap->HeightInRows();
       
   298      _LIT( 
       
   299         KCAknCharMapHeightInRows, 
       
   300         "CAknCharMap::HeightInRows() test" );
       
   301     AssertTrueL( ETrue,  KCAknCharMapHeightInRows );         
       
   302  
       
   303     charMap->MinimumSize();
       
   304     _LIT( 
       
   305         KCAknCharMapMinimumSize, 
       
   306         "CAknCharMap::MinimumSize() test" );
       
   307     AssertTrueL( ETrue,  KCAknCharMapMinimumSize );         
       
   308      
       
   309     TKeyEvent keyEvent;
       
   310     keyEvent.iCode = '5' ;
       
   311     charMap->OfferKeyEventL( keyEvent, EEventNull );
       
   312     _LIT( 
       
   313         KCAknCharMapOfferKeyEventL, 
       
   314         "CAknCharMap::OfferKeyEventL() test" );
       
   315     AssertTrueL( ETrue,  KCAknCharMapOfferKeyEventL );         
       
   316      
       
   317     
       
   318     charMap->InputCapabilities();
       
   319     _LIT( 
       
   320         KCAknCharMapInputCapabilities, 
       
   321         "CAknCharMap::InputCapabilities() test" );
       
   322     AssertTrueL( ETrue,  KCAknCharMapInputCapabilities );         
       
   323     
       
   324     charMap->ActivateL();
       
   325     _LIT( 
       
   326         KCAknCharMapActivateL, 
       
   327         "CAknCharMap::ActivateL() test" );
       
   328     AssertTrueL( ETrue,  KCAknCharMapActivateL );         
       
   329      
       
   330     charMap->SizeChanged();
       
   331     _LIT( 
       
   332         KCAknCharMapSizeChanged, 
       
   333         "CAknCharMap::SizeChanged() test" );
       
   334     AssertTrueL( ETrue,  KCAknCharMapSizeChanged );         
       
   335      
       
   336     
       
   337     charMap->HandleResourceChange( KAknsMessageSkinChange );
       
   338     _LIT( 
       
   339         KCAknCharMapHandleResourceChange, 
       
   340         "CAknCharMap::HandleResourceChange() test" );
       
   341     AssertTrueL( ETrue,  KCAknCharMapHandleResourceChange );         
       
   342      
       
   343     charMap->CountComponentControls();  
       
   344     _LIT( 
       
   345         KCAknCharMapCountComponentControls, 
       
   346         "CAknCharMap::CountComponentControls() test" );
       
   347     AssertTrueL( ETrue,  KCAknCharMapCountComponentControls );         
       
   348       
       
   349     const TInt controlIndex = 0;
       
   350     charMap->ComponentControl( controlIndex  );
       
   351     _LIT( 
       
   352         KCAknCharMapComponentControl, 
       
   353         "CAknCharMap::ComponentControl() test" );
       
   354     AssertTrueL( ETrue,  KCAknCharMapComponentControl );         
       
   355 
       
   356     TPointerEvent pointerEvent;
       
   357     pointerEvent.iType  = TPointerEvent::EButton1Up ;
       
   358     charMap->HandlePointerEventL( pointerEvent );
       
   359     _LIT( 
       
   360         KCAknCharMapHandlePointerEventL, 
       
   361         "CAknCharMap::HandlePointerEventL() test" );
       
   362     AssertTrueL( ETrue,  KCAknCharMapHandlePointerEventL );         
       
   363 
       
   364     charMap->SetObserver( NULL );  
       
   365     _LIT( 
       
   366         KCAknCharMapSetObserver, 
       
   367         "CAknCharMap::SetObserver() test" );
       
   368     AssertTrueL( ETrue,  KCAknCharMapSetObserver );         
       
   369 
       
   370     charMap->HighlightSctRow( EFalse );
       
   371     _LIT( 
       
   372         KCAknCharMapHighlightSctRow, 
       
   373         "CAknCharMap::HighlightSctRow() test" );
       
   374     AssertTrueL( ETrue,  KCAknCharMapHighlightSctRow );     
       
   375     
       
   376     CleanupStack::PopAndDestroy( charMap ); // delete charMap
       
   377     _LIT(KDelCAknCharMap, 
       
   378         "~CAknCharMap() test" );
       
   379     AssertTrueL( ETrue,  KDelCAknCharMap ); 
       
   380     
       
   381     
       
   382     charMap = new( ELeave ) CBCTestDomCAknCharMap();
       
   383     CleanupStack::PushL( charMap ); 
       
   384     window = (RWindow*)iContainer->DrawableWindow();
       
   385     charMap->SetContainerWindowL( *window );                 
       
   386     TResourceReader resourceReader;
       
   387     CCoeEnv::Static()->CreateResourceReaderLC( 
       
   388         resourceReader, //
       
   389         R_AVKON_MENU_SCT_ROW_DEFAULT_CONTENTS_CHINESE ); 
       
   390      charMap->ConstructFromResourceL( resourceReader ); 
       
   391     CleanupStack::PopAndDestroy(); // resourceReader       
       
   392     _LIT( 
       
   393         KAnimDataConstructFromResourceL, 
       
   394         "CAknCharMap::ConstructFromResourceL() test" );
       
   395     AssertTrueL( ETrue,  KAnimDataConstructFromResourceL );         
       
   396     CleanupStack::PopAndDestroy( charMap ); // delete charMap, 2nd time
       
   397 
       
   398 
       
   399     charMap = new( ELeave ) CBCTestDomCAknCharMap();
       
   400     CleanupStack::PushL( charMap );
       
   401     window = (RWindow*)iContainer->DrawableWindow();
       
   402     charMap->SetContainerWindowL( *window );          
       
   403     charMap->ConstructMenuSctRowL( 
       
   404         R_AVKON_MENU_SCT_ROW_DEFAULT_CONTENTS_CHINESE );
       
   405     _LIT( 
       
   406         KConstructMenuSctRowLResourceId, 
       
   407         "CAknCharMap::ConstructMenuSctRowL(aResourceId) test" );
       
   408     AssertTrueL( ETrue,  KConstructMenuSctRowLResourceId );         
       
   409     CleanupStack::PopAndDestroy( charMap ); // delete charMap, 2rd time
       
   410    
       
   411    
       
   412     charMap = new( ELeave ) CBCTestDomCAknCharMap();
       
   413     CleanupStack::PushL( charMap );
       
   414     window = (RWindow*)iContainer->DrawableWindow();
       
   415     charMap->SetContainerWindowL( *window );          
       
   416     charMap->ConstructMenuSctRowL();      
       
   417     _LIT( 
       
   418         KConstructMenuSctRowL, 
       
   419         "CAknCharMap::ConstructMenuSctRowL() test" );
       
   420     AssertTrueL( ETrue,  KConstructMenuSctRowL );         
       
   421     CleanupStack::PopAndDestroy( charMap ); 
       
   422   
       
   423     }
       
   424     
       
   425 // ---------------------------------------------------------------------------
       
   426 // CBCTestDomAknCtrlCase::TestAknFileFilterFactory()
       
   427 // test APIs in AknFileFilterFactory.h 
       
   428 // Test Result: OK
       
   429 //           
       
   430 // ---------------------------------------------------------------------------
       
   431 //   
       
   432 void CBCTestDomAknCtrlCase::TestAknFileFilterFactory()
       
   433     {
       
   434     TResourceReader reader;
       
   435     CCoeEnv::Static()->CreateResourceReaderLC( 
       
   436         reader, 
       
   437         R_BCTESTDOMAIWAKN_AKNFILEFILTERFACTORY_FILTER );// RESOURCE  FILTER 
       
   438     AknFileFilterFactory::CreateFilterLC( reader ); //static function 
       
   439     _LIT( KCreateFilterLC, "CreateFilterLC() test" );
       
   440     AssertTrueL( ETrue,  KCreateFilterLC );     
       
   441  
       
   442     CleanupStack::PopAndDestroy(2); // reader and Filter
       
   443     }
       
   444        
       
   445 // ---------------------------------------------------------------------------
       
   446 // CBCTestDomAknCtrlCase::TestAknGlobalPopupPriorityController()
       
   447 // test static APIs in aknglobalpopupprioritycontroller.h ..
       
   448 // Test Result: OK
       
   449 //           
       
   450 // ---------------------------------------------------------------------------
       
   451 //   
       
   452 void CBCTestDomAknCtrlCase::TestAknGlobalPopupPriorityController()
       
   453     {
       
   454     AknGlobalPopupPriorityController::EnablePriorityControlL();
       
   455     _LIT( 
       
   456         KEnablePriorityControlL, 
       
   457         "EnablePriorityControlL() test" );
       
   458     AssertTrueL( ETrue,  KEnablePriorityControlL ); 
       
   459     
       
   460 
       
   461     RWindowGroup & rootWinGroup = CCoeEnv::Static()->RootWin() ;       
       
   462     TInt ordinalPosition = rootWinGroup.OrdinalPosition();
       
   463     AknGlobalPopupPriorityController::SetRootWinOrdinalPosition( 
       
   464         ordinalPosition );
       
   465     _LIT( 
       
   466         KSetRootWinOrdinalPosition, 
       
   467         "SetRootWinOrdinalPosition() test" );
       
   468     AssertTrueL( ETrue,  KSetRootWinOrdinalPosition );   
       
   469     
       
   470       
       
   471     AknGlobalPopupPriorityController::SetPopupPriorityL( *iContainer, 0);
       
   472     _LIT( 
       
   473         KSetPopupPriorityL, 
       
   474         "SetPopupPriorityL() test" );
       
   475     AssertTrueL( ETrue,  KSetPopupPriorityL );      
       
   476     
       
   477     
       
   478     AknGlobalPopupPriorityController::RemovePopupPriority( *iContainer );
       
   479     _LIT( 
       
   480         KRemovePopupPriority, 
       
   481         "RemovePopupPriority() test" );
       
   482     AssertTrueL( ETrue,  KRemovePopupPriority );      
       
   483     
       
   484     }
       
   485     
       
   486 // ---------------------------------------------------------------------------
       
   487 // CBCTestDomAknCtrlCase::TestAknIncallBubbleNotify()
       
   488 // test APIs in   AknIncallBubbleNotify.h                            
       
   489 // ---------------------------------------------------------------------------
       
   490 //  
       
   491 void CBCTestDomAknCtrlCase::TestAknIncallBubbleNotify()
       
   492     {    
       
   493     CAknIncallBubble*  incallBubble = CAknIncallBubble::NewL();
       
   494     CleanupStack::PushL( incallBubble );
       
   495     _LIT( KlBubbleNewL, "CAknIncallBubble::NewL() test" );
       
   496     AssertNotNullL( incallBubble, KlBubbleNewL );     
       
   497     
       
   498     
       
   499     CleanupStack::PopAndDestroy( incallBubble );   
       
   500     _LIT( 
       
   501         KDestructor, 
       
   502         "~CAknIncallBubble() test" );
       
   503     AssertTrueL( ETrue, KDestructor );          
       
   504     
       
   505     
       
   506     incallBubble = CAknIncallBubble::NewLC();
       
   507     _LIT( 
       
   508         KlBubbleNewLC, 
       
   509         "CAknIncallBubble::NewLC() test" );
       
   510     AssertNotNullL( incallBubble, KlBubbleNewLC );     
       
   511     
       
   512     
       
   513     TInt bubbleflags = -1;
       
   514     incallBubble->SetIncallBubbleFlagsL( bubbleflags );
       
   515     _LIT( 
       
   516         KSetIncallBubbleFlagsL, 
       
   517         "CAknIncallBubble::SetIncallBubbleFlagsL() test" );
       
   518     AssertTrueL( ETrue,  KSetIncallBubbleFlagsL );     
       
   519     
       
   520     
       
   521     incallBubble->SetIncallBubbleAllowedInIdleL( EFalse );
       
   522     _LIT( 
       
   523         KSetIncallBubbleAllowedInIdleL, 
       
   524         "CAknIncallBubble::SetIncallBubbleFlagsL() test" );
       
   525     AssertTrueL( ETrue,  KSetIncallBubbleAllowedInIdleL );      
       
   526     
       
   527     
       
   528     incallBubble->SetIncallBubbleAllowedInUsualL( EFalse );
       
   529      _LIT( 
       
   530         KSetIncallBubbleAllowedInUsualL, 
       
   531         "CAknIncallBubble::SetIncallBubbleFlagsL() test" );
       
   532     AssertTrueL( ETrue,  KSetIncallBubbleAllowedInUsualL );  
       
   533     
       
   534     CleanupStack::PopAndDestroy( incallBubble ); 
       
   535     }
       
   536 
       
   537 // ---------------------------------------------------------------------------
       
   538 // CBCTestDomAknCtrlCase::TestAknIndicator()
       
   539 // test APIs in aknindicator.h and  aknindicatorplugin.h    
       
   540 // test Result: OK.                         
       
   541 // ---------------------------------------------------------------------------
       
   542 //  
       
   543 void CBCTestDomAknCtrlCase::TestAknIndicator()
       
   544     {
       
   545     // test APIs in aknindicator.h
       
   546     // test Result: OK.   
       
   547     CBCTestDomAknIndicatorContainer* indicatorPane = 
       
   548         CBCTestDomAknIndicatorContainer::NewLC();
       
   549     
       
   550     TInt ctrlIndex = 0;
       
   551     CCoeControl* indicatorControl = 
       
   552         indicatorPane->ComponentControl( ctrlIndex );    
       
   553     CAknIndicator*  aknIndicator = 
       
   554         static_cast<CAknIndicator*> ( indicatorControl ); 
       
   555            
       
   556     if( aknIndicator )
       
   557         {
       
   558         TInt bitmapIndex = 0;
       
   559         TInt maskIndex = 0 ;
       
   560         CAknIndicator::GetBitmapIndexL( 0, 0, 
       
   561             bitmapIndex, maskIndex );
       
   562         _LIT( 
       
   563             KGetBitmapIndexL, 
       
   564             "CAknIndicator::GetBitmapIndexL() test" );
       
   565         AssertTrueL( ETrue,  KGetBitmapIndexL );          
       
   566         
       
   567         aknIndicator->SetIndicatorObserver( NULL );
       
   568         _LIT( 
       
   569             KSetIndicatorObserver, 
       
   570             "CAknIndicator::SetIndicatorObserver() test" );
       
   571         AssertTrueL( ETrue,  KSetIndicatorObserver );     
       
   572         
       
   573         TPointerEvent  pointerEvent ;
       
   574         pointerEvent.iType = TPointerEvent::EMove;
       
   575         aknIndicator->HandlePointerEventL( pointerEvent );
       
   576         _LIT( 
       
   577             KHandlePointerEventL, 
       
   578             "CAknIndicator::HandlePointerEventL() test" );
       
   579         AssertTrueL( ETrue,  KHandlePointerEventL );
       
   580         
       
   581         aknIndicator->PositionChanged();
       
   582         _LIT( 
       
   583             KAknIndicatorPositionChanged, 
       
   584             "CAknIndicator::PositionChanged() test" );
       
   585         AssertTrueL( ETrue,  KAknIndicatorPositionChanged );    
       
   586             
       
   587         }
       
   588 
       
   589 
       
   590     CleanupStack::PopAndDestroy( indicatorPane );    
       
   591    
       
   592     TUid pluginUid = TUid::Uid( KImplUIDPoCIndicatorsPlugin );//
       
   593     CAknIndicatorPlugin* aknIndicatorPlugin = NULL;
       
   594     TRAPD(err, 
       
   595         aknIndicatorPlugin =
       
   596         CAknIndicatorPlugin::NewL( pluginUid )
       
   597         );    
       
   598     CleanupStack::PushL( aknIndicatorPlugin );
       
   599     _LIT( KPluginNewL, "CAknIndicatorPlugin::NewL() test" );     
       
   600     AssertIntL( err, err, KPluginNewL );
       
   601     
       
   602     if( aknIndicatorPlugin )
       
   603         {
       
   604         TInt textType = 0;
       
   605         aknIndicatorPlugin->TextL( 0, textType );
       
   606         _LIT( KTextL, "CAknIndicatorPlugin::TextL()  test" );
       
   607         AssertTrueL( ETrue, KTextL );   
       
   608         
       
   609         aknIndicatorPlugin->IconL( 0 );
       
   610         _LIT( KIconL, "CAknIndicatorPlugin::IconL()  test" );
       
   611         AssertTrueL( ETrue, KIconL );   
       
   612         
       
   613         aknIndicatorPlugin->UpdateL( 0 );
       
   614         _LIT( KUpdateL, "CAknIndicatorPlugin::UpdateL()  test" );
       
   615         AssertTrueL( ETrue, KUpdateL );          
       
   616         }
       
   617     
       
   618     
       
   619     CleanupStack::Pop( aknIndicatorPlugin );   
       
   620     delete aknIndicatorPlugin;
       
   621     _LIT( KDestructor, "~CAknIndicatorPlugin() test" );
       
   622     AssertTrueL( ETrue, KDestructor );              
       
   623     
       
   624     REComSession::FinalClose(); 
       
   625     }
       
   626     
       
   627 // ---------------------------------------------------------------------------
       
   628 // CBCTestDomAknCtrlCase::TestAknInputBlock()
       
   629 // test APIs in AknInputBlock.h     
       
   630 // test Result: OK.  
       
   631 // ---------------------------------------------------------------------------
       
   632 //  
       
   633 void CBCTestDomAknCtrlCase::TestAknInputBlock()
       
   634     {
       
   635     
       
   636     CAknInputBlock* aknInputBlock = CAknInputBlock::NewLC();
       
   637     _LIT( KNewLC, "CAknInputBlock::NewLC() test" );
       
   638     AssertNotNullL( aknInputBlock, KNewLC ); 
       
   639     
       
   640     
       
   641     CleanupStack::PopAndDestroy( aknInputBlock ); 
       
   642     _LIT( KDestructor, "~CAknInputBlock() test" );
       
   643     AssertTrueL( ETrue, KDestructor ); 
       
   644     
       
   645     aknInputBlock = CAknInputBlock::NewCancelHandlerLC( NULL );
       
   646     _LIT( KNewCancelHandlerLC, "CAknInputBlock::NewCancelHandlerLC() test" );
       
   647     AssertNotNullL( aknInputBlock, KNewCancelHandlerLC ); 
       
   648     CleanupStack::PopAndDestroy( aknInputBlock ); 
       
   649     
       
   650     aknInputBlock = CAknInputBlock::NewCancelActiveLC( NULL );
       
   651     _LIT( KNewCancelActiveLC, "CAknInputBlock::NewCancelActiveLC() test" );
       
   652     AssertNotNullL( aknInputBlock, KNewCancelActiveLC ); 
       
   653     CleanupStack::PopAndDestroy( aknInputBlock ); 
       
   654     
       
   655     aknInputBlock = CAknInputBlock::NewCancelDeleteLC( NULL );
       
   656     _LIT( KNewCancelDeleteLC, "CAknInputBlock::NewCancelDeleteLC() test" );
       
   657     AssertNotNullL( aknInputBlock, KNewCancelDeleteLC ); 
       
   658     
       
   659     aknInputBlock->SetCancelHandler( NULL );
       
   660     _LIT( KSetCancelHandler, "CAknInputBlock::SetCancelHandler() test" );
       
   661     AssertTrueL( ETrue,  KSetCancelHandler ); 
       
   662     
       
   663     aknInputBlock->SetCancelActive( NULL );
       
   664     _LIT( KSetCancelActive, "CAknInputBlock::SetCancelActive() test" );
       
   665     AssertTrueL( ETrue,  KSetCancelActive ); 
       
   666     
       
   667     aknInputBlock->SetCancelDelete( NULL );
       
   668     _LIT( KSetCancelDelete, "CAknInputBlock::SetCancelDelete() test" );
       
   669     AssertTrueL( ETrue,  KSetCancelDelete ); 
       
   670     
       
   671     aknInputBlock->Cancel();
       
   672     _LIT( KCancel, "CAknInputBlock::Cancel() test" );
       
   673     AssertTrueL( ETrue,  KCancel ); 
       
   674     
       
   675     CleanupStack::PopAndDestroy( aknInputBlock );     
       
   676     }
       
   677  
       
   678 // ---------------------------------------------------------------------------
       
   679 // CBCTestDomAknCtrlCase::TestListBox()
       
   680 // test APIs in AknJavaLists.h   and aknappgrid.h *  
       
   681 // test Result: APIs in AknJavaLists.h are OK;
       
   682 //              APIs in aknappgrid.h  SKIP 1.                        
       
   683 // ---------------------------------------------------------------------------
       
   684 //          
       
   685 void CBCTestDomAknCtrlCase::TestListBox()  
       
   686     {
       
   687     //test APIs in AknJavaLists.h
       
   688     CAknDouble2GraphicLargeStyleListBox* double2ListBox = 
       
   689         new( ELeave ) CAknDouble2GraphicLargeStyleListBox();
       
   690     CleanupStack::PushL( double2ListBox );
       
   691     _LIT( 
       
   692         KAknDouble2ListBox, 
       
   693         "CAknDouble2GraphicLargeStyleListBox instance created" );
       
   694     AssertNotNullL( double2ListBox, KAknDouble2ListBox );
       
   695    
       
   696       
       
   697     double2ListBox->ConstructL(NULL,EAknListBoxSelectionList);
       
   698     _LIT( KCreateItemDrawerL, "CreateItemDrawerL() test" );
       
   699     AssertTrueL( ETrue, KCreateItemDrawerL ); 
       
   700         
       
   701     TRect  listboxRect( 0,0,20,20 );    
       
   702     double2ListBox->SetRect( listboxRect );
       
   703 
       
   704     double2ListBox->SizeChanged();
       
   705     _LIT( KSizeChanged, "SizeChanged() test" );
       
   706     AssertTrueL( ETrue, KSizeChanged ); 
       
   707      
       
   708     double2ListBox->MinimumSize();
       
   709     _LIT( KMinimumSize, "MinimumSize() test" );
       
   710     AssertTrueL( ETrue, KMinimumSize ); 
       
   711  
       
   712     CleanupStack::PopAndDestroy( double2ListBox ); 
       
   713     
       
   714   
       
   715     CAknSingle2GraphicStyleListBox* single2ListBox = 
       
   716         new( ELeave ) CAknSingle2GraphicStyleListBox() ;  
       
   717     CleanupStack::PushL( single2ListBox );
       
   718     _LIT( 
       
   719         KCAknSingle2GraphicStyleListBox, 
       
   720         "CAknDouble2GraphicLargeStyleListBox instance created" );
       
   721     AssertNotNullL( single2ListBox, KCAknSingle2GraphicStyleListBox );
       
   722 
       
   723     single2ListBox->SetContainerWindowL( *iContainer );   
       
   724     single2ListBox->ConstructL(NULL,EAknListBoxSelectionList);
       
   725     _LIT( 
       
   726         KSingle2ListBoxCreateItemDrawerL, 
       
   727         "CAknSingle2GraphicStyleListBox::CreateItemDrawerL() test" );
       
   728     AssertTrueL( ETrue, KSingle2ListBoxCreateItemDrawerL ); 
       
   729     
       
   730     single2ListBox->SetRect( listboxRect );
       
   731 
       
   732     single2ListBox->SizeChanged();
       
   733     _LIT( KSingle2ListBoxSizeChanged, 
       
   734         "CAknSingle2GraphicStyleListBox::SizeChanged() test" );
       
   735     AssertTrueL( ETrue, KSingle2ListBoxSizeChanged ); 
       
   736     
       
   737     
       
   738     single2ListBox->MinimumSize();
       
   739     _LIT( KSingle2ListBoxMinimumSize, 
       
   740         "CAknSingle2GraphicStyleListBox::MinimumSize() test" );
       
   741     AssertTrueL( ETrue, KSingle2ListBoxMinimumSize );     
       
   742      
       
   743     
       
   744     single2ListBox->UseEmptyIconSpace( EFalse );
       
   745     _LIT( 
       
   746         KSingle2ListBoxUseEmptyIconSpace, 
       
   747         "UseEmptyIconSpace() test" );
       
   748     AssertTrueL( ETrue, KSingle2ListBoxUseEmptyIconSpace ); 
       
   749     
       
   750     CleanupStack::PopAndDestroy( single2ListBox ); 
       
   751     
       
   752     //test APIs in aknappgrid.h    
       
   753     CAknAppStyleGrid* appStyleGrid = 
       
   754         new( ELeave ) CAknAppStyleGrid();//test CAknAppStyleGrid,start  
       
   755     CleanupStack::PushL( appStyleGrid );
       
   756     _LIT( 
       
   757         KCAknAppStyleGrid, 
       
   758         "CAknDouble2GraphicLargeStyleListBox instance created" );
       
   759     AssertNotNullL( appStyleGrid, KCAknAppStyleGrid );
       
   760     
       
   761     appStyleGrid->SetContainerWindowL( *iContainer ); 
       
   762        
       
   763     appStyleGrid->ConstructL( iContainer );
       
   764     _LIT( 
       
   765         KAppStyleGridConstructL, 
       
   766         "CAknAppStyleGrid::ConstructL() test" );
       
   767     AssertTrueL( ETrue, KAppStyleGridConstructL ); 
       
   768  
       
   769     
       
   770     appStyleGrid->SetRect( listboxRect );
       
   771     appStyleGrid->SizeChanged();
       
   772     _LIT( 
       
   773         KAppStyleGridSizeChanged, 
       
   774         "CAknAppStyleGrid::SizeChanged() test" );
       
   775     AssertTrueL( ETrue, KAppStyleGridSizeChanged ); 
       
   776      
       
   777     appStyleGrid->MinimumSize();
       
   778     _LIT( 
       
   779         KAppStyleGridMinimumSize, 
       
   780         "CAknAppStyleGrid::MinimumSize() test" );
       
   781     AssertTrueL( ETrue, KAppStyleGridMinimumSize ); 
       
   782      
       
   783     appStyleGrid->SetShortcutEnabledL( EFalse );
       
   784     _LIT( 
       
   785         KAppStyleGridSetShortcutEnabledL, 
       
   786         "CAknAppStyleGrid::CreateItemDrawerL() test" );
       
   787     AssertTrueL( ETrue, KAppStyleGridSetShortcutEnabledL ); 
       
   788    
       
   789 
       
   790     iContainer->DrawNow();//implicitly test DrawBackgroundAroundGrid(.)
       
   791     _LIT( 
       
   792         KAppStyleGridDrawBackgroundAroundGrid, 
       
   793        "CAknAppStyleGrid::DrawBackgroundAroundGrid() test" );
       
   794     AssertTrueL( ETrue, KAppStyleGridDrawBackgroundAroundGrid ); 
       
   795     
       
   796      
       
   797     CleanupStack::PopAndDestroy( appStyleGrid );   
       
   798     }
       
   799  
       
   800