appfw/apparchitecture/tef/TIconLoaderAndIconArrayForLeaks.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Test for PDEF104113: This method is for memory leaks test when iconArray is created and deleted. 
       
    15 // This method is put in a separate dll in order to avoid exporting methods 
       
    16 // in server side classes (e.g., APPARC\apgrfx\CApaAppList) for test code. 
       
    17 // It is called by void CT_RApaLsSessionTestStep::TestIconLoaderAndIconArrayMemoryLeaksL() 
       
    18 // in apparctestserver
       
    19 // 
       
    20 // ticonloaderandiconarrayforleaks.cpp
       
    21 //
       
    22 
       
    23 /**
       
    24  @file ticonloaderandiconarrayforleaks.cpp
       
    25  @test
       
    26  @internalComponent - Internal Symbian test code
       
    27 */
       
    28 
       
    29 
       
    30 #include <apgaplst.h>
       
    31 #include <bautils.h>
       
    32 #include "apfdef.h"
       
    33 #include "../aplist/aplappinforeader.h"
       
    34 #include <apgicnfl.h> 
       
    35 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    36 #include "apgicnflpartner.h"
       
    37 //#include "apgicnflinternal.h"
       
    38 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
       
    39 #include "apprivate.h"
       
    40 #include <barsc2.h>
       
    41 #include <barsread2.h>
       
    42 #include <e32uid.h>
       
    43 #include "APGSTD.H"
       
    44 #include "TIconLoaderAndIconArrayForLeaks.h"
       
    45 #include "../aplist/apsiconcaptionoverride.h"
       
    46 
       
    47 
       
    48 EXPORT_C void TIconLoaderAndIconArrayForLeaks::TestIconLoaderAndIconArrayL()
       
    49 	{
       
    50 	RFs tempFs;
       
    51 	User::LeaveIfError(tempFs.Connect());
       
    52 	CleanupClosePushL(tempFs);
       
    53 
       
    54 	CApaIconLoader* iconLoader = CApaIconLoader::NewLC(tempFs);
       
    55 	CApaAppIconArray* icons = CApaAppIconArray::NewRealDefaultIconsLC(KNumberOfIconsInDefaultMbm,KDefaultAppIconMbm, *iconLoader);
       
    56 	CleanupStack::PopAndDestroy(2,iconLoader);
       
    57 	CleanupStack::PopAndDestroy(&tempFs);
       
    58 	}
       
    59 
       
    60 EXPORT_C void TIconLoaderAndIconArrayForLeaks::TestIconCaptionOverridesL()
       
    61 	{
       
    62 	CApaIconCaptionOverrides* iconcap = NULL;
       
    63 	CApaIconCaptionOverridesForApp* iconCapOverride = CApaIconCaptionOverridesForApp::NewL();
       
    64 	CleanupStack::PushL(iconCapOverride);
       
    65 	CActiveScheduler* sched = NULL;
       
    66 	sched = new(ELeave) CActiveScheduler;
       
    67 	CleanupStack::PushL(sched);
       
    68 	CActiveScheduler::Install(sched);
       
    69 	CApaIconCaptionCenrepObserver* observer = CApaIconCaptionCenrepObserver::NewL(*iconcap);
       
    70 	CleanupStack::PushL(observer);
       
    71 	CleanupStack::PopAndDestroy(3,iconCapOverride);
       
    72 	}