common/tools/ats/smoketest/localisation/apparchitecture/tef/T_CaptionStep.cpp
author Maciej Seroka <maciejs@symbian.org>
Fri, 27 Nov 2009 12:22:12 +0000
changeset 793 0c32c669a39d
child 796 1fe17573ae08
permissions -rw-r--r--
Added new smoke test for phone languages
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
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
// under the terms of the License "Symbian Foundation License v1.0"
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
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;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
	for (ch=0; ch < 6; ch++)
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();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
		HEAP_TEST_LS_SESSION(iLs, 0, 0, TestTApaAppInfoL(), iLs.ClearAppInfoArray() );
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
		INFO_PRINTF1(_L("Test for that language finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
		}
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
	// restore original locale, just in case...
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
	ChangeLocaleL(language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
	TEST(User::Language() == language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
	}	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
   @SYMTestCaseID	t_caption_TestCApaSystemControlListL
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
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
   @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
   194
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
   @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
   200
   					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
   201
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
   @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
   203
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
void CT_CaptionStep::TestCApaSystemControlListL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
	INFO_PRINTF1(_L("Testing CApaSystemControlList... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
	CApaSystemControlList* list=NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
	User::LeaveIfError(FbsStartup());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
	RFbsSession fbs;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
	User::LeaveIfError(fbs.Connect());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
	TRAPD(ret, list=CApaSystemControlList::NewL(iFs));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
	CApaSystemControl* control=list->Control(0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
	TPtrC testShortCap=control->ShortCaption();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
	TEST(testShortCap.Length()>0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
	TPtrC testCap=control->Caption();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
	TEST(testCap.Length()>0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
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
   @SYMTestCaseID	t_caption_TestTApaAppInfoL
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
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
   @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
   227
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
   @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
   233
   					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
   234
   					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
   235
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
   @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
   237
   							american one being the default one.
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
void CT_CaptionStep::TestTApaAppInfoL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
	INFO_PRINTF1(_L("Testing GetAppInfo()... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
	// 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
   244
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
	TInt ret = iLs.GetAllApps();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
	FOREVER
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
		TApaAppInfo info;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
		ret=iLs.GetNextApp(info);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
		TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
		if (info.iUid==KUidTestApp)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
			{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
			iLs.GetAppInfo(appInfo, info.iUid);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
			break;
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
		}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
	switch (User::Language())
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
		case ELangEnglish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
		case ELangFrench:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
		case ELangGerman:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
		case ELangSpanish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
		case ELangItalian:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
		case ELangAmerican:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
			TEST(appInfo.iCaption==KTestTApaAppInfoCaptionDefault);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
			TEST(appInfo.iShortCaption==KTestTApaAppInfoShortCaptionDefault);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
		default:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
			User::Leave(KErrNotSupported);
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
		};
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
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
   @SYMTestCaseID	t_caption_TestCApaDoorL
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
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
   @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
   298
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
   @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
   304
   					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
   305
   					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
   306
   					is used to retrieve the test app caption.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
   @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
   309
   							american one being the default one.
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
void CT_CaptionStep::TestCApaDoorL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
	INFO_PRINTF1(_L("Testing CApaDoor... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
	// create an active scheduler
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
	CActiveScheduler::Install(scheduler);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
	CleanupStack::PushL(scheduler);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
	CApaProcess* process=NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
	TRAPD(ret,process = CApaProcess::NewL(iFs));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
	CleanupStack::PushL(process);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
	CApaDocument* doc=NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
	TApaApplicationFactory appFact(KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
	TRAP(ret,doc=process->AddNewDocumentL(appFact));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
	CApaDoor* door = NULL;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
	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
   333
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
	switch (User::Language())
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
		{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
		case ELangEnglish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
			TEST(*door->Caption()==KTestTApaAppInfoCaptionEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
			break;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
		case ELangFrench:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
			TEST(*door->Caption()==KTestTApaAppInfoCaptionFrench);
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 ELangGerman:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
			TEST(*door->Caption()==KTestTApaAppInfoCaptionGerman);
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 ELangSpanish:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
			TEST(*door->Caption()==KTestTApaAppInfoCaptionSpanish);
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 ELangItalian:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
			TEST(*door->Caption()==KTestTApaAppInfoCaptionItalian);
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 ELangAmerican:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
			TEST(*door->Caption()==KTestTApaAppInfoCaptionDefault);
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
		default:
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
			User::Leave(KErrNotSupported);
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
		};
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
	process->DestroyDocument(doc);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
	CleanupStack::PopAndDestroy(2); //process,scheduler
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
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
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
   @SYMTestCaseID	t_caption_TestTApaAppInfoStreamsL
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
   @SYMPREQ			0
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
   @SYMTestCaseDesc Check TApaAppInfo streaming works as expected
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
   @SYMTestStatus 	Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
   @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
   376
   					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
   377
   					and prepares the stream for writing. 
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
   					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
   379
   					read stream and prepares the stream for reading.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
   @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
   382
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   383
void CT_CaptionStep::TestTApaAppInfoStreamsL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   384
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   385
	INFO_PRINTF1(_L("Testing TApaAppInfo streams... "));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   386
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   387
	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
   388
	TEST(appInfoShort.iShortCaption.Compare(_L("TC UK"))==0);
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
	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
   391
	TInt ret = iFs.MkDirAll(tempFile);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   392
	if (ret != KErrNone && ret != KErrAlreadyExists)
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   393
		User::LeaveIfError(ret);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   394
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   395
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   396
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   397
	RFileWriteStream writer;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   398
	writer.PushL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   399
	User::LeaveIfError(writer.Replace(iFs,tempFile,EFileWrite));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   400
	TRAP(ret, appInfo.ExternalizeL(writer));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   401
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   402
	writer.CommitL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   403
	CleanupStack::PopAndDestroy(&writer);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   404
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   405
	RFileReadStream reader;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   406
	reader.PushL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   407
	User::LeaveIfError(reader.Open(iFs,tempFile,EFileRead));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   408
	TRAP(ret, appInfo.InternalizeL(reader));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   409
	TEST(ret==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   410
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   411
	CleanupStack::PopAndDestroy(&reader);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   412
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   413
	User::LeaveIfError(iFs.Delete(tempFile));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   414
	}
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
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
   @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
   420
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   421
   @SYMPREQ PCHY-6FTLPK
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   422
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   423
   @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
   424
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   425
   @SYMTestPriority High
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   426
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   427
   @SYMTestStatus Implemented
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   428
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   429
   @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
   430
  
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   431
   @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
   432
 */	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   433
void CT_CaptionStep::DoShortCaptionTestL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   434
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   435
	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
   436
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   437
	_LIT(KShortCaption1, "SC1");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   438
	_LIT(KShortCaption2, "SC2");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   439
	_LIT(KShortCaption3, "SC3");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   440
	_LIT(KShortCaption4, "SC4");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   441
	_LIT(KShortCaption5, "SC5");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   442
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   443
	// 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
   444
	TLanguage language = User::Language();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   445
	ChangeLocaleL(ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   446
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   447
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   448
	// 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
   449
	RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   450
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   451
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   452
	// 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
   453
	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
   454
	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
   455
	TEST(err == KErrNotFound);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   456
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   457
	// 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
   458
	INFO_PRINTF1(_L(".....setting an empty short caption"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   459
	err = iLs.SetAppShortCaption(KNullDesC, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   460
	TEST(err == KErrArgument);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   461
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   462
	// SetAppShortCaption should return KErrArgument if short caption > KApaMaxAppCaption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   463
	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
   464
	HBufC* longCaption = HBufC::NewL(KApaMaxAppCaption+1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   465
	longCaption->Des().SetLength(KApaMaxAppCaption+1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   466
	err = iLs.SetAppShortCaption(*longCaption, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   467
	TEST(err == KErrArgument);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   468
	delete longCaption;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   469
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   470
	// SetAppShortCaption should return KErrNone if short caption == KApaMaxAppCaption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   471
	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
   472
	longCaption = HBufC::NewL(KApaMaxAppCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   473
	longCaption->Des().SetLength(KApaMaxAppCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   474
	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
   475
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   476
	delete longCaption;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   477
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   478
	// 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
   479
	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
   480
	err = iLs.SetAppShortCaption(KShortCaption1, ELangEnglish, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   481
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   482
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   483
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   484
	TEST(appInfo.iShortCaption == KShortCaption1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   485
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   486
	// 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
   487
	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
   488
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   489
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   490
	TEST(appInfo.iShortCaption == KShortCaption1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   491
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   492
	// 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
   493
	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
   494
	ChangeLocaleL(ELangJapanese);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   495
	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
   496
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   497
	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
   498
	TEST(User::Language() == ELangEnglish);
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
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   501
	TEST(appInfo.iShortCaption == KShortCaption1);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   502
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   503
	// 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
   504
	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
   505
	err = iLs.SetAppShortCaption(KShortCaption2, ELangFrench, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   506
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   507
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   508
	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
   509
	ChangeLocaleL(ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   510
	TEST(User::Language() == ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   511
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   512
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   513
	TEST(appInfo.iShortCaption == KShortCaption2);	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   514
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   515
	// 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
   516
	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
   517
	ChangeLocaleL(ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   518
	TEST(User::Language() == ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   519
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   520
	err = iLs.SetAppShortCaption(KShortCaption2, ELangAmerican, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   521
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   522
	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
   523
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   524
	// 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
   525
	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
   526
	err = iLs.SetAppShortCaption(KShortCaption3, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   527
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   528
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   529
	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
   530
	ChangeLocaleL(ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   531
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   532
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   533
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   534
	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
   535
	ChangeLocaleL(ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   536
	TEST(User::Language() == ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   537
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   538
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   539
	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
   540
	ChangeLocaleL(ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   541
	TEST(User::Language() == ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   542
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   543
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   544
	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
   545
	ChangeLocaleL(ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   546
	TEST(User::Language() == ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   547
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   548
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   549
	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
   550
	ChangeLocaleL(ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   551
	TEST(User::Language() == ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   552
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   553
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   554
	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
   555
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   556
	// 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
   557
	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
   558
	ChangeLocaleL(ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   559
	TEST(User::Language() == ELangItalian);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   560
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   561
	err = iLs.SetAppShortCaption(KShortCaption4, ELangItalian, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   562
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   563
	TEST(appInfo.iShortCaption == KShortCaption4);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   564
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   565
	// 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
   566
	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
   567
	err = iLs.SetAppShortCaption(KShortCaption5, ELangNone, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   568
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   569
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   570
	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
   571
	ChangeLocaleL(ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   572
	TEST(User::Language() == ELangEnglish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   573
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   574
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   575
	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
   576
	ChangeLocaleL(ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   577
	TEST(User::Language() == ELangFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   578
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   579
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   580
	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
   581
	ChangeLocaleL(ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   582
	TEST(User::Language() == ELangGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   583
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   584
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   585
	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
   586
	ChangeLocaleL(ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   587
	TEST(User::Language() == ELangSpanish);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   588
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   589
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   590
	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
   591
	ChangeLocaleL(ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   592
	TEST(User::Language() == ELangAmerican);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   593
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   594
	iLs.GetAppInfo(appInfo, KUidTestApp);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   595
	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
   596
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   597
	// restore original settings....
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   598
	INFO_PRINTF1(_L(".....restoring original settings"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   599
	ChangeLocaleL(language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   600
	TEST(User::Language() == language);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   601
	// 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
   602
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionEnglish, ELangEnglish, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   603
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionFrench, ELangFrench, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   604
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionGerman, ELangGerman, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   605
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionItalian, ELangItalian, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   606
	TEST(iLs.SetAppShortCaption(KTestTApaAppInfoShortCaptionSpanish, ELangSpanish, KUidTestApp) == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   607
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   608
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   609
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   610
CT_CaptionStep::~CT_CaptionStep()
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
	iFs.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   613
	iLs.Close();
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
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   616
CT_CaptionStep::CT_CaptionStep()
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
	SetTestStepName(KT_CaptionStep);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   619
	}
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
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   622
@SYMTestCaseID 				APPFWK-APPARC-0087
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   623
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   624
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   625
@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
   626
							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
   627
@SYMTestType				CIT
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   628
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   629
@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
   630
							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
   631
							configurations to identify it clearly).
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   632
							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
   633
							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
   634
@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
   635
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   636
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   637
void CT_CaptionStep::TestIconCaptionOverridesL()
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
	INFO_PRINTF1(_L("APPFWK-APPARC-0087:TestIconCaptionOverridesL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   640
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   641
	//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
   642
	TRAPD(ret,ChangeLocaleL(ELangEnglish));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   643
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   644
				
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   645
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   646
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   647
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   648
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   649
	RFile file;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   650
	TBuf<KTextSize> fileName;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   651
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   652
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   653
	file.FullName(fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   654
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   655
	//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
   656
	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
   657
	TBuf<KTextSize> cencap(KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   658
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   659
	INFO_PRINTF2(_L("----Expected caption==>%S"), &cencap);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   660
	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   661
	TEST(appInfo.iCaption == KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   662
	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
   663
	cencap.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   664
	cencap.Copy(KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   665
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   666
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &cencap);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   667
	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
   668
	TEST(appInfo.iShortCaption == KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   669
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   670
	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
   671
	cencap.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   672
	cencap.Copy(KCenRepIconFilename);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   673
	INFO_PRINTF2(_L("----Expected icon filename==>%S"), &cencap);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   674
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   675
	TEST(fileName.Compare(KCenRepIconFilename)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   676
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   677
	file.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   678
	INFO_PRINTF1(_L("APPFWK-APPARC-0087:TestIconCaptionOverridesL finished..."));
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
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   681
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   682
@SYMTestCaseID 				APPFWK-APPARC-0088
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   683
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   684
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   685
@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
   686
							repository and resource file customisation.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   687
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   688
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   689
@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
   690
							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
   691
							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
   692
							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
   693
@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
   694
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   695
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   696
void CT_CaptionStep::TestApiPrecedenceOverCenRepConfigInfoL()
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
	INFO_PRINTF1(_L("APPFWK-APPARC-0088:TestApiPrecedenceOverCenRepConfigInfoL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   699
	_LIT(KTApiShortCaption,"APITC UK");
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
	TInt err = iLs.SetAppShortCaption(KTApiShortCaption, ELangEnglish, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   702
	TEST(err == KErrNone);
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
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   705
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   706
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   707
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   708
	TBuf<KTextSize> shortCaption(KTApiShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   709
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   710
	//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
   711
	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
   712
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &shortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   713
	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
   714
	TEST(appInfo.iShortCaption == KTApiShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   715
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   716
	//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
   717
	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
   718
	err = iLs.SetAppShortCaption(KCenRepShortCaption, ELangEnglish, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   719
	TEST(err == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   720
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   721
	INFO_PRINTF1(_L("APPFWK-APPARC-0088:TestApiPrecedenceOverCenRepConfigInfoL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   722
	}
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
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   725
@SYMTestCaseID 				APPFWK-APPARC-0089
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   726
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   727
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   728
@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
   729
							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
   730
							and updates the overrides when they occur.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   731
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   732
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   733
@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
   734
							Access the central repository.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   735
							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
   736
							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
   737
							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
   738
@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
   739
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   740
void CT_CaptionStep::TestCenRepChangeNotificationL()
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   741
	{
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   742
	INFO_PRINTF1(_L("APPFWK-APPARC-0089:TestCenRepChangeNotificationL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   743
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   744
	//access central repository
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   745
	CRepository* cenRep = CRepository::NewL(KUidIconCaptionRepository);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   746
	CleanupStack::PushL(cenRep);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   747
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   748
	_LIT(KCenRepSC,"CRNTC UK");	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   749
	TUint32 shortCapKey = 0x00000001;  // for English
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
	//update the short caption value in central repository.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   752
	TInt error = cenRep->Set(shortCapKey,KCenRepSC);
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
	//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
   755
	TEST(error == KErrNone);
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
	// 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
   758
	RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   759
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   760
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   761
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   762
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   763
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   764
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   765
	//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
   766
	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
   767
	TBuf<KTextSize> shortCaption(KCenRepSC);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   768
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   769
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &shortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   770
	INFO_PRINTF2(_L("----Retrieved shortcaption==>%S"), &appInfo.iShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   771
	TEST(appInfo.iShortCaption == KCenRepSC);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   772
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   773
	//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
   774
	error = cenRep->Set(shortCapKey,KCenRepShortCaption);
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
	// 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
   777
	User::LeaveIfError(iLs.ForceRegistration(dummy));
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
	CleanupStack::PopAndDestroy(cenRep); //cenRep object
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   780
	INFO_PRINTF1(_L("APPFWK-APPARC-0089:TestCenRepChangeNotificationL finished..."));
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
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   783
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   784
@SYMTestCaseID 				APPFWK-APPARC-0090
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   785
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   786
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   787
@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
   788
							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
   789
							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
   790
							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
   791
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   792
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   793
@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
   794
							Change the system language to French.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   795
							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
   796
							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
   797
							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
   798
							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
   799
							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
   800
							Restores the system language to English.
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 Central Repository are in English.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   803
@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
   804
							system language.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   805
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   806
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   807
void CT_CaptionStep::TestIconCaptionOverridesWithChangeLangL()
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
	INFO_PRINTF1(_L("APPFWK-APPARC-0090:TestIconCaptionOverridesWithChangeLangL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   810
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   811
	TInt ret = 0;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   812
	//French
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   813
	_LIT(KCaptionFrench, "CRTstCap FR");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   814
	_LIT(KShortCaptionFrench, "CRTC FR");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   815
	_LIT(KIconFilenameFrench, "Z:\\resource\\apps\\svg_icon.svg");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   816
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   817
	//German
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   818
	_LIT(KCaptionGerman, "TstCap GE");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   819
	_LIT(KShortCaptionGerman, "TC GE");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   820
	_LIT(KIconFilenameGerman, "Z:\\resource\\apps\\ticoncapoverride.mbm");
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   821
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   822
	TApaAppInfo appInfo;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   823
	RFile file;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   824
	TBuf<KTextSize> fileName;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   825
		
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   826
	// Change the locale to French
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   827
	INFO_PRINTF1(_L("Change the locale to French..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   828
	TRAP(ret,ChangeLocaleL(ELangFrench));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   829
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   830
	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   831
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   832
	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
   833
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   834
	// 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
   835
	RPointerArray<TDesC> dummy;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   836
	User::LeaveIfError(iLs.ForceRegistration(dummy));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   837
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   838
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   839
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
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 icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   842
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   843
	file.FullName(fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   844
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   845
	TBuf<KTextSize> printString(KCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   846
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   847
	//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
   848
	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
   849
	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
   850
	INFO_PRINTF2(_L("----Retrieved Caption==>%S"), &appInfo.iCaption);	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   851
	TEST(appInfo.iCaption == KCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   852
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   853
	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
   854
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   855
	printString.Copy(KShortCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   856
	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
   857
	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
   858
	TEST(appInfo.iShortCaption == KShortCaptionFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   859
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   860
	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
   861
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   862
	printString.Copy(KIconFilenameFrench);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   863
	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
   864
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   865
	TEST(fileName.Compare(KIconFilenameFrench)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   866
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   867
	//Change the locale to German.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   868
	INFO_PRINTF1(_L("Change the locale to German..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   869
	TRAP(ret,ChangeLocaleL(ELangGerman));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   870
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   871
	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   872
	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
   873
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   874
	// 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
   875
	User::LeaveIfError(iLs.ForceRegistration(dummy));
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
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   878
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
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
	file.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   881
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   882
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   883
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   884
	fileName.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   885
	file.FullName(fileName);
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
	// 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
   888
	// 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
   889
	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
   890
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   891
	printString.Copy(KCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   892
	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
   893
	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   894
	TEST(appInfo.iCaption == KCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   895
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   896
	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
   897
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   898
	printString.Copy(KShortCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   899
	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
   900
	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
   901
	TEST(appInfo.iShortCaption == KShortCaptionGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   902
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   903
	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
   904
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   905
	printString.Copy(KIconFilenameGerman);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   906
	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
   907
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   908
	TEST(fileName.Compare(KIconFilenameGerman)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   909
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   910
	// 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
   911
	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
   912
	TRAP(ret,ChangeLocaleL(ELangEnglish));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   913
	TEST(ret == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   914
	INFO_PRINTF2(_L("----System Language==>%d"), User::Language());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   915
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   916
	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
   917
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   918
	// 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
   919
	User::LeaveIfError(iLs.ForceRegistration(dummy));
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
	//Get test app's information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   922
	iLs.GetAppInfo(appInfo, KUidTestIconCapOverride);
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
	file.Close();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   925
	//Get test app's icon information
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   926
	iLs.GetAppIcon(KUidTestIconCapOverride,file);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   927
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   928
	fileName.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   929
	file.FullName(fileName);
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
	//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
   932
	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
   933
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   934
	printString.Copy(KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   935
	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
   936
	INFO_PRINTF2(_L("----Retrieved caption==>%S"), &appInfo.iCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   937
	TEST(appInfo.iCaption == KCenRepCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   938
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   939
	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
   940
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   941
	printString.Copy(KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   942
	INFO_PRINTF2(_L("----Expected short caption==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   943
	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
   944
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   945
	TEST(appInfo.iShortCaption == KCenRepShortCaption);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   946
	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
   947
	printString.Zero();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   948
	printString.Copy(KCenRepIconFilename);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   949
	INFO_PRINTF2(_L("----Expected icon filename==>%S"), &printString);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   950
	INFO_PRINTF2(_L("----Retrieved icon filename==>%S"), &fileName);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   951
	TEST(fileName.Compare(KCenRepIconFilename)==0);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   952
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   953
	INFO_PRINTF1(_L("APPFWK-APPARC-0090:TestIconCaptionOverridesWithChangeLangL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   954
	}
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
/**
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   957
@SYMTestCaseID 				APPFWK-APPARC-0091
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   958
@SYMPREQ 					CR1787
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   959
@SYMREQ						REQ9167
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   960
@SYMDEF						DEF125262
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   961
@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
   962
							objects are created and destroyed.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   963
@SYMTestType				CIT	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   964
@SYMTestPriority			Critical
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   965
@SYMTestActions				Marks the Heap memory
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   966
							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
   967
							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
   968
							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
   969
@SYMTestExpectedResults 	There should be no memory leaks.
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   970
*/
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   971
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   972
void CT_CaptionStep::TestIconCaptionOverridesMemoryLeaksL()
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
	INFO_PRINTF1(_L("APPFWK-APPARC-0091:TestIconCaptionOverridesMemoryLeaksL started..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   975
	__UHEAP_MARK;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   976
	TIconLoaderAndIconArrayForLeaks::TestIconCaptionOverridesL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   977
	__UHEAP_MARKEND;
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   978
	INFO_PRINTF1(_L("APPFWK-APPARC-0091:TestIconCaptionOverridesMemoryLeaksL finished..."));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   979
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   980
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   981
void CT_CaptionStep::DoIconCaptionOverridesTestL()
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
	TestIconCaptionOverridesL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   984
	TestIconCaptionOverridesWithChangeLangL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   985
	TestCenRepChangeNotificationL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   986
	TestIconCaptionOverridesMemoryLeaksL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   987
	TestApiPrecedenceOverCenRepConfigInfoL();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   988
	}
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   989
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   990
TVerdict CT_CaptionStep::doTestStepL()
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
	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
   993
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   994
	// Connect to Servers
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   995
	TEST(iFs.Connect() == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   996
	TEST(iLs.Connect() == KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   997
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   998
	// run language tests for the test caption
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   999
	TRAPD(r, DoLanguageTestL());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1000
	TEST(r==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1001
	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
  1002
	
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1003
	// run icon caption overrides tests
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1004
/*	TRAP(r, DoIconCaptionOverridesTestL());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1005
	TEST(r==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1006
	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
  1007
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1008
	// run shortcaption setting tests
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1009
/*	TRAP(r, DoShortCaptionTestL());
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1010
	TEST(r==KErrNone);
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1011
	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
  1012
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1013
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1014
	INFO_PRINTF1(_L("....test T_Caption step finished!"));
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1015
	return TestStepResult();
0c32c669a39d Added new smoke test for phone languages
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
  1016
	}