Test: Input methods smoke tests added.
--- a/common/tools/ats/smoketest/Group/bld.inf Fri Nov 13 09:33:02 2009 +0000
+++ b/common/tools/ats/smoketest/Group/bld.inf Fri Nov 13 09:56:18 2009 +0000
@@ -28,3 +28,4 @@
#include "../appinstall/group/Bld.inf"
#include "../lbs/group/bld.inf"
#include "../uiresources/group/bld.inf"
+#include "../inputmethods/group/Bld.inf"
--- a/common/tools/ats/smoketest/Group/smoketest.pl Fri Nov 13 09:33:02 2009 +0000
+++ b/common/tools/ats/smoketest/Group/smoketest.pl Fri Nov 13 09:56:18 2009 +0000
@@ -67,5 +67,7 @@
copy($epoc . "release/winscw/udeb/testsdkskins.dll", "temp/smoketest/winscw_udeb/testsdkskins.dll");
copy($epoc . "data/c/smoketest/smoketest_uiresources.cfg", "temp/smoketest/general/smoketest_uiresources.cfg");
copy($epoc . "data/c/smoketest/ui_testsdkskinsu.cfg", "temp/smoketest/general/ui_testsdkskinsu.cfg");
+copy($epoc . "release/winscw/udeb/InputMethodSmokeTestModule.dll", "temp/smoketest/winscw_udeb/InputMethodSmokeTestModule.dll");
+copy($epoc . "winscw/c/smoketest/InputMethodSmokeTestModule.cfg", "temp/smoketest/general/InputMethodSmokeTestModule.cfg");
system("7z a -tzip smoketest.zip ./temp/*");
--- a/common/tools/ats/smoketest/Group/smoketest.xml Fri Nov 13 09:33:02 2009 +0000
+++ b/common/tools/ats/smoketest/Group/smoketest.xml Fri Nov 13 09:56:18 2009 +0000
@@ -419,6 +419,24 @@
<param component-path="smoketest" />
</params>
</step>
+ <step id="" name="InputMethodSmokeTestModule.dll (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+ <command>install</command>
+ <params>
+ <param type="binary"/>
+ <param src="InputMethodSmokeTestModule.dll"/>
+ <param dst="c:\sys\bin\InputMethodSmokeTestModule.dll"/>
+ <param component-path="smoketest" />
+ </params>
+ </step>
+ <step id="" name="InputMethodSmokeTestModule.cfg (install)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="false">
+ <command>install</command>
+ <params>
+ <param type="data"/>
+ <param src="InputMethodSmokeTestModule.cfg"/>
+ <param dst="c:\smoketest\InputMethodSmokeTestModule.cfg"/>
+ <param component-path="smoketest" />
+ </params>
+ </step>
<step id="" name="ProfileSmokeTestModule (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
<command>execute</command>
<params>
@@ -455,6 +473,15 @@
<param timeout="600"/>
</params>
</step>
+ <step id="" name="InputMethodSmokeTestModule (execute)" harness="ATSINTERFACE" enabled="true" passrate="100" significant="true">
+ <command>execute</command>
+ <params>
+ <param file="atsinterface.exe"/>
+ <param parameters="-testmodule testscripter -config c:\smoketest\InputMethodSmokeTestModule.cfg"/>
+ <param result-file="c:\spd_logs\xml\testscripter.xml"/>
+ <param timeout="600"/>
+ </params>
+ </step>
</case>
</set>
</session>
@@ -508,5 +535,7 @@
<file>smoketest/winscw_udeb/testsdkskins.dll</file>
<file>smoketest/general/smoketest_uiresources.cfg</file>
<file>smoketest/general/ui_testsdkskinsu.cfg</file>
+ <file>smoketest/winscw_udeb/InputMethodSmokeTestModule.dll</file>
+ <file>smoketest/general/InputMethodSmokeTestModule.cfg</file>
</files>
</test>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/Bmarm/InputMethodSmokeTestModuleU.DEF Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+ LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/Bwins/InputMethodSmokeTestModuleU.DEF Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+ ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/EABI/InputMethodSmokeTestModuleU.def Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/conf/InputMethodSmokeTestModule.cfg Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,20 @@
+[Test]
+title Create Predictive Text Engine
+create InputMethodSmokeTestModule ptiengine
+ptiengine CreatePtiEngine
+delete ptiengine
+[Endtest]
+
+[Test]
+title Create Predictive Text Dictionary
+create InputMethodSmokeTestModule ptidict
+ptidict CreatePtiDictionary
+delete ptidict
+[Endtest]
+
+[Test]
+title Predict Word
+create InputMethodSmokeTestModule ptiengine
+ptiengine MultitapWord 26637776664443 android
+delete ptiengine
+[Endtest]
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/group/Bld.inf Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,33 @@
+/*
+* 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:
+*
+*/
+
+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
+// NOTE: If using ARS requirements all export operations should be done under this.
+// 'abld test export'
+../conf/InputMethodSmokeTestModule.cfg c:/smoketest/InputMethodSmokeTestModule.cfg
+
+PRJ_TESTMMPFILES
+
+ InputMethodSmokeTestModule.mmp
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/group/InputMethodSmokeTestModule.mmp Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,79 @@
+/*
+* 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: MMP file for STIF Test Framework's TestScripter
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET InputMethodSmokeTestModule.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 InputMethodSmokeTestModule.def
+
+USERINCLUDE ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH ../src
+
+SOURCE InputMethodSmokeTestModule.cpp
+SOURCE InputMethodSmokeTestModuleBlocks.cpp
+
+//RESOURCE resource_file
+//RESOURCE resource_file2
+
+LIBRARY bafl.lib
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY stiftestinterface.lib
+LIBRARY stiftestengine.lib
+LIBRARY ocrsrv.lib
+LIBRARY ptiengine.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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/inc/InputMethodSmokeTestModule.h Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,211 @@
+/*
+* 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: STIF testclass declaration
+*
+*/
+
+#ifndef INPUTMETHODSMOKETESTMODULE_H
+#define INPUTMETHODSMOKETESTMODULE_H
+
+// INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// 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( KInputMethodSmokeTestModuleLogPath, "\\logs\\testframework\\InputMethodSmokeTestModule\\" );
+// Log file
+_LIT( KInputMethodSmokeTestModuleLogFile, "InputMethodSmokeTestModule.txt" );
+_LIT( KInputMethodSmokeTestModuleLogFileWithTitle, "InputMethodSmokeTestModule_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CInputMethodSmokeTestModule;
+class CPtiEngine;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+* CInputMethodSmokeTestModule test class for STIF Test Framework TestScripter.
+* ?other_description_lines
+*
+* @lib ?library
+* @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CInputMethodSmokeTestModule) : public CScriptBase
+ {
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static CInputMethodSmokeTestModule* NewL( CTestModuleIf& aTestModuleIf );
+
+ /**
+ * Destructor.
+ */
+ virtual ~CInputMethodSmokeTestModule();
+
+ 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.
+ */
+ CInputMethodSmokeTestModule( 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.
+ */
+
+ /**
+ * CreateOcrEngine test method.
+ * @since ?Series60_version
+ * @param aItem Script line containing parameters.
+ * @return Symbian OS error code.
+ */
+ virtual TInt CreateOcrEngineL( CStifItemParser& aItem );
+
+ /**
+ * CreatePtiEngine test method.
+ * @since ?Series60_version
+ * @param aItem Script line containing parameters.
+ * @return Symbian OS error code.
+ */
+ virtual TInt CreatePtiEngineL( CStifItemParser& aItem );
+
+ /**
+ * CreatePtiEngine test method.
+ * @since ?Series60_version
+ * @param aItem Script line containing parameters.
+ * @return Symbian OS error code.
+ */
+ virtual TInt CreatePtiDictionaryL( CStifItemParser& aItem );
+
+ /**
+ * CreatePtiEngine test method.
+ * @since ?Series60_version
+ * @param aItem Script line containing parameters.
+ * @return Symbian OS error code.
+ */
+ virtual TInt MultitapWordL( CStifItemParser& aItem );
+
+ void PtiEngSimulateInput(CPtiEngine* aEngine, const TDesC& aKeys);
+
+ /**
+ * 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;
+
+ // 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 // INPUTMETHODSMOKETESTMODULE_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/inc/TestOcrObserver.h Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002 - 2007 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 ocrsrv.h
+ *
+*/
+
+#ifndef TESTOCROBSERVER_H
+#define TESTOCROBSERVER_H
+
+#include <ocrsrv.h>
+
+/**
+ * CTestNotesControl is used to add setting page control in its window
+ */
+class TTestOcrObserver : public MOCREngineObserver
+ {
+public:
+ // from MOCREngineObserver
+ void RecognizeBlockComplete( TInt /*aError*/, const TOCRTextRgnInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+ void RecognizeSpecialRegionComplete( TInt /*aError*/, const TOCRTextRgnInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+ void RecognizeComplete( TInt /*aError*/, const TOCRTextRgnInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+ void LayoutComplete( TInt /*aError*/, const TOCRBlockInfo* /*aBlocks*/, const TInt /*aBlockCount*/ ) {}
+ void RecognizeProcess( const TUint /*aPercent*/ ) {}
+ };
+
+#endif /*TESTOCROBSERVER_H*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/src/InputMethodSmokeTestModule.cpp Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,199 @@
+/*
+* 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: This file contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "InputMethodSmokeTestModule.h"
+#include <SettingServerClient.h>
+
+// 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 ===============================
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::CInputMethodSmokeTestModule
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CInputMethodSmokeTestModule::CInputMethodSmokeTestModule(
+ CTestModuleIf& aTestModuleIf ):
+ CScriptBase( aTestModuleIf )
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CInputMethodSmokeTestModule::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(KInputMethodSmokeTestModuleLogFileWithTitle, &title);
+ }
+ else
+ {
+ logFileName.Copy(KInputMethodSmokeTestModuleLogFile);
+ }
+
+ iLog = CStifLogger::NewL( KInputMethodSmokeTestModuleLogPath,
+ logFileName,
+ CStifLogger::ETxt,
+ CStifLogger::EFile,
+ EFalse );
+
+ SendTestClassVersion();
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CInputMethodSmokeTestModule* CInputMethodSmokeTestModule::NewL(
+ CTestModuleIf& aTestModuleIf )
+ {
+ CInputMethodSmokeTestModule* self = new (ELeave) CInputMethodSmokeTestModule( aTestModuleIf );
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+
+ }
+
+// Destructor
+CInputMethodSmokeTestModule::~CInputMethodSmokeTestModule()
+ {
+
+ // Delete resources allocated from test methods
+ Delete();
+
+ // Delete logger
+ delete iLog;
+
+ }
+
+//-----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CInputMethodSmokeTestModule::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("InputMethodSmokeTestModule.dll");
+
+ TBool newVersionOfMethod = ETrue;
+ TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
+ }
+
+// ========================== 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* ) CInputMethodSmokeTestModule::NewL( aTestModuleIf );
+
+ }
+
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/src/InputMethodSmokeTestModuleBlocks.cpp Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,285 @@
+/*
+* 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: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include <ocrsrv.h>
+#include <ptiengine.h>
+#include <ptiuserdictionary.h>
+#include <Ecom/Ecom.h>
+#include "InputMethodSmokeTestModule.h"
+#include "TestOcrObserver.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+const TInt KMaxSize = 32;
+
+// 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 ===============================
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void CInputMethodSmokeTestModule::Delete()
+ {
+
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::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( "CreateOcrEngine", CInputMethodSmokeTestModule::CreateOcrEngineL ),
+ ENTRY( "CreatePtiEngine", CInputMethodSmokeTestModule::CreatePtiEngineL ),
+ ENTRY( "CreatePtiDictionary", CInputMethodSmokeTestModule::CreatePtiDictionaryL ),
+ ENTRY( "MultitapWord", CInputMethodSmokeTestModule::MultitapWordL ),
+ //ADD NEW ENTRY HERE
+ // [test cases entries] - Do not remove
+
+ };
+
+ const TInt count = sizeof( KFunctions ) /
+ sizeof( TStifFunctionInfo );
+
+ return RunInternalL( KFunctions, count, aItem );
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::CreateOcrEngineL( CStifItemParser& /*aItem*/ )
+ {
+ // Print to UI
+ _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+ _LIT( KCreateOcrEngine, "In Create OCR Engine" );
+
+ iLog->Log( KCreateOcrEngine );
+
+ TOcrEngineEnv engineEnv;
+ engineEnv.iPriority = EPriorityNormal;
+ engineEnv.iMaxHeapSize = 1200+KMinHeapGrowBy+1;
+
+ TTestOcrObserver observer;
+
+ MOCREngineInterface* ocrEngine = NULL;
+ ocrEngine = OCREngineFactory::CreateOCREngineL(observer, engineEnv, OCREngineFactory::EEngineLayoutRecognize);
+
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::CreatePtiEngineL( CStifItemParser& /*aItem*/ )
+ {
+ // Print to UI
+ _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+ _LIT( KCreatePtiEngine, "In Create PTI Engine" );
+
+ iLog->Log( KCreatePtiEngine );
+
+ CPtiEngine* ptiEngine = CPtiEngine::NewL();
+ CleanupStack::PushL(ptiEngine);
+
+ ptiEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping);
+
+ CleanupStack::PopAndDestroy(ptiEngine);
+ REComSession::FinalClose();
+
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::CreatePtiDictionaryL( CStifItemParser& /*aItem*/ )
+ {
+ // Print to UI
+ _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+ _LIT( KCreatePtiDictionary, "In Create PTI Dictionary" );
+
+ iLog->Log( KCreatePtiDictionary );
+
+ CPtiUserDictionary* ptiDictionary = CPtiUserDictionary::NewL(KMaxSize);
+
+ delete ptiDictionary;
+ ptiDictionary = NULL;
+
+ REComSession::FinalClose();
+
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CInputMethodSmokeTestModule::MultitapWordL(CStifItemParser& aItem)
+ {
+ // Print to UI
+ _LIT( KInputMethodSmokeTestModule, "InputMethodSmokeTestModule" );
+ _LIT( KMultitapWord, "In Multitap Word" );
+
+ iLog->Log( KMultitapWord );
+
+ TPtrC inputSequence;
+ if ( aItem.GetNextString(inputSequence) == KErrNone )
+ {
+ CPtiEngine *ptiEngine = CPtiEngine::NewL();
+ CleanupStack::PushL(ptiEngine);
+
+ // setup multitap
+ ptiEngine->ActivateLanguageL(ELangEnglish, EPtiEngineMultitapping);
+ PtiEngSimulateInput(ptiEngine, inputSequence);
+
+ TPtrC expectedWord;
+ if ( aItem.GetNextString(expectedWord) == KErrNone )
+ {
+ if ( ptiEngine->CurrentWord() == expectedWord )
+ {
+ iLog->Log(_L("Words matched"));
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ }
+ }
+
+ ptiEngine->CommitCurrentWord();
+
+ ptiEngine->CloseCurrentLanguageL();
+ CleanupStack::PopAndDestroy(ptiEngine);
+ REComSession::FinalClose();
+ }
+
+ return KErrNone;
+ }
+
+void CInputMethodSmokeTestModule::PtiEngSimulateInput(CPtiEngine* aEngine, const TDesC& aKeys)
+ {
+ for(int i=0; i<aKeys.Length(); ++i)
+ {
+ if (aKeys[i] == ' ')
+ {
+ continue;
+ }
+ else if (aKeys[i] == 'p')
+ {
+ continue;
+ }
+ else if (aKeys[i] == 'd')
+ {
+ aEngine->DeleteKeyPress();
+ }
+ else
+ {
+ aEngine->AppendKeyPress(aEngine->CharacterToKey(aKeys[i]));
+ }
+ }
+ }
+
+
+// -----------------------------------------------------------------------------
+// CInputMethodSmokeTestModule::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CInputMethodSmokeTestModule::?member_function(
+ CItemParser& aItem )
+ {
+
+ ?code
+
+ }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+// [End of File] - Do not remove
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/inputmethods/src/TestOcrObserver.cpp Fri Nov 13 09:56:18 2009 +0000
@@ -0,0 +1,1 @@
+