Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * T_NearestFontCapability.cpp
23 @internalComponent Internal Symbian test code
26 #include "T_GetNearestFontCapability.h"
29 _LIT( KFontAvailable, "DejaVu Sans Condensed" );
32 Class test cases for Font Capability testing and checkig panic codes
34 class CTGetNearestFontCapability : public CTGraphicsBase
37 CTGetNearestFontCapability(CTestStep* aStep);
38 virtual ~CTGetNearestFontCapability();
42 virtual void RunTestCaseL(TInt aCurTestCase);
43 virtual void ConstructL();
46 void TestSystemDefaultFont();
49 CFbsTypefaceStore* iTfs;
53 // CTGetNearestFontCapability
55 CTGetNearestFontCapability::CTGetNearestFontCapability(CTestStep* aStep) :
61 void CTGetNearestFontCapability::ConstructL()
63 iTfs = CFbsTypefaceStore::NewL(NULL);
66 CTGetNearestFontCapability::~CTGetNearestFontCapability()
71 void CTGetNearestFontCapability::RunTestCaseL( TInt aCurTestCase )
73 ((CTGetNearestFontCapabilityStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
74 switch ( aCurTestCase )
77 ((CTGetNearestFontCapabilityStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0007"));
78 INFO_PRINTF1(_L("Test System default font (capability check) Started "));
79 TRAPD(err,TestSystemDefaultFont());
81 TEST(err == KErrPermissionDenied);
82 INFO_PRINTF1(_L("Test System default font (capability check) Finished"));
86 ((CTGetNearestFontCapabilityStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
87 ((CTGetNearestFontCapabilityStep*)iStep)->CloseTMSGraphicsStep();
91 ((CTGetNearestFontCapabilityStep*)iStep)->RecordTestResultL();
95 @SYMTestCaseID GRAPHICS-FNTSTORE-0007
96 @SYMTestPriority Critical
100 Set the default system font with different capabilities
103 1 - Set the system default typeface with normal capability
104 2 - Set the system default typeface with WriteDeviceData capability
105 3 - Set the system default typeface with no capabilities
107 @SYMTestExpectedResults
108 Leaves with error code KErrPermissionDenied when a client does not have the WriteDeviceData capability.
110 void CTGetNearestFontCapability::TestSystemDefaultFont()
112 // Now try to set the system default font
113 iTfs->SetSystemDefaultTypefaceNameL(KFontAvailable);
115 // Set back to empty descriptor
116 iTfs->SetSystemDefaultTypefaceNameL(KNullDesC);
120 __CONSTRUCT_STEP__(GetNearestFontCapability)