# HG changeset patch # User Maciej Seroka # Date 1257175731 0 # Node ID eaa8962bb97966a916c8d873c7ca0e759e7cc75b # Parent 41d71e272368fbcb0da043d46754a75095157c5d Added smoketest for Notepad diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/Group/bld.inf --- a/common/tools/ats/smoketest/Group/bld.inf Mon Nov 02 15:12:58 2009 +0000 +++ b/common/tools/ats/smoketest/Group/bld.inf Mon Nov 02 15:28:51 2009 +0000 @@ -24,3 +24,4 @@ #include "../Timew/Group/bld.inf" #include "../email/group/bld.inf" #include "../profiles/group/Bld.inf" +#include "../notepad/group/bld.inf" diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/Group/smoketest.pl --- a/common/tools/ats/smoketest/Group/smoketest.pl Mon Nov 02 15:12:58 2009 +0000 +++ b/common/tools/ats/smoketest/Group/smoketest.pl Mon Nov 02 15:28:51 2009 +0000 @@ -49,5 +49,8 @@ copy($epoc . "release/winscw/udeb/ProfileSmokeTestModule.dll", "temp/smoketest/winscw_udeb/ProfileSmokeTestModule.dll"); copy($epoc . "winscw/c/smoketest/ProfileSmokeTestModule.cfg", "temp/smoketest/general/ProfileSmokeTestModule.cfg"); +copy($epoc . "release/winscw/udeb/TestNpdApi.dll", "temp/smoketest/winscw_udeb/TestNpdApi.dll"); +copy($epoc . "data/c/smoketest/smoketest_notepad.cfg", "temp/smoketest/general/smoketest_notepad.cfg"); +copy($epoc . "data/c/smoketest/ui_TestNpdApi.cfg", "temp/smoketest/general/ui_TestNpdApi.cfg"); system("7z a -tzip smoketest.zip ./temp/*"); diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/Group/smoketest.xml --- a/common/tools/ats/smoketest/Group/smoketest.xml Mon Nov 02 15:12:58 2009 +0000 +++ b/common/tools/ats/smoketest/Group/smoketest.xml Mon Nov 02 15:28:51 2009 +0000 @@ -282,6 +282,42 @@ + + install + + + + + + + + + install + + + + + + + + + install + + + + + + + + + execute + + + + + + + @@ -318,5 +354,8 @@ smoketest/winscw_udeb/t_msgsmtpserver.exe smoketest/winscw_udeb/ProfileSmokeTestModule.dll smoketest/general/ProfileSmokeTestModule.cfg + smoketest/winscw_udeb/TestNpdApi.dll + smoketest/general/smoketest_notepad.cfg + smoketest/general/ui_TestNpdApi.cfg diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/Bmarm/TestNpdApiU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/Bmarm/TestNpdApiU.DEF Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/Bwins/TestNpdApiU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/Bwins/TestNpdApiU.DEF Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/EABI/TestNpdApiU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/EABI/TestNpdApiU.def Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/conf/smoketest_notepad.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/conf/smoketest_notepad.cfg Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,15 @@ +[Test] +title Fetch Template & Cancel (-ve) +run testscripter c:\smoketest\ui_TestNpdApi.cfg 4 +run testscripter c:\smoketest\ui_TestNpdApi.cfg 2 +[Endtest] + +[Test] +title Verify No of tmplts +run testscripter c:\smoketest\ui_TestNpdApi.cfg 5 +[Endtest] + +[Test] +title Test Adding Content as Note +run testscripter c:\smoketest\ui_TestNpdApi.cfg 12 +[Endtest] diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/conf/ui_TestNpdApi.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/conf/ui_TestNpdApi.cfg Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,268 @@ +//#1 +[Test] +title Press LSK +pause 2000 +presskey global EKeyDevice0 +[Endtest] + +//#2 +[Test] +title Press RSK +pause 2000 +presskey global EKeyDevice1 +[Endtest] + +//#3 +[Test] +title FetchTemplate +bringtoforeground +create TestNpdApi NpdObj +NpdObj TestFetchTemplate +delete NpdObj +sendtobackground +[Endtest] + +//#4 +[Test] +title FetchTemplateAndExpectError +bringtoforeground +create TestNpdApi NpdObj +allownextresult -2 +NpdObj TestFetchTemplate +delete NpdObj +sendtobackground +[Endtest] + +//#5 +[Test] +title NoOfTemaplates +create TestNpdApi NpdObj +NpdObj TestNoOfTemplates +delete NpdObj +[Endtest] + +//#6 +[Test] +title TestFetchMemoAndExpectError +bringtoforeground +create TestNpdApi NpdObj +allownextresult -2 +NpdObj TestFetchMemo +delete NpdObj +sendtobackground +[Endtest] + +//#7 +[Test] +title TestFetchMemo +bringtoforeground +create TestNpdApi NpdObj +NpdObj TestFetchMemo +delete NpdObj +sendtobackground +[Endtest] + +//#8 +[Test] +title SaveFileAsMemoUsingFileName +create TestNpdApi NpdObj +NpdObj SaveFileAsMemoUsingFileName 0 +delete NpdObj +[Endtest] + +//#9 +[Test] +title SaveFileAsMemoUsingFileNameWithEncoding +create TestNpdApi NpdObj +NpdObj SaveFileAsMemoUsingFileName 1 +delete NpdObj +[Endtest] + +//#10 +[Test] +title SaveFileAsMemoUsingHandle +create TestNpdApi NpdObj +NpdObj SaveFileAsMemoUsingHandle 0 +delete NpdObj +[Endtest] + +//#11 +[Test] +title SaveFileAsMemoUsingHandleWithEncoding +create TestNpdApi NpdObj +NpdObj SaveFileAsMemoUsingHandle 1 +delete NpdObj +[Endtest] + +//#12 +[Test] +title TestAddContent +create TestNpdApi NpdObj +NpdObj TestAddContent +delete NpdObj +[Endtest] + +//#13 +[Test] +title TestingModel +create TestNpdApi NpdObj +NpdObj Model +delete NpdObj +[Endtest] + +//#14 +[Test] +title TestDialog +create TestNpdApi NpdObj +NpdObj TestDialog +delete NpdObj +[Endtest] + +//#15 +[Test] +title TestExistsMemoL +create TestNpdApi NpdObj +NpdObj TestExistsMemoL +delete NpdObj +[Endtest] + +//#16 +[Test] +title TestNumberOfTemplates +create TestNpdApi NpdObj +NpdObj TestNumberOfTemplates +delete NpdObj +[Endtest] + +//#17 +[Test] +title TestCreateModelL +create TestNpdApi NpdObj +NpdObj TestCreateModelL +delete NpdObj +[Endtest] + +//#18 +[Test] +title TestNewL +create TestNpdApi NpdObj +NpdObj TestNewL +delete NpdObj +[Endtest] + +//#19 +[Test] +title TestProbeMemoL +create TestNpdApi NpdObj +NpdObj TestProbeMemoL +delete NpdObj +[Endtest] +//#20 +[Test] +title TestNewLC +create TestNpdApi NpdObj +NpdObj TestNewLC +delete NpdObj +[Endtest] + +//#21 +[Test] +title TestCNotepadApiDestruction +create TestNpdApi NpdObj +NpdObj TestCNotepadApiDestruction +delete NpdObj +[Endtest] + +//#22 +[Test] +title TestCreateListDialogL +create TestNpdApi NpdObj +NpdObj TestCreateListDialogL +delete NpdObj +[Endtest] + + +//#23 +[Test] +title TestCreateViewerDialogL +create TestNpdApi NpdObj +NpdObj TestCreateViewerDialogL +delete NpdObj +[Endtest] + +//#24 +[Test] +title TestExecTemplatesL +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestExecTemplatesL +delete NpdObj +[Endtest] + +//#25 +[Test] +title PressKey +pause 4000 +presskey global EKeyDevice1 +[Endtest] + + + +//#26 +[Test] +title TestExecFileViewerUsingFilename +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestExecFileViewerUsingFilename +delete NpdObj +[Endtest] + + +//#27 +[Test] +title TestExecFileViewerUsingHandle +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestExecFileViewerUsingHandle +delete NpdObj +[Endtest] + + +//#28 +[Test] +title TestCreateViewer +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestCreateViewer +delete NpdObj +[Endtest] + + +//#29 +[Test] +title TestExecTextViewerL +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestExecTextViewerL +delete NpdObj +[Endtest] + + +//#30 +[Test] +title TestExecTextEditorL +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestExecTextEditorL +delete NpdObj +[Endtest] + + +//#31 +[Test] +title TestExecReadOnlyTextViewerL +create TestNpdApi NpdObj +bringtoforeground +NpdObj TestExecReadOnlyTextViewerL +delete NpdObj +[Endtest] diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/group/Bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/group/Bld.inf Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* notepad_library_api +* +*/ + + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these +DEFAULT + +PRJ_TESTEXPORTS +../conf/smoketest_notepad.cfg c:/smoketest/smoketest_notepad.cfg +../conf/ui_TestNpdApi.cfg c:/smoketest/ui_TestNpdApi.cfg + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in /epoc32/include +// Example: +/* +/agnmodel/inc/AGMCOMON.H +*/ + +PRJ_TESTMMPFILES +// NOTE: If using ARS requirements .mmp file operation should be done under this. +// 'abld test build' +TestNpdApi.mmp + +PRJ_MMPFILES +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +/agnmodel/group/agnmodel.mmp +#if defined(MARM) +/agnmodel/group/agsvexe.mmp +#endif +*/ + +// End of File \ No newline at end of file diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/group/TestNpdApi.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/group/TestNpdApi.mmp Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file of Notepad Library Api. +* +*/ + +#if defined(__S60_) + // To get the OS_LAYER_SYSTEMINCLUDE-definition + #include +#endif + +TARGET TestNpdApi.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE TestNpdApi.def + +SOURCEPATH ../src +SOURCE TestNpdApi.cpp +SOURCE TestNpdApiBlocks.cpp + +//RESOURCE resource_file +//RESOURCE resource_file2 + +USERINCLUDE ../inc + + +#if defined(__S60_) + APP_LAYER_SYSTEMINCLUDE + OS_LAYER_SYSTEMINCLUDE +#else + APP_LAYER_SYSTEMINCLUDE + SYSTEMINCLUDE /epoc32/include + +#endif + +LIBRARY NpdLib.LIB +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY efsrv.lib +LIBRARY flogger.lib +LIBRARY commonengine.lib + +LANG SC + +/* +START WINS +?wins_specific_information +END + +START MARM +?marm_specific_information +END +*/ +// Other possible keywords: + +// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCE ?color_depth ?source_bitmap +END +*/ +// DEFFILE ?filename +// AIF ?filename + +// End of File diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/inc/TestNpdApi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/inc/TestNpdApi.h Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Testing functions present in "notepad_library_api" +* +*/ + + + +#ifndef TESTNPDAPI_H +#define TESTNPDAPI_H + +// INCLUDES +#include +#include +#include +#include +#include +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KTestNpdApiLogPath, "\\logs\\testframework\\TestNpdApi\\" ); +// Log file +_LIT( KTestNpdApiLogFile, "TestNpdApi.txt" ); +_LIT( KTestNpdApiLogFileWithTitle, "TestNpdApi_[%S].txt" ); + +_LIT( KExampleFilePath, "c:\\testing\\data\\TestNpdApi.txt" ); +_LIT( KCcpFilePath, "c:\\data\\TestNpdApi.txt"); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CTestNpdApi; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CTestNpdApi test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CTestNpdApi) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CTestNpdApi* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CTestNpdApi(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CTestNpdApi( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below, explanation is given in cpp file. + */ + virtual TInt FetchTemplate( CStifItemParser& aItem ); + virtual TInt FetchMemo( CStifItemParser& aItem ); + virtual TInt NoOfTemplates( CStifItemParser& aItem ); + virtual TInt SaveFileAsMemoUsingFileName( CStifItemParser& aItem ); + virtual TInt SaveFileAsMemoUsingHandle( CStifItemParser& aItem ); + virtual TInt AddContent( CStifItemParser& aItem ); + virtual TInt Model( CStifItemParser& aItem ); + virtual TInt Dialog( CStifItemParser& aItem ); + virtual TInt ExistsMemoL( CStifItemParser& aItem ); + virtual TInt NumberOfTemplates( CStifItemParser& aItem ); + virtual TInt CreateModelL( CStifItemParser& aItem ); + virtual TInt NewL( CStifItemParser& aItem ); + virtual TInt ProbeMemoL( CStifItemParser& aItem ); + virtual TInt CTestNpdApi::NewLC( CStifItemParser& aItem ); + virtual TInt CTestNpdApi::CNotepadApiDestruction(CStifItemParser& aItem); + virtual TInt CTestNpdApi::CreateListDialogL(CStifItemParser& aItem); + virtual TInt CTestNpdApi::CreateViewerDialogL(CStifItemParser& aItem); + virtual TInt CTestNpdApi::ExecTemplatesL( CStifItemParser& aItem ); + + virtual TInt CTestNpdApi::CreateViewer(CStifItemParser& aItem); + virtual TInt CTestNpdApi::ExecFileViewerUsingFilename( CStifItemParser& aItem ); + virtual TInt CTestNpdApi::ExecFileViewerUsingHandle( CStifItemParser& aItem ); + virtual TInt CTestNpdApi::ExecTextViewerL(CStifItemParser& aItem ); + virtual TInt CTestNpdApi::ExecTextEditorL (CStifItemParser& aItem ); + virtual TInt CTestNpdApi::ExecReadOnlyTextViewerL(CStifItemParser& aItem ); + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD DEC HERE + //[TestMethods] - Do not remove + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + + // ?one_line_short_description_of_data + //?data_declaration; + CNotepadApi *iptrToNpd; + + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // TESTNPDAPI_H + +// End of File diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/init/TestFramework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/init/TestFramework.ini Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,205 @@ +# +# This is STIF initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# + XML, Test report will be xml type, for example 'TestReport.xml'. +# Note, that xml format is available only when output is set to FILE. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT, HTML or XML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +Timeout= 0 # Default timeout value for each test case. In milliseconds +UITestingSupport= YES # Possible values: YES or NO +SeparateProcesses= YES # Possible values: YES or NO (default: NO) +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +[New_Module] +ModuleName= testcombiner +TestCaseFile= c:\smoketest\smoketest_notepad.cfg +#ModuleName= testscripter +#TestCaseFile= c:\smoketest\ui_TestNpdApi.cfg +[End_Module] + + +#[New_Module] +#[End_Module] + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIF logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +#FileUnicode= YES # Possible values: YES or NO +#AddTestCaseTitle= YES # Possible values: YES or NO +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/src/TestNpdApi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/src/TestNpdApi.cpp Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: the entry for Notepad Api stif +* +*/ + + + +// INCLUDE FILES +#include +#include "TestNpdApi.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestNpdApi::CTestNpdApi +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTestNpdApi::CTestNpdApi( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTestNpdApi::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KTestNpdApiLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KTestNpdApiLogFile); + } + + iLog = CStifLogger::NewL( KTestNpdApiLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + + //iptrToNpd = CNotepadApi::NewL(); + + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestNpdApi* CTestNpdApi::NewL( + CTestModuleIf& aTestModuleIf ) + { + CTestNpdApi* self = new (ELeave) CTestNpdApi( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CTestNpdApi::~CTestNpdApi() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + if (iptrToNpd) + { + delete iptrToNpd; + iptrToNpd = NULL; + } + + } + +//----------------------------------------------------------------------------- +// CTestNpdApi::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CTestNpdApi::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("TestNpdApi.dll"); + + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CTestNpdApi::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 41d71e272368 -r eaa8962bb979 common/tools/ats/smoketest/notepad/src/TestNpdApiBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/notepad/src/TestNpdApiBlocks.cpp Mon Nov 02 15:28:51 2009 +0000 @@ -0,0 +1,541 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test function for notepad api +* +*/ + + + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include +#include "TestNpdApi.h" +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestNpdApi::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CTestNpdApi::Delete() + { + + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CTestNpdApi::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "TestFetchTemplate", CTestNpdApi::FetchTemplate ), + ENTRY( "TestFetchMemo", CTestNpdApi::FetchMemo ), + ENTRY( "TestNoOfTemplates", CTestNpdApi::NoOfTemplates ), + ENTRY( "SaveFileAsMemoUsingFileName", CTestNpdApi::SaveFileAsMemoUsingFileName ), + ENTRY( "SaveFileAsMemoUsingHandle", CTestNpdApi::SaveFileAsMemoUsingHandle ), + ENTRY( "TestAddContent", CTestNpdApi::AddContent ), + ENTRY( "Model", CTestNpdApi::Model ), + ENTRY( "TestDialog", CTestNpdApi::Dialog ), + ENTRY( "TestExistsMemoL", CTestNpdApi::ExistsMemoL ), + ENTRY( "TestNumberOfTemplates", CTestNpdApi::NumberOfTemplates ), + ENTRY( "TestCreateModelL", CTestNpdApi::CreateModelL ), + ENTRY( "TestExecTemplatesL", CTestNpdApi::ExecTemplatesL ), + ENTRY( "TestNewL", CTestNpdApi::NewL ), + ENTRY( "TestProbeMemoL", CTestNpdApi::ProbeMemoL ), + ENTRY( "TestNewLC", CTestNpdApi::NewLC ), + ENTRY( "TestCNotepadApiDestruction", CTestNpdApi::CNotepadApiDestruction ), + ENTRY( "TestCreateListDialogL", CTestNpdApi::CreateListDialogL ), + ENTRY( "TestCreateViewerDialogL", CTestNpdApi::CreateViewerDialogL ), + ENTRY( "TestExecTemplatesL", CTestNpdApi::ExecTemplatesL ), + ENTRY( "TestExecFileViewerUsingFilename", CTestNpdApi::ExecFileViewerUsingFilename ), + ENTRY( "TestExecFileViewerUsingHandle", CTestNpdApi::ExecFileViewerUsingHandle ), + ENTRY( "TestCreateViewer", CTestNpdApi::CreateViewer ), + ENTRY( "TestExecTextViewerL", CTestNpdApi::ExecTextViewerL ), + ENTRY( "TestExecTextEditorL", CTestNpdApi::ExecTextEditorL ), + ENTRY( "TestExecReadOnlyTextViewerL", CTestNpdApi::ExecReadOnlyTextViewerL ) + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +//Funcs Defns +// ----------------------------------------------------------------------------- +// CTestNpdApi::FetchTemplate +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::FetchTemplate( CStifItemParser& aItem ) + { + HBufC* retData = CNotepadApi::FetchTemplateL(); + if( retData ) + { + delete retData; + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::FetchMemo +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::FetchMemo( CStifItemParser& aItem ) + { + HBufC* retData = CNotepadApi::FetchMemoL(); + if( retData ) + { + delete retData; + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::NoOfTemplates +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::NoOfTemplates( CStifItemParser& aItem ) + { + TInt noOfTmplts = CNotepadApi::NumberOfTemplates(); + //By default there will be a 10 templates, so verifying for more than 0 + if ( noOfTmplts >= 0 ) + { + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::SaveFileAsMemoUsingFileName +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::SaveFileAsMemoUsingFileName( CStifItemParser& aItem ) + { + TInt err = 0; + TInt encoding; + aItem.GetNextInt(encoding); + + //Verifying parameter for correct value + if ( (encoding != 0) && (encoding != 1) ) + { + iLog->Log( _L("Wrong parameter, please give either 0 or 1(encoding)") ); + return KErrGeneral; + } + + TFileName fileName; + fileName.Append(KExampleFilePath); + //If 0, no encoding + if(encoding == 0) + { + TRAP(err, CNotepadApi::SaveFileAsMemoL(fileName)); + } + else + { + TRAP(err, CNotepadApi::SaveFileAsMemoL(fileName, KCharacterSetIdentifierIso88591)); + } + + if(err == KErrNone) + { + return KErrNone; + } + return err; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::SaveFileAsMemoUsingHandle +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::SaveFileAsMemoUsingHandle( CStifItemParser& aItem ) + { + TInt err = 0; + TInt encoding; + aItem.GetNextInt(encoding); + + //Verifying parameter for correct value + if ( (encoding != 0) && (encoding != 1) ) + { + iLog->Log( _L("Wrong parameter, please give either 0 or 1(encoding)") ); + return KErrGeneral; + } + + TFileName fileName; + fileName.Append( KExampleFilePath ); + + RFile data; + RFs session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + User::LeaveIfError( data.Open( session, fileName, EFileRead ) ); + CleanupClosePushL( data ); + + //If 0, no encoding + if(encoding == 0) + { + TRAP(err, CNotepadApi::SaveFileAsMemoL(data)); + } + else + { + TRAP(err, CNotepadApi::SaveFileAsMemoL(data, KCharacterSetIdentifierIso88591)); + } + + CleanupStack::PopAndDestroy( &data ); //data, + CleanupStack::PopAndDestroy( &session ); //session + + if(err == KErrNone) + { + return KErrNone; + } + return err; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::AddContent +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::AddContent( CStifItemParser& aItem ) + { + _LIT( KNote, "Saving this text as Notes/Memo"); + TRAPD(err, CNotepadApi::AddContentL( KNote )); + //Just verifying the error code + if(err == KErrNone) + { + return KErrNone; + } + return err; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::Model +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::Model( CStifItemParser& aItem ) + { + + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + //Not testing the ProbeMemoL() function, but just using to test Model() function. + TInt key = 327; + ptrToNpd->ProbeMemoL(key); + CNotepadModel* retData = ptrToNpd->Model(); + //deleting the pointer as it is not used anymore. + delete ptrToNpd; + //Verifying the pointer, is exist means model() is created properly + if( retData ) + { + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::Dialog +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::Dialog( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + CEikDialog* Dialog = ptrToNpd->Dialog(); + + delete ptrToNpd; + if ( !Dialog ) + { + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::ExistsMemoL +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::ExistsMemoL( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + + TInt key = 327; + TBool IsFound = ptrToNpd->ExistsMemoL( key ); + + //deleting the pointer as it is not used anymore. + delete ptrToNpd; + + if ( IsFound >= 0 ) + { + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::NumberOfTemplates +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::NumberOfTemplates(CStifItemParser& aItem) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt Num = ptrToNpd->NumberOfTemplates(); + delete ptrToNpd; + if( Num > 0 ) + { + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::CreateModelL +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::CreateModelL( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt modelResId = R_NOTEPAD_FETCH_MEMO_MODEL; + TRAPD( err, ptrToNpd->CreateModelL(modelResId)); + return err ; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::NewL +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::NewL( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + if ( ptrToNpd ) + { + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestNpdApi::ProbeMemoL +// ----------------------------------------------------------------------------- +TInt CTestNpdApi::ProbeMemoL( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt key = 327; + TInt err = 0; + TRAP( err, ptrToNpd->ProbeMemoL( key ) ); + delete ptrToNpd; + + if(err == KErrNone) + { + return KErrNone; + } + return err; + } +TInt CTestNpdApi::NewLC( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewLC(); + CleanupStack::Pop(); + if( ptrToNpd ) + { + delete ptrToNpd ; + return KErrNone ; + } + delete ptrToNpd ; + return KErrGeneral; + } + +TInt CTestNpdApi::CNotepadApiDestruction(CStifItemParser& aItem) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TRAPD( err, delete ptrToNpd ); + return err; + } + +TInt CTestNpdApi::CreateListDialogL(CStifItemParser& aItem) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TRAPD( err, ptrToNpd->CreateListDialogL(R_NOTEPAD_TEMPLATE_LIST_DIALOG);); + delete ptrToNpd; + return err; + } +TInt CTestNpdApi::CreateViewerDialogL(CStifItemParser& aItem) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TBool aDoWait = ETrue; + TRAPD( err, ptrToNpd->CreateViewerDialogL( aDoWait )); + delete ptrToNpd; + return err ; + } +TInt CTestNpdApi::ExecTemplatesL( CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt returnValueOfDialogExecuteLD = ptrToNpd->ExecTemplatesL(); + delete ptrToNpd; + if(returnValueOfDialogExecuteLD >= 0 ) + { + return KErrNone; + } + return KErrGeneral; + } +TInt CTestNpdApi::CreateViewer(CStifItemParser& aItem) + { + TFileName fileName; + fileName.Append( KCcpFilePath ); + RFile data; + RFs session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + User::LeaveIfError(session.ShareProtected()); + User::LeaveIfError( data.Open( session, fileName, EFileRead ) ); + CleanupClosePushL( data ); + TDesC* aTitle = NULL; + TBool aDoWait = ETrue; + TBool aGuessEncoding = EFalse; + TUint aEncoding = 0; + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt err = 0; + TRAP( err, ptrToNpd->CreateViewerDialogL(data, aTitle, aDoWait, aGuessEncoding, aEncoding )); + CleanupStack::PopAndDestroy( &data ); + CleanupStack::PopAndDestroy( &session ); + return err; + } + + +TInt CTestNpdApi::ExecFileViewerUsingFilename( CStifItemParser& aItem ) + { + TFileName fileName( KCcpFilePath ); + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TDesC *title = NULL; + TBool doWait(ETrue); + TBool guessEncoding(EFalse); + TUint aEncoding = KCharacterSetIdentifierIso88591; + TInt returnValueOfDialogExecuteLD = 0; + TInt err = 0; + TRAP( err, ptrToNpd->ExecFileViewerL( fileName, title, doWait, guessEncoding, aEncoding) ); + delete ptrToNpd; + + return returnValueOfDialogExecuteLD; + } + + +TInt CTestNpdApi::ExecFileViewerUsingHandle( CStifItemParser& aItem ) + { + TFileName fileName( KCcpFilePath ); + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + RFs fileSession; + User::LeaveIfError(fileSession.Connect()); + CleanupClosePushL(fileSession); + User::LeaveIfError(fileSession.ShareProtected()); + RFile file; + User::LeaveIfError(file.Open(fileSession, fileName, EFileRead)); + CleanupClosePushL(file); + TDesC *title = NULL; + TBool doWait(ETrue); + TBool guessEncoding(EFalse); + TUint aEncoding = KCharacterSetIdentifierIso88591; + TInt returnValueOfDialogExecuteLD = 0; + returnValueOfDialogExecuteLD = ptrToNpd->ExecFileViewerL( file, title, doWait, guessEncoding, aEncoding); + delete ptrToNpd; + CleanupStack::PopAndDestroy(2); + if( returnValueOfDialogExecuteLD >= 0) + { + return KErrNone; + } + return KErrGeneral; + } + + +TInt CTestNpdApi::ExecTextViewerL (CStifItemParser& aItem ) + { + TDesC text( KExampleFilePath ); + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt returnStatus = 0; + TRAPD( err,ptrToNpd->ExecTextViewerL( returnStatus,text ); ); + delete ptrToNpd; + return err; + + } + + +TInt CTestNpdApi::ExecTextEditorL(CStifItemParser& aItem ) + { + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt returnStatus = 0; + TRAPD( err,ptrToNpd->ExecTextEditorL( returnStatus ); ); + delete ptrToNpd; + return err; + } + + + + +TInt CTestNpdApi::ExecReadOnlyTextViewerL(CStifItemParser& aItem ) + { + TDesC text( KExampleFilePath ); + CNotepadApi* ptrToNpd = CNotepadApi::NewL(); + TInt returnStatus = 0; + TRAPD( err,ptrToNpd->ExecReadOnlyTextViewerL(text ); ); + delete ptrToNpd; + return err; + } +// ----------------------------------------------------------------------------- +// CTestNpdApi::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +/* +TInt CTestNpdApi::?member_function( + CItemParser& aItem ) + { + + ?code + + } +*/ + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// None + +// [End of File] - Do not remove