common/tools/ats/smoketest/localisation/apparchitecture/tef/T_CaptionStep.cpp
author victorp@symbian.org
Wed, 03 Feb 2010 16:06:24 +0000
changeset 872 17498133d9ad
parent 834 999603a97139
permissions -rw-r--r--
adding EPL headers to smoke test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
793
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 834
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
793
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 834
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
793
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
// Contributors:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
// Description:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
// Test for GT0247 Bravo.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
// CR0583: Apparc should allow short caption to be modified dynamically
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
// Test for UIKON GT0143 Typhoon Work Series 60 Changes.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
// REQ758.1: Add support for short captions
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
// This test requires that tstapp.app has been built
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
// tstapp.mmp has RESOURCE tstapp_caption.rss what caption is built into the .rsc file
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
// tstapp_loc.rss decides what version of the caption file to include:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
// tstapp01.rls
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
// tstapp02.rls
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
// tstapp03.rls
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
// tstapp04.rls
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
// tstapp05.rls
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
// tstappsc.rls
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
// 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
 @file
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
 @test
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
 @internalComponent - Internal Symbian test code
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
#include <apgicnfl.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
#include <hal.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
#include <e32test.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
#include <apgctl.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
#include <apfctlf.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
#include <APGCLI.H>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
#include <APSSERV.H>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
#include <APAFLREC.H>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
#include <APFREC.H>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
#include <APPARC.H>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
#include <APGDOOR.H>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
#include <centralrepository.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
#include <s32file.h>
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
#include "tstapp.h"		// KUidTestApp defined here
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
#include "T_CaptionStep.h"
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
#include "appfwk_test_utils.h"
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
#include "appfwk_test.h"
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
#include "ticoncaptionoverride.h" //KUidTestIconCapOverride defined here
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
#include "TIconLoaderAndIconArrayForLeaks.h"
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
/////////////////////////////////////////////////////////////////////////////////
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
//		global consts and declarations
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
/////////////////////////////////////////////////////////////////////////////////
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
_LIT(KTestTApaAppInfoCaptionEnglish,"TstCap UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
_LIT(KTestTApaAppInfoShortCaptionEnglish,"TC UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
_LIT(KTestTApaAppInfoCaptionFrench,"TstCap FR");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
_LIT(KTestTApaAppInfoShortCaptionFrench,"TC FR");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
_LIT(KTestTApaAppInfoCaptionGerman,"TstCap GE");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
_LIT(KTestTApaAppInfoShortCaptionGerman,"TC GE");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
// If _loc.rss does not define Short Caption, it takes long caption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
_LIT(KTestTApaAppInfoCaptionSpanish,"TstCap SP");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
_LIT(KTestTApaAppInfoShortCaptionSpanish,"TstCap SP");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
// If _loc.rss does not define Caption, it takes app name
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
_LIT(KTestTApaAppInfoCaptionItalian,"tstapp");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
_LIT(KTestTApaAppInfoShortCaptionItalian,"TC IT");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
_LIT(KTestTApaAppInfoCaptionDefault,"TstCap UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
_LIT(KTestTApaAppInfoShortCaptionDefault,"TC UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
// Cenrep configuration details for English language
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
_LIT(KCenRepCaption, "CRTstCap UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
_LIT(KCenRepShortCaption, "CRTC UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
_LIT(KCenRepIconFilename, "Z:\\resource\\apps\\ticoncapoverride.mbm");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
const TUid KUidIconCaptionRepository = {0x1028583d}; // Central Repository UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
const TInt KTextSize = 100;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
/////////////////////////////////////////////////////////////////////////////////
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
//		CT_CaptionStep
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
//
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
/////////////////////////////////////////////////////////////////////////////////
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
void CT_CaptionStep::ChangeLocaleL(TLanguage aLanguage)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	//  Change locale according to information in the HAL
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
	_LIT(KLitLocaleDllNameBase, "ELOCL");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
	_LIT(KLitLocaleDllNameExtension, ".LOC");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
	RLibrary localeDll;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
	TBuf<16> localeDllName(KLitLocaleDllNameBase);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
	CleanupClosePushL(localeDll);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	const TUidType uidType(TUid::Uid(0x10000079),TUid::Uid(0x100039e6));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
	_LIT(TwoDigExt,".%02d");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
	localeDllName.AppendFormat(TwoDigExt, aLanguage);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
	TInt error=localeDll.Load(localeDllName, uidType);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
	if (error==KErrNotFound)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
		localeDllName=KLitLocaleDllNameBase;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
		localeDllName.Append(KLitLocaleDllNameExtension);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
		error=localeDll.Load(localeDllName, uidType);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
		}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
	User::LeaveIfError(error);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
	User::LeaveIfError(UserSvr::ChangeLocale(localeDllName));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
	CleanupStack::PopAndDestroy(&localeDll);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
void CT_CaptionStep::DoLanguageTestL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
	TLanguage language = User::Language();	// keep a copy to restore it later on.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	TInt ch = 0;
834
999603a97139 Fixed smoke test for Localisation
Maciej Seroka <maciejs@symbian.org>
parents: 833
diff changeset
   132
	for (ch=0; ch < 2; ch++)
793
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
		TLanguage languageToTest = ELangTest;	// init to supress compiler remark
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
		switch (ch)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
			{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
			case 0:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
				languageToTest=ELangEnglish;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
				INFO_PRINTF1(_L("--------- Testing English"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
			case 1:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
				languageToTest=ELangFrench;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
				INFO_PRINTF1(_L("--------- Testing French"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
			case 2:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
				languageToTest=ELangGerman;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
				INFO_PRINTF1(_L("--------- Testing German"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
			case 3:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
				languageToTest=ELangSpanish;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
				INFO_PRINTF1(_L("--------- Testing Spanish"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
			case 4:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
				languageToTest=ELangItalian;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
				INFO_PRINTF1(_L("--------- Testing Italian"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
			case 5:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
				languageToTest=ELangAmerican;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
				INFO_PRINTF1(_L("--------- Testing American"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
			default:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
				User::LeaveIfError(KErrNotSupported);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
				break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
			};
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
		// Change the locale
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
		ChangeLocaleL(languageToTest);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
		TEST(User::Language() == languageToTest);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
		
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
		// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
		RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
		User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
		
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
		// Do the same set of tests for each language
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
		TestCApaSystemControlListL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
		TestCApaDoorL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
		TestTApaAppInfoStreamsL();
834
999603a97139 Fixed smoke test for Localisation
Maciej Seroka <maciejs@symbian.org>
parents: 833
diff changeset
   178
		//Skip the memory leak test
999603a97139 Fixed smoke test for Localisation
Maciej Seroka <maciejs@symbian.org>
parents: 833
diff changeset
   179
		//HEAP_TEST_LS_SESSION(iLs, 0, 0, TestTApaAppInfoL(), iLs.ClearAppInfoArray() );
999603a97139 Fixed smoke test for Localisation
Maciej Seroka <maciejs@symbian.org>
parents: 833
diff changeset
   180
		//and run this instead
999603a97139 Fixed smoke test for Localisation
Maciej Seroka <maciejs@symbian.org>
parents: 833
diff changeset
   181
		TestTApaAppInfoL();
793
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
		INFO_PRINTF1(_L("Test for that language finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
		}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
	// restore original locale, just in case...
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
	ChangeLocaleL(language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
	TEST(User::Language() == language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
	}	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
   @SYMTestCaseID	t_caption_TestCApaSystemControlListL
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
   @SYMTestCaseDesc	Check (short)caption by means of a control on the list CApaSystemControlList 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
   @SYMTestActions	The test creates a CApaSystemControlList and checks the value of (short)caption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
   					by creating a CApaSystemControl from index 0 of CApaSystemControlList
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
   @SYMTestExpectedResults	The (short)caption is set to a value not null (length is not zero)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
void CT_CaptionStep::TestCApaSystemControlListL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
	INFO_PRINTF1(_L("Testing CApaSystemControlList... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
	CApaSystemControlList* list=NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
	User::LeaveIfError(FbsStartup());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
	RFbsSession fbs;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
	User::LeaveIfError(fbs.Connect());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
	TRAPD(ret, list=CApaSystemControlList::NewL(iFs));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
	CApaSystemControl* control=list->Control(0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
	TPtrC testShortCap=control->ShortCaption();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
	TEST(testShortCap.Length()>0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
	TPtrC testCap=control->Caption();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
	TEST(testCap.Length()>0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
   @SYMTestCaseID	t_caption_TestTApaAppInfoL
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
   @SYMTestCaseDesc Check appInfo contains the right (short)caption for the current test language.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
   @SYMTestActions	The test searches for KUidTestApp by calling GetNextApp until the UIDs match. 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
   					Once the right app is found, it retrieves its details by calling GetAppInfo().
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
   					The (short)caption is check to ensure it matches the expected result.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
   @SYMTestExpectedResults	The (short)caption matches the one specified for the application, with the
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
   							american one being the default one.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
void CT_CaptionStep::TestTApaAppInfoL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
	INFO_PRINTF1(_L("Testing GetAppInfo()... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
	// go through the list of apps until it finds KUidTestApp
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
	TInt ret = iLs.GetAllApps();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
	FOREVER
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
		TApaAppInfo info;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
		ret=iLs.GetNextApp(info);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
		TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
		if (info.iUid==KUidTestApp)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
			{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
			iLs.GetAppInfo(appInfo, info.iUid);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
			}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
		}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
	switch (User::Language())
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
		case ELangEnglish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
		case ELangFrench:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
		case ELangGerman:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
		case ELangSpanish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
		case ELangItalian:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
		case ELangAmerican:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionDefault);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionDefault);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
		default:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
			User::Leave(KErrNotSupported);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
		};
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
   @SYMTestCaseID	t_caption_TestCApaDoorL
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
   @SYMTestCaseDesc	Check the caption returned by a CApaDoor (a wrapper for an embedded document).
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
   @SYMTestActions	The test starts by creating an active scheduler.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
   					A CApaProcess is created, and a new CApaDocument is added to it using the specified 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
   					application factory. This document is then used to create a CApaDoor object which 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
   					is used to retrieve the test app caption.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
   @SYMTestExpectedResults	The (short)caption matches the one specified for the application, with the
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
   							american one being the default one.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
void CT_CaptionStep::TestCApaDoorL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
	INFO_PRINTF1(_L("Testing CApaDoor... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
	// create an active scheduler
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
	CActiveScheduler::Install(scheduler);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
	CleanupStack::PushL(scheduler);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
	CApaProcess* process=NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
	TRAPD(ret,process = CApaProcess::NewL(iFs));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
	CleanupStack::PushL(process);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
	CApaDocument* doc=NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
	TApaApplicationFactory appFact(KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
	TRAP(ret,doc=process->AddNewDocumentL(appFact));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   333
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
	CApaDoor* door = NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
	TRAP(ret,door=CApaDoor::NewL(iFs,*doc,TSize(400,400)));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
	switch (User::Language())
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
		case ELangEnglish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
			TEST(*door->Caption()==KTestTApaAppInfoCaptionEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
		case ELangFrench:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
			TEST(*door->Caption()==KTestTApaAppInfoCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
		case ELangGerman:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
			TEST(*door->Caption()==KTestTApaAppInfoCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
		case ELangSpanish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
			TEST(*door->Caption()==KTestTApaAppInfoCaptionSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   351
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
		case ELangItalian:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
			TEST(*door->Caption()==KTestTApaAppInfoCaptionItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   355
		case ELangAmerican:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
			TEST(*door->Caption()==KTestTApaAppInfoCaptionDefault);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
		default:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
			User::Leave(KErrNotSupported);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   361
		};
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   362
	process->DestroyDocument(doc);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
	CleanupStack::PopAndDestroy(2); //process,scheduler
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   364
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   365
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   366
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   367
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
   @SYMTestCaseID	t_caption_TestTApaAppInfoStreamsL
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
   @SYMTestCaseDesc Check TApaAppInfo streaming works as expected
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   376
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   377
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
   @SYMTestActions	Create and TApaAppInfo object with the KUidTestApp test app.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   379
   					Also, create a temporal file, associates the file with a write stream, 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
   					and prepares the stream for writing. 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
   					When the object is externalized to the streem, we open a file containing a 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   382
   					read stream and prepares the stream for reading.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   383
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   384
   @SYMTestExpectedResults	The test case is completed without any errors or panics
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   385
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   386
void CT_CaptionStep::TestTApaAppInfoStreamsL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   387
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   388
	INFO_PRINTF1(_L("Testing TApaAppInfo streams... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   389
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   390
	TApaAppInfo appInfoShort(KUidTestApp, _L("z:\\sys\\bin\\tstapp.exe"), _L("TstCap UK"),_L("TC UK"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   391
	TEST(appInfoShort.iShortCaption.Compare(_L("TC UK"))==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   392
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   393
	TFileName tempFile=_L("c:\\system\\test\\TC_temp.txt");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   394
	TInt ret = iFs.MkDirAll(tempFile);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   395
	if (ret != KErrNone && ret != KErrAlreadyExists)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   396
		User::LeaveIfError(ret);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   397
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   398
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   399
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   400
	RFileWriteStream writer;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   401
	writer.PushL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   402
	User::LeaveIfError(writer.Replace(iFs,tempFile,EFileWrite));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   403
	TRAP(ret, appInfo.ExternalizeL(writer));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   404
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   405
	writer.CommitL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   406
	CleanupStack::PopAndDestroy(&writer);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   407
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   408
	RFileReadStream reader;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   409
	reader.PushL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   410
	User::LeaveIfError(reader.Open(iFs,tempFile,EFileRead));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   411
	TRAP(ret, appInfo.InternalizeL(reader));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   412
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   413
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   414
	CleanupStack::PopAndDestroy(&reader);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   415
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   416
	User::LeaveIfError(iFs.Delete(tempFile));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   417
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   418
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   419
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   420
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   421
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   422
   @SYMTestCaseID APPFWK-APPARC-0041 APPFWK-APPARC-0042 APPFWK-APPARC-0043 APPFWK-APPARC-0044 APPFWK-APPARC-0045 APPFWK-APPARC-0046
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   423
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   424
   @SYMPREQ PCHY-6FTLPK
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   425
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   426
   @SYMTestCaseDesc Test the RApaLsSession::SetAppShortCaption function, used to set the app's short caption.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   427
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   428
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   429
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   430
   @SYMTestStatus Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   431
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   432
   @SYMTestActions Call SetAppShortCaption() to set the caption and read it back using the GetApaAppInfo().
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   433
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   434
   @SYMTestExpectedResults The returned short caption must match the one set by the SetAppShortCaption function.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   435
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   436
void CT_CaptionStep::DoShortCaptionTestL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   437
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   438
	INFO_PRINTF1(_L("Testing SetAppShortCaptionL() for short caption changes... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   439
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   440
	_LIT(KShortCaption1, "SC1");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   441
	_LIT(KShortCaption2, "SC2");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   442
	_LIT(KShortCaption3, "SC3");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   443
	_LIT(KShortCaption4, "SC4");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   444
	_LIT(KShortCaption5, "SC5");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   445
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   446
	// keep a copy of the current language, and set it to a known one
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   447
	TLanguage language = User::Language();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   448
	ChangeLocaleL(ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   449
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   450
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   451
	// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   452
	RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   453
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   454
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   455
	// SetAppShortCaption should return KErrNotFound if it could not find the app
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   456
	INFO_PRINTF1(_L(".....setting short caption for an unknown app"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   457
	TInt err = iLs.SetAppShortCaption(KShortCaption1, ELangNone, TUid::Uid(0xFFF34556));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   458
	TEST(err == KErrNotFound);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   459
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   460
	// Set the NULL short caption i.e. "", should return KErrArgument,
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   461
	INFO_PRINTF1(_L(".....setting an empty short caption"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   462
	err = iLs.SetAppShortCaption(KNullDesC, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   463
	TEST(err == KErrArgument);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   464
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   465
	// SetAppShortCaption should return KErrArgument if short caption > KApaMaxAppCaption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   466
	INFO_PRINTF1(_L(".....setting short caption of more then KApaMaxAppCaption length"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   467
	HBufC* longCaption = HBufC::NewL(KApaMaxAppCaption+1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   468
	longCaption->Des().SetLength(KApaMaxAppCaption+1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   469
	err = iLs.SetAppShortCaption(*longCaption, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   470
	TEST(err == KErrArgument);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   471
	delete longCaption;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   472
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   473
	// SetAppShortCaption should return KErrNone if short caption == KApaMaxAppCaption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   474
	INFO_PRINTF1(_L(".....setting short caption of same size as KApaMaxAppCaption"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   475
	longCaption = HBufC::NewL(KApaMaxAppCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   476
	longCaption->Des().SetLength(KApaMaxAppCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   477
	err = iLs.SetAppShortCaption(*longCaption, ELangCatalan, KUidTestApp);	// just testing the arg length, not actual values
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   478
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   479
	delete longCaption;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   480
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   481
	// Set short caption of an app for the current locale language (ELangEnglish so far)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   482
	INFO_PRINTF1(_L(".....setting short caption of an app for the current locale language"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   483
	err = iLs.SetAppShortCaption(KShortCaption1, ELangEnglish, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   484
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   485
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   486
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   487
	TEST(appInfo.iShortCaption == KShortCaption1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   488
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   489
	// Check short caption remains updated after a refresh of the applist
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   490
	INFO_PRINTF1(_L(".....checking short caption remains updated after a refresh of the applist"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   491
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   492
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   493
	TEST(appInfo.iShortCaption == KShortCaption1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   494
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   495
	// Check short caption remains updated after a locale change
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   496
	INFO_PRINTF1(_L(".....checking short caption remains updated after a locale change"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   497
	ChangeLocaleL(ELangJapanese);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   498
	TEST(User::Language() == ELangJapanese);	// Japanese locale exists in epoc32 tree but not defined in test app
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   499
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   500
	ChangeLocaleL(ELangEnglish);				// back to English to see what happened in between
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   501
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   502
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   503
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   504
	TEST(appInfo.iShortCaption == KShortCaption1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   505
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   506
	// Set short caption of an app for a language which is not the current one (ELangFrench, for example)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   507
	INFO_PRINTF1(_L(".....setting short caption of an app for a language which is not the current one"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   508
	err = iLs.SetAppShortCaption(KShortCaption2, ELangFrench, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   509
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   510
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   511
	TEST(appInfo.iShortCaption == KShortCaption1);	// English, the current app language, doesn't change...
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   512
	ChangeLocaleL(ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   513
	TEST(User::Language() == ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   514
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   515
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   516
	TEST(appInfo.iShortCaption == KShortCaption2);	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   517
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   518
	// Set short caption of an app for a language which the app does not include (ELangAmerican)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   519
	INFO_PRINTF1(_L(".....setting short caption of an app for a language which the app does not include"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   520
	ChangeLocaleL(ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   521
	TEST(User::Language() == ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   522
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   523
	err = iLs.SetAppShortCaption(KShortCaption2, ELangAmerican, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   524
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   525
	TEST(appInfo.iShortCaption == KShortCaption1);	// American takes the default...so English...which has just been updated.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   526
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   527
	// Set short caption of an app for all languages with ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   528
	INFO_PRINTF1(_L(".....setting short caption for all languages with ELangNone"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   529
	err = iLs.SetAppShortCaption(KShortCaption3, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   530
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   531
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   532
	TEST(appInfo.iShortCaption == KShortCaption1);	// American takes the default...so English...which has just been updated.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   533
	ChangeLocaleL(ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   534
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   535
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   536
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   537
	TEST(appInfo.iShortCaption == KShortCaption1);	// English set individually ===> not updated by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   538
	ChangeLocaleL(ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   539
	TEST(User::Language() == ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   540
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   541
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   542
	TEST(appInfo.iShortCaption == KShortCaption2);	// French set individually ===> not updated by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   543
	ChangeLocaleL(ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   544
	TEST(User::Language() == ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   545
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   546
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   547
	TEST(appInfo.iShortCaption == KShortCaption3);	// German takes the one set by  ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   548
	ChangeLocaleL(ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   549
	TEST(User::Language() == ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   550
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   551
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   552
	TEST(appInfo.iShortCaption == KShortCaption3);	// Italian takes the one set by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   553
	ChangeLocaleL(ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   554
	TEST(User::Language() == ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   555
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   556
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   557
	TEST(appInfo.iShortCaption == KShortCaption3);	// Spanish takes the one set by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   558
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   559
	// Set short caption of an app for a language which was set by the previous ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   560
	INFO_PRINTF1(_L(".....setting short caption of an app which was set by the previous ELangNone"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   561
	ChangeLocaleL(ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   562
	TEST(User::Language() == ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   563
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   564
	err = iLs.SetAppShortCaption(KShortCaption4, ELangItalian, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   565
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   566
	TEST(appInfo.iShortCaption == KShortCaption4);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   567
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   568
	// Repeat set short caption of an app for all languages with ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   569
	INFO_PRINTF1(_L(".....repeat setting short caption for all languages with ELangNone"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   570
	err = iLs.SetAppShortCaption(KShortCaption5, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   571
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   572
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   573
	TEST(appInfo.iShortCaption == KShortCaption4);	// Italian set individually ===> not updated by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   574
	ChangeLocaleL(ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   575
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   576
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   577
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   578
	TEST(appInfo.iShortCaption == KShortCaption1);	// English set individually ===> not updated by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   579
	ChangeLocaleL(ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   580
	TEST(User::Language() == ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   581
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   582
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   583
	TEST(appInfo.iShortCaption == KShortCaption2);	// French set individually ===> not updated by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   584
	ChangeLocaleL(ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   585
	TEST(User::Language() == ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   586
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   587
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   588
	TEST(appInfo.iShortCaption == KShortCaption5);	// German takes the one set by  ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   589
	ChangeLocaleL(ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   590
	TEST(User::Language() == ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   591
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   592
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   593
	TEST(appInfo.iShortCaption == KShortCaption5);	// Spanish takes the one set by ELangNone
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   594
	ChangeLocaleL(ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   595
	TEST(User::Language() == ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   596
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   597
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   598
	TEST(appInfo.iShortCaption == KShortCaption1);	// American takes the default...so English...which has just been updated.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   599
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   600
	// restore original settings....
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   601
	INFO_PRINTF1(_L(".....restoring original settings"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   602
	ChangeLocaleL(language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   603
	TEST(User::Language() == language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   604
	// restore original short captions for all langs....(h4 doesn't perform reboots between tests)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   605
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionEnglish, ELangEnglish, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   606
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionFrench, ELangFrench, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   607
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionGerman, ELangGerman, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   608
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionItalian, ELangItalian, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   609
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionSpanish, ELangSpanish, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   610
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   611
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   612
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   613
CT_CaptionStep::~CT_CaptionStep()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   614
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   615
	iFs.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   616
	iLs.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   617
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   618
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   619
CT_CaptionStep::CT_CaptionStep()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   620
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   621
	SetTestStepName(KT_CaptionStep);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   622
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   623
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   624
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   625
@SYMTestCaseID 				APPFWK-APPARC-0087
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   626
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   627
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   628
@SYMTestCaseDesc			Tests whether the captions, icon configuration details have been retrieved properly from
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   629
							the central repository settings and has the precedence over its resource file information.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   630
@SYMTestType				CIT
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   631
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   632
@SYMTestActions				A test application with its captions, icon details defined in a test central repository file
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   633
							as well as resource file (suitable field values have been given for both cenrep and resource
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   634
							configurations to identify it clearly).
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   635
							Gets the information about the test application by passing its UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   636
							Check the given configuration details matches with central repository entries.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   637
@SYMTestExpectedResults 	The given configuration details should match with central repository entries.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   638
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   639
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   640
void CT_CaptionStep::TestIconCaptionOverridesL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   641
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   642
	INFO_PRINTF1(_L("APPFWK-APPARC-0087:TestIconCaptionOverridesL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   643
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   644
	//Change the system language to English before starting the tests
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   645
	TRAPD(ret,ChangeLocaleL(ELangEnglish));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   646
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   647
				
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   648
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   649
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   650
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   651
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   652
	RFile file;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   653
	TBuf<KTextSize> fileName;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   654
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   655
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   656
	file.FullName(fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   657
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   658
	//compare the captions, icon with values in CenRep file.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   659
	INFO_PRINTF1(_L("Compares Caption with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   660
	TBuf<KTextSize> cencap(KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   661
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   662
	INFO_PRINTF2(_L("----Expected caption==>%S"), &cencap);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   663
	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   664
	TEST(appInfo.iCaption == KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   665
	INFO_PRINTF1(_L("Compares ShortCaption with the value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   666
	cencap.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   667
	cencap.Copy(KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   668
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   669
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &cencap);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   670
	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   671
	TEST(appInfo.iShortCaption == KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   672
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   673
	INFO_PRINTF1(_L("Compares Icon file with the value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   674
	cencap.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   675
	cencap.Copy(KCenRepIconFilename);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   676
	INFO_PRINTF2(_L("----Expected icon filename==>%S"), &cencap);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   677
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   678
	TEST(fileName.Compare(KCenRepIconFilename)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   679
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   680
	file.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   681
	INFO_PRINTF1(_L("APPFWK-APPARC-0087:TestIconCaptionOverridesL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   682
	}	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   683
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   684
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   685
@SYMTestCaseID 				APPFWK-APPARC-0088
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   686
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   687
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   688
@SYMTestCaseDesc			Tests whether the shortcaption is set through the API has got the precedence over central
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   689
							repository and resource file customisation.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   690
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   691
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   692
@SYMTestActions				A test application with its short caption defined in central repository as well as in resource file.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   693
							Update the test application's short caption through API.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   694
							Gets the information about the test application by passing its UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   695
							Check whether the provided short caption matches with the one which has already been set through the API.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   696
@SYMTestExpectedResults 	It should retrieve the short caption set through the API and match with the given short caption value.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   697
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   698
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   699
void CT_CaptionStep::TestApiPrecedenceOverCenRepConfigInfoL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   700
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   701
	INFO_PRINTF1(_L("APPFWK-APPARC-0088:TestApiPrecedenceOverCenRepConfigInfoL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   702
	_LIT(KTApiShortCaption,"APITC UK");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   703
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   704
	TInt err = iLs.SetAppShortCaption(KTApiShortCaption, ELangEnglish, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   705
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   706
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   707
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   708
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   709
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   710
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   711
	TBuf<KTextSize> shortCaption(KTApiShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   712
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   713
	//compares the short caption with the value which has been set through API.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   714
	INFO_PRINTF1(_L("Compares short caption with the value that has been set through API..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   715
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &shortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   716
	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   717
	TEST(appInfo.iShortCaption == KTApiShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   718
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   719
	//Sets the short caption back to the actual one
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   720
	INFO_PRINTF1(_L("Sets the short caption back to the actual one through API..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   721
	err = iLs.SetAppShortCaption(KCenRepShortCaption, ELangEnglish, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   722
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   723
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   724
	INFO_PRINTF1(_L("APPFWK-APPARC-0088:TestApiPrecedenceOverCenRepConfigInfoL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   725
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   726
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   727
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   728
@SYMTestCaseID 				APPFWK-APPARC-0089
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   729
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   730
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   731
@SYMTestCaseDesc			Tests whether the changes made in central repository is notified by the central repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   732
							observer (CApaIconCaptionCenrepObserver), which watches for changes in the Central Repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   733
							and updates the overrides when they occur.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   734
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   735
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   736
@SYMTestActions				A test application with its caption, icon configuration details defined in central repository file.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   737
							Access the central repository.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   738
							Update the test application short caption's value in the settings.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   739
							Get the information about the test application by passing its UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   740
							Check the short caption value retrieved from the central repository matches with the given information.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   741
@SYMTestExpectedResults 	The given new short caption value should match with the central repository entry.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   742
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   743
void CT_CaptionStep::TestCenRepChangeNotificationL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   744
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   745
	INFO_PRINTF1(_L("APPFWK-APPARC-0089:TestCenRepChangeNotificationL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   746
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   747
	//access central repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   748
	CRepository* cenRep = CRepository::NewL(KUidIconCaptionRepository);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   749
	CleanupStack::PushL(cenRep);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   750
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   751
	_LIT(KCenRepSC,"CRNTC UK");	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   752
	TUint32 shortCapKey = 0x00000001;  // for English
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   753
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   754
	//update the short caption value in central repository.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   755
	TInt error = cenRep->Set(shortCapKey,KCenRepSC);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   756
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   757
	//tests whether the process with WriteDeviceData capability can update the configuration settings.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   758
	TEST(error == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   759
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   760
	// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   761
	RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   762
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   763
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   764
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   765
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   766
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   767
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   768
	//compare the short caption with the updated value in central repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   769
	INFO_PRINTF1(_L("Compares short caption with the updated value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   770
	TBuf<KTextSize> shortCaption(KCenRepSC);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   771
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   772
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &shortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   773
	INFO_PRINTF2(_L("----Retrieved shortcaption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   774
	TEST(appInfo.iShortCaption == KCenRepSC);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   775
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   776
	//sets the short caption back to the actual for other tests to work
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   777
	error = cenRep->Set(shortCapKey,KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   778
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   779
	// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   780
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   781
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   782
	CleanupStack::PopAndDestroy(cenRep); //cenRep object
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   783
	INFO_PRINTF1(_L("APPFWK-APPARC-0089:TestCenRepChangeNotificationL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   784
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   785
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   786
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   787
@SYMTestCaseID 				APPFWK-APPARC-0090
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   788
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   789
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   790
@SYMTestCaseDesc			Tests whether the caption, icon configuration details have been retrieved properly from the
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   791
							Central Repository with respect to change in system language.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   792
							Tests if the particular language entry is not there in the central repository file, it will
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   793
							then try to get the information from the resource file.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   794
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   795
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   796
@SYMTestActions				A multilingual test application with its caption, icon configuration details defined in central repository file.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   797
							Change the system language to French.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   798
							Gets the information about the test application by passing its UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   799
							Checks the retrieved captions, icon from Central Repository are in French.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   800
							Change the system language to German (the settings are not there for German in Central Repository).
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   801
							Again gets the information about the test application by passing its UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   802
							Checks the retrieved captions, icon from the Resource file are in German.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   803
							Restores the system language to English.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   804
							Again gets the information about the test application by passing its UID.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   805
							Checks the retrieved captions, icon from Central Repository are in English.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   806
@SYMTestExpectedResults 	All the retrieved Central Repository configuration details should match with the given details by changing
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   807
							system language.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   808
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   809
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   810
void CT_CaptionStep::TestIconCaptionOverridesWithChangeLangL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   811
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   812
	INFO_PRINTF1(_L("APPFWK-APPARC-0090:TestIconCaptionOverridesWithChangeLangL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   813
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   814
	TInt ret = 0;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   815
	//French
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   816
	_LIT(KCaptionFrench, "CRTstCap FR");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   817
	_LIT(KShortCaptionFrench, "CRTC FR");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   818
	_LIT(KIconFilenameFrench, "Z:\\resource\\apps\\svg_icon.svg");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   819
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   820
	//German
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   821
	_LIT(KCaptionGerman, "TstCap GE");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   822
	_LIT(KShortCaptionGerman, "TC GE");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   823
	_LIT(KIconFilenameGerman, "Z:\\resource\\apps\\ticoncapoverride.mbm");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   824
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   825
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   826
	RFile file;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   827
	TBuf<KTextSize> fileName;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   828
		
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   829
	// Change the locale to French
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   830
	INFO_PRINTF1(_L("Change the locale to French..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   831
	TRAP(ret,ChangeLocaleL(ELangFrench));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   832
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   833
	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   834
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   835
	TEST(User::Language() == ELangFrench);//check language is set to French.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   836
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   837
	// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   838
	RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   839
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   840
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   841
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   842
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   843
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   844
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   845
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   846
	file.FullName(fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   847
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   848
	TBuf<KTextSize> printString(KCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   849
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   850
	//compare the captions, icon in French with the value in central repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   851
	INFO_PRINTF1(_L("Compares Caption with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   852
	INFO_PRINTF2(_L("----Exepcted Caption in French==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   853
	INFO_PRINTF2(_L("----Retrieved Caption==>%S"), &appInfo.iCaption);	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   854
	TEST(appInfo.iCaption == KCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   855
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   856
	INFO_PRINTF1(_L("Compares Short Caption with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   857
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   858
	printString.Copy(KShortCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   859
	INFO_PRINTF2(_L("----Expected short caption in French==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   860
	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   861
	TEST(appInfo.iShortCaption == KShortCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   862
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   863
	INFO_PRINTF1(_L("Compares Icon filename with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   864
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   865
	printString.Copy(KIconFilenameFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   866
	INFO_PRINTF2(_L("----Expected icon filename in French==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   867
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   868
	TEST(fileName.Compare(KIconFilenameFrench)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   869
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   870
	//Change the locale to German.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   871
	INFO_PRINTF1(_L("Change the locale to German..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   872
	TRAP(ret,ChangeLocaleL(ELangGerman));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   873
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   874
	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   875
	TEST(User::Language() == ELangGerman);//check language is set to German.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   876
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   877
	// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   878
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   879
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   880
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   881
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   882
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   883
	file.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   884
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   885
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   886
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   887
	fileName.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   888
	file.FullName(fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   889
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   890
	// The entry for language German is not there in Central repository so it compares
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   891
	// the captions, icon in this language with the values in resource file.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   892
	INFO_PRINTF1(_L("Compares Caption with value in Resource file..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   893
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   894
	printString.Copy(KCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   895
	INFO_PRINTF2(_L("----Expected caption in German==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   896
	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   897
	TEST(appInfo.iCaption == KCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   898
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   899
	INFO_PRINTF1(_L("Compares short caption with value in Resource file..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   900
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   901
	printString.Copy(KShortCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   902
	INFO_PRINTF2(_L("----Expected short caption in German==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   903
	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   904
	TEST(appInfo.iShortCaption == KShortCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   905
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   906
	INFO_PRINTF1(_L("Compares icon filename with value in Resource file..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   907
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   908
	printString.Copy(KIconFilenameGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   909
	INFO_PRINTF2(_L("----Expected icon filename in German==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   910
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   911
	TEST(fileName.Compare(KIconFilenameGerman)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   912
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   913
	// Change the locale to English for changing the settings back to the original
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   914
	INFO_PRINTF1(_L("Change the locale back to English..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   915
	TRAP(ret,ChangeLocaleL(ELangEnglish));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   916
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   917
	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   918
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   919
	TEST(User::Language() == ELangEnglish);//check language is set to English.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   920
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   921
	// Force the applist to be updated (so test app gets new language settings)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   922
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   923
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   924
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   925
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   926
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   927
	file.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   928
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   929
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   930
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   931
	fileName.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   932
	file.FullName(fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   933
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   934
	//compare the captions, icon in English with the value in central repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   935
	INFO_PRINTF1(_L("Compares Caption with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   936
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   937
	printString.Copy(KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   938
	INFO_PRINTF2(_L("----Expected caption in English==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   939
	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   940
	TEST(appInfo.iCaption == KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   941
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   942
	INFO_PRINTF1(_L("Compares short caption with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   943
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   944
	printString.Copy(KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   945
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   946
	INFO_PRINTF2(_L("----Retrieved short caption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   947
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   948
	TEST(appInfo.iShortCaption == KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   949
	INFO_PRINTF1(_L("Compares icon filename with value in CenRep..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   950
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   951
	printString.Copy(KCenRepIconFilename);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   952
	INFO_PRINTF2(_L("----Expected icon filename==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   953
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   954
	TEST(fileName.Compare(KCenRepIconFilename)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   955
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   956
	INFO_PRINTF1(_L("APPFWK-APPARC-0090:TestIconCaptionOverridesWithChangeLangL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   957
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   958
		
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   959
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   960
@SYMTestCaseID 				APPFWK-APPARC-0091
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   961
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   962
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   963
@SYMDEF						DEF125262
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   964
@SYMTestCaseDesc			Checks there is no memory leaks when CApaIconCaptionOverridesForApp & CApaIconCaptionCenrepObserver
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   965
							objects are created and destroyed.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   966
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   967
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   968
@SYMTestActions				Marks the Heap memory
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   969
							Invokes the static method 'TestIconCaptionOverridesL()' defined in 'ticonloaderandiconarrayforleaks.dll',
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   970
							that creates objects of CApaIconCaptionOverridesForApp, CApaIconCaptionCenrepObserver and deletes those.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   971
							And then tests, there is no memory leak from the creation to destruction of those objects.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   972
@SYMTestExpectedResults 	There should be no memory leaks.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   973
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   974
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   975
void CT_CaptionStep::TestIconCaptionOverridesMemoryLeaksL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   976
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   977
	INFO_PRINTF1(_L("APPFWK-APPARC-0091:TestIconCaptionOverridesMemoryLeaksL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   978
	__UHEAP_MARK;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   979
	TIconLoaderAndIconArrayForLeaks::TestIconCaptionOverridesL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   980
	__UHEAP_MARKEND;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   981
	INFO_PRINTF1(_L("APPFWK-APPARC-0091:TestIconCaptionOverridesMemoryLeaksL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   982
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   983
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   984
void CT_CaptionStep::DoIconCaptionOverridesTestL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   985
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   986
	TestIconCaptionOverridesL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   987
	TestIconCaptionOverridesWithChangeLangL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   988
	TestCenRepChangeNotificationL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   989
	TestIconCaptionOverridesMemoryLeaksL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   990
	TestApiPrecedenceOverCenRepConfigInfoL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   991
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   992
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   993
TVerdict CT_CaptionStep::doTestStepL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   994
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   995
	INFO_PRINTF1(_L("Test T_Caption step started....\n"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   996
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   997
	// Connect to Servers
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   998
	TEST(iFs.Connect() == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   999
	TEST(iLs.Connect() == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1000
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1001
	// run language tests for the test caption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1002
	TRAPD(r, DoLanguageTestL());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1003
	TEST(r==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1004
	INFO_PRINTF2(_L("DoLanguageTestL() finished with value '%d'\n"), r);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1005
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1006
	// run icon caption overrides tests
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1007
/*	TRAP(r, DoIconCaptionOverridesTestL());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1008
	TEST(r==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1009
	INFO_PRINTF2(_L("DoIconCaptionOverridesTestL() finished with value '%d'\n"), r); */
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1010
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1011
	// run shortcaption setting tests
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1012
/*	TRAP(r, DoShortCaptionTestL());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1013
	TEST(r==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1014
	INFO_PRINTF2(_L("DoShortCaptionTestL() finished with value '%d'\n"), r); */
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1015
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1016
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1017
	INFO_PRINTF1(_L("....test T_Caption step finished!"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1018
	return TestStepResult();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1019
	}