classicui_plat/ganes_api/tsrc/src/testplatganeblockshgvgmediawall.cpp
changeset 47 2f0c06423c72
parent 46 0e1e0022bd03
child 53 3c67ea82fafc
equal deleted inserted replaced
46:0e1e0022bd03 47:2f0c06423c72
     1 /*
       
     2 * Copyright (c) 2002 - 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:  ganes_api
       
    15 *
       
    16 */
       
    17 
       
    18 // [INCLUDE FILES]
       
    19 #include "testplatgane.h"
       
    20 
       
    21 
       
    22 
       
    23 _LIT(Kctestplatgane, "CTestPlatGane");
       
    24 const CHgVgMediaWall::THgVgOpeningAnimationType KDefaultSelectionAnimation(
       
    25         CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront);
       
    26 const CHgVgMediaWall::THgVgMediaWallStyle KDefaultStyle(
       
    27         CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen);
       
    28 const TBool KDefaultScrollBarState(ETrue);
       
    29 const TInt KDefaultAmountOfItems(0);
       
    30 const TInt KScrollBufferSize(80);
       
    31 
       
    32 #define START_TEST(TEST_NAME, FUNCTION_NAME) \
       
    33     TInt left = 0; \
       
    34     TInt wrigth = KTest; \
       
    35     TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); \
       
    36     CHgVgMediaWall* temp = CHgVgMediaWall::NewL ( rect, KDefaultAmountOfItems, KDefaultStyle, \
       
    37             KDefaultScrollBarState, NULL, NULL ); \
       
    38     CleanupStack::PushL( temp );
       
    39     
       
    40 #define END_TEST \
       
    41     CleanupStack::PopAndDestroy( temp ); \
       
    42     return KErrNone;
       
    43     
       
    44 // ============================ MEMBER FUNCTIONS =========================
       
    45 
       
    46 // --------------------------------------------------------------------------
       
    47 // CTestPlatGane::TestCHgVgGridNewL
       
    48 // --------------------------------------------------------------------------
       
    49 //
       
    50 TInt CTestPlatGane::TestCHgVgMediaWallNewL ( CStifItemParser&  )
       
    51     {
       
    52     START_TEST(newl, TestCHgVgMediaWallNewL)
       
    53     END_TEST
       
    54     }
       
    55 
       
    56 // --------------------------------------------------------------------------
       
    57 // CTestPlatGane::TestCHgVgMediaWallInitScreenL
       
    58 // --------------------------------------------------------------------------
       
    59 //
       
    60 TInt CTestPlatGane::TestCHgVgMediaWallInitScreenL ( CStifItemParser&  )
       
    61     {
       
    62     START_TEST(initscreenl, TestCHgVgMediaWallInitScreenL)
       
    63     temp->InitScreenL( rect );
       
    64     END_TEST
       
    65     }
       
    66 
       
    67 
       
    68 // --------------------------------------------------------------------------
       
    69 // CTestPlatGane::TestCHgVgMediaWallRefreshScreen
       
    70 // --------------------------------------------------------------------------
       
    71 //
       
    72 TInt CTestPlatGane::TestCHgVgMediaWallRefreshScreen ( CStifItemParser&  )
       
    73     {
       
    74     START_TEST(refreshscreen, TestCHgVgMediaWallRefreshScreen)
       
    75     temp->RefreshScreen(0);
       
    76     END_TEST
       
    77     }
       
    78 
       
    79 // --------------------------------------------------------------------------
       
    80 // CTestPlatGane::TestCHgVgMediaWallFirstIndexOnScreen
       
    81 // --------------------------------------------------------------------------
       
    82 //
       
    83 TInt CTestPlatGane::TestCHgVgMediaWallFirstIndexOnScreen ( CStifItemParser&  )
       
    84     {
       
    85     START_TEST(firstindexonscreen, TestCHgVgMediaWallFirstIndexOnScreen)
       
    86     temp->FirstIndexOnScreen();
       
    87     END_TEST
       
    88     }
       
    89 
       
    90 // --------------------------------------------------------------------------
       
    91 // CTestPlatGane::TestCHgVgMediaWallItemsOnScreen
       
    92 // --------------------------------------------------------------------------
       
    93 //
       
    94 TInt CTestPlatGane::TestCHgVgMediaWallItemsOnScreen ( CStifItemParser&  )
       
    95     {
       
    96     START_TEST(itemsonscreen, TestCHgVgMediaWallItemsOnScreen)
       
    97     temp->ItemsOnScreen();
       
    98     END_TEST
       
    99     }
       
   100 
       
   101 // --------------------------------------------------------------------------
       
   102 // CTestPlatGane::TestCHgVgMediaWallItemL
       
   103 // --------------------------------------------------------------------------
       
   104 //
       
   105 TInt CTestPlatGane::TestCHgVgMediaWallItemL ( CStifItemParser&  )
       
   106     {
       
   107     START_TEST(iteml, TestCHgVgMediaWallItemL)
       
   108     temp->AddItem(CHgVgItem::NewL());
       
   109     temp->ItemL(0);
       
   110     END_TEST
       
   111     }
       
   112 
       
   113 
       
   114 // --------------------------------------------------------------------------
       
   115 // CTestPlatGane::TestCHgVgMediaWallSetItem
       
   116 // --------------------------------------------------------------------------
       
   117 //
       
   118 TInt CTestPlatGane::TestCHgVgMediaWallSetItem ( CStifItemParser&  )
       
   119     {
       
   120     START_TEST(setitem, TestCHgVgMediaWallSetItem)
       
   121     CHgVgItem* newItem = CHgVgItem::NewL();
       
   122     temp->SetItem( newItem, 0 );
       
   123     END_TEST
       
   124     }
       
   125 
       
   126 
       
   127 // --------------------------------------------------------------------------
       
   128 // CTestPlatGane::TestCHgVgMediaWallAddItem
       
   129 // --------------------------------------------------------------------------
       
   130 //
       
   131 TInt CTestPlatGane::TestCHgVgMediaWallAddItem ( CStifItemParser&  )
       
   132     {
       
   133     START_TEST(additem, TestCHgVgMediaWallAddItem)
       
   134     CHgVgItem* newItem = CHgVgItem::NewL();
       
   135     temp->AddItem( newItem );
       
   136     END_TEST
       
   137     }
       
   138 
       
   139 
       
   140 // --------------------------------------------------------------------------
       
   141 // CTestPlatGane::TestCHgVgMediaWallInsertItem
       
   142 // --------------------------------------------------------------------------
       
   143 //
       
   144 TInt CTestPlatGane::TestCHgVgMediaWallInsertItem ( CStifItemParser&  )
       
   145     {
       
   146     START_TEST(insertitem, TestCHgVgMediaWallInsertItem)
       
   147     CHgVgItem* newItem = CHgVgItem::NewL();
       
   148     temp->InsertItem( newItem, 0 );
       
   149     END_TEST
       
   150     }
       
   151 
       
   152 // --------------------------------------------------------------------------
       
   153 // CTestPlatGane::TestCHgVgMediaWallRemoveItem
       
   154 // --------------------------------------------------------------------------
       
   155 //
       
   156 TInt CTestPlatGane::TestCHgVgMediaWallRemoveItem ( CStifItemParser&  )
       
   157     {
       
   158     START_TEST(removeitem, TestCHgVgMediaWallRemoveItem)
       
   159     CHgVgItem* newItem = CHgVgItem::NewL();
       
   160     temp->AddItem( newItem );
       
   161     temp->RemoveItem(0);
       
   162     END_TEST
       
   163     }
       
   164 
       
   165 // --------------------------------------------------------------------------
       
   166 // CTestPlatGane::TestCHgVgMediaWallSelectedIndex
       
   167 // --------------------------------------------------------------------------
       
   168 //
       
   169 TInt CTestPlatGane::TestCHgVgMediaWallSelectedIndex ( CStifItemParser&  )
       
   170     {
       
   171     START_TEST(selectedindex, TestCHgVgMediaWallSelectedIndex)
       
   172     temp->SelectedIndex();
       
   173     END_TEST
       
   174     }
       
   175 
       
   176 // --------------------------------------------------------------------------
       
   177 // CTestPlatGane::TestCHgVgMediaWallSetSelectedIndex
       
   178 // --------------------------------------------------------------------------
       
   179 //
       
   180 TInt CTestPlatGane::TestCHgVgMediaWallSetSelectedIndex ( CStifItemParser&  )
       
   181     {
       
   182     START_TEST(setselectedindex, TestCHgVgMediaWallSetSelectedIndex)
       
   183     temp->SetSelectedIndex(0);
       
   184     END_TEST
       
   185     }
       
   186 
       
   187 
       
   188 // --------------------------------------------------------------------------
       
   189 // CTestPlatGane::TestCHgVgMediaWallEnableScrollBufferL
       
   190 // --------------------------------------------------------------------------
       
   191 //
       
   192 TInt CTestPlatGane::TestCHgVgMediaWallEnableScrollBufferL ( CStifItemParser&  )
       
   193     {
       
   194     START_TEST(enablescrollbufferl, TestCHgVgMediaWallEnableScrollBufferL)
       
   195     TDummyObserver obs;
       
   196     temp->EnableScrollBufferL(obs, KScrollBufferSize, KScrollBufferSize / 4);                
       
   197     END_TEST
       
   198     }
       
   199 
       
   200 
       
   201 // --------------------------------------------------------------------------
       
   202 // CTestPlatGane::TestCHgVgMediaWallSetSelectionObserver
       
   203 // --------------------------------------------------------------------------
       
   204 //
       
   205 TInt CTestPlatGane::TestCHgVgMediaWallSetSelectionObserver ( CStifItemParser&  )
       
   206     {
       
   207     START_TEST(setselectionobserver, TestCHgVgMediaWallSetSelectionObserver)
       
   208     TDummyObserver obs;
       
   209     temp->SetSelectionObserver(obs);
       
   210     END_TEST
       
   211     }
       
   212 
       
   213 
       
   214 // --------------------------------------------------------------------------
       
   215 // CTestPlatGane::TestCHgVgMediaWallReset
       
   216 // --------------------------------------------------------------------------
       
   217 //
       
   218 TInt CTestPlatGane::TestCHgVgMediaWallReset ( CStifItemParser&  )
       
   219     {
       
   220     START_TEST(reset, TestCHgVgMediaWallReset)
       
   221     temp->Reset();
       
   222     END_TEST
       
   223     }
       
   224 
       
   225 
       
   226 // --------------------------------------------------------------------------
       
   227 // CTestPlatGane::TestCHgVgMediaWallResizeL
       
   228 // --------------------------------------------------------------------------
       
   229 //
       
   230 TInt CTestPlatGane::TestCHgVgMediaWallResizeL ( CStifItemParser&  )
       
   231     {
       
   232     START_TEST(resizel, TestCHgVgMediaWallResizeL)
       
   233     temp->ResizeL(100);
       
   234     END_TEST
       
   235     }
       
   236 
       
   237 
       
   238 // --------------------------------------------------------------------------
       
   239 // CTestPlatGane::TestCHgVgMediaWallSetEmptyTextL
       
   240 // --------------------------------------------------------------------------
       
   241 //
       
   242 TInt CTestPlatGane::TestCHgVgMediaWallSetEmptyTextL ( CStifItemParser&  )
       
   243     {
       
   244     START_TEST(setemptytextl, TestCHgVgMediaWallSetEmptyTextL)
       
   245     temp->SetEmptyTextL(_L("Empty"));
       
   246     END_TEST
       
   247     }
       
   248 
       
   249 // --------------------------------------------------------------------------
       
   250 // CTestPlatGane::TestCHgVgMediaWallItemCount
       
   251 // --------------------------------------------------------------------------
       
   252 //
       
   253 TInt CTestPlatGane::TestCHgVgMediaWallItemCount ( CStifItemParser&  )
       
   254     {
       
   255     START_TEST(itemcount, TestCHgVgMediaWallItemCount)
       
   256     temp->ItemCount();
       
   257     END_TEST
       
   258     }
       
   259 
       
   260 // --------------------------------------------------------------------------
       
   261 // CTestPlatGane::TestCHgVgMediaWallSetDefaultIconL
       
   262 // --------------------------------------------------------------------------
       
   263 //
       
   264 TInt CTestPlatGane::TestCHgVgMediaWallSetDefaultIconL ( CStifItemParser&  )
       
   265     {
       
   266     START_TEST(setdefaulticonl, TestCHgVgMediaWallSetDefaultIconL)
       
   267     temp->SetDefaultIconL(NULL);
       
   268     END_TEST
       
   269     }
       
   270 
       
   271 
       
   272 // --------------------------------------------------------------------------
       
   273 // CTestPlatGane::TestCHgVgMediaWallDisableScrollBuffer
       
   274 // --------------------------------------------------------------------------
       
   275 //
       
   276 TInt CTestPlatGane::TestCHgVgMediaWallDisableScrollBuffer ( CStifItemParser&  )
       
   277     {
       
   278     START_TEST(disablescrollbuffer, TestCHgVgMediaWallDisableScrollBuffer)
       
   279     temp->DisableScrollBuffer();
       
   280     END_TEST
       
   281     }
       
   282 
       
   283 
       
   284 // --------------------------------------------------------------------------
       
   285 // CTestPlatGane::TestCHgVgMediaWallChangeStyleL
       
   286 // --------------------------------------------------------------------------
       
   287 //
       
   288 TInt CTestPlatGane::TestCHgVgMediaWallChangeStyleL ( CStifItemParser&  )
       
   289     {
       
   290     START_TEST(changestylel, TestCHgVgMediaWallChangeStyleL)
       
   291     temp->ChangeStyleL(CHgVgMediaWall::EHgVgMediaWallStyleCoverflowTBonePortrait, 
       
   292             rect, EFalse);
       
   293     END_TEST
       
   294     }
       
   295 
       
   296 
       
   297 // --------------------------------------------------------------------------
       
   298 // CTestPlatGane::TestCHgVgMediaWallSetObserver
       
   299 // --------------------------------------------------------------------------
       
   300 //
       
   301 TInt CTestPlatGane::TestCHgVgMediaWallSetObserver ( CStifItemParser&  )
       
   302     {
       
   303     START_TEST(setobserver, TestCHgVgMediaWallSetObserver)
       
   304     temp->SetObserver(NULL);
       
   305     END_TEST
       
   306     }
       
   307 
       
   308 
       
   309 // --------------------------------------------------------------------------
       
   310 // CTestPlatGane::TestCHgVgMediaWallSetOpeningAnimationType
       
   311 // --------------------------------------------------------------------------
       
   312 //
       
   313 TInt CTestPlatGane::TestCHgVgMediaWallSetOpeningAnimationType ( CStifItemParser&  )
       
   314     {
       
   315     START_TEST(setopeninganimationtype, TestCHgVgMediaWallSetOpeningAnimationType)
       
   316     temp->SetOpeningAnimationType(CHgVgMediaWall::EHgVgOpeningAnimationNone);
       
   317     END_TEST
       
   318     }
       
   319 
       
   320 
       
   321 // --------------------------------------------------------------------------
       
   322 // CTestPlatGane::TestCHgVgMediaWallStyle
       
   323 // --------------------------------------------------------------------------
       
   324 //
       
   325 TInt CTestPlatGane::TestCHgVgMediaWallStyle ( CStifItemParser&  )
       
   326     {
       
   327     START_TEST(setobserver, TestCHgVgMediaWallStyle)
       
   328     temp->Style();
       
   329     END_TEST
       
   330     }
       
   331 
       
   332 
       
   333 // --------------------------------------------------------------------------
       
   334 // CTestPlatGane::TestCHgVgMediaWallOpeningAnimationType
       
   335 // --------------------------------------------------------------------------
       
   336 //
       
   337 TInt CTestPlatGane::TestCHgVgMediaWallOpeningAnimationType ( CStifItemParser&  )
       
   338     {
       
   339     START_TEST(openinganimationtype, TestCHgVgMediaWallOpeningAnimationType)
       
   340     temp->OpeningAnimationType();
       
   341     END_TEST
       
   342     }
       
   343   
       
   344 
       
   345 // --------------------------------------------------------------------------
       
   346 // CTestPlatGane::TestCHgVgMediaWallStartOpeningAnimationL
       
   347 // --------------------------------------------------------------------------
       
   348 //
       
   349 TInt CTestPlatGane::TestCHgVgMediaWallStartOpeningAnimationL ( CStifItemParser&  )
       
   350     {
       
   351     START_TEST(startopeninganimationl, TestCHgVgMediaWallStartOpeningAnimationL)
       
   352     temp->StartOpeningAnimationL(ETrue);
       
   353     END_TEST
       
   354     }
       
   355 
       
   356