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