# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1279209558 -10800 # Node ID 2c7f2728739014be0f551a13964653a3011894dd # Parent 9e077f9a342c60bc7922fcfe2208880af1b8b94f Revision: 201025 Kit: 2010127 diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/bwins/mt_hsccapiclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/bwins/mt_hsccapiclientu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/eabi/mt_hsccapiclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/eabi/mt_hsccapiclientu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,5 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _ZTI16CMTHsCcApiClient @ 2 NONAME + _ZTV16CMTHsCcApiClient @ 3 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +mt_hsccapiclient.mmp diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/group/mt_hsccapiclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/group/mt_hsccapiclient.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: project file +* +*/ + +#include +#include + +TARGET mt_hsccapiclient.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE mthsccapiclient.cpp +SOURCE mt_hsccapiclient_dllmain.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY EUnit.lib +LIBRARY hscontentcontrol.lib +LIBRARY hscontentinfo.lib +LIBRARY ccclientsession.lib +LIBRARY hsccapiclient.lib + diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/inc/mthsccapiclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/inc/mthsccapiclient.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit module test class for Homescreen Content Control +* server +* +*/ + +#ifndef MTHSCCAPICLIENT_H +#define MTHSCCAPICLIENT_H + +// System includes +#include +#include +#include +#include +#include + +// Forward declarations +class CHsCcApiClient; +class CHsContentInfo; +class CHsContentInfoArray; + +class CMTHsCcApiClient : public CEUnitTestSuiteClass, public MHsContentControl + { + +public: // Constructors and destructors + /** + * Two-phased constructor. + */ + static CMTHsCcApiClient* NewL(); + + /** + * Destructor. + */ + virtual ~CMTHsCcApiClient(); + +private: // Constructors + /** + * Constructor + */ + CMTHsCcApiClient(); + + /** + * Second phase constructor + */ + void ConstructL(); + +public: // from MHsContentControl + + /** + * + */ + void NotifyWidgetListChanged(); + + /** + * + */ + void NotifyViewListChanged(); + + /** + * + */ + void NotifyAppListChanged(); + +private: // from CEUnitTestSuiteClass + + /** + * Setup for the unit test. + */ + void SetupL(); + + /** + * Unit test teardown. + */ + void Teardown(); + + private: // test step functions + + void ConnectHsCcApiClientL( MHsContentControl* aObserver ); + + void DisconnectHsCcApiClient(); + + CHsContentInfo* AddViewL( const TDesC8& aUid ); + + CHsContentInfo* AddWidgetL( const TDesC8& aUid ); + + CHsContentInfo* GetViewL( CHsContentInfo* aApp, const TDesC8& aUid ); + + CHsContentInfo* GetWidgetL( CHsContentInfo* aView, const TDesC8& aUid ); + +private: // test case functions + + void ConnectDisconnectHsCcApiClientL(); + + void RegisterUnregisterHsCcApiObserverL(); + + void RegisterUnregisterMultipleObserversL(); + + void WidgetListL(); + + void AddRemoveWidgetL(); + + void AddWidgetFails1L(); + + void RemoveWidgetFails1L(); + + void WidgetListChangeNtfL(); + + void ViewListL(); + + void AddRemoveViewL(); + + void ActivateViewL(); + + void AddViewFails1L(); + + void RemoveViewFails1L(); + + void ViewListChangeNtfL(); + + void AppListL(); + + void ActivateAppL(); + + void ActiveAppL(); + + void ActiveAppFails1L(); + + void ActiveViewL(); + + void ViewWidgetList1L(); + + void ViewWidgetList2L(); + + void ViewWidgetListFailsL(); + + void AppWidgetList1L(); + + void AppWidgetListFailsL(); + + void AppViewList1L(); + + void AppViewList2L(); + + void AppViewListFails1L(); + +private: // Data + + /** + * Homescreen content control api client + */ + CHsCcApiClient* iApiClient; + + /** + * Widget list notification expected + */ + TBool iWidgetListNtfExpected; + + /** + * Widget list notification received + */ + TBool iWidgetListNtfReceived; + + /** + * View list notification expected + */ + TBool iViewListNtfExpected; + + /** + * View list notification received + */ + TBool iViewListNtfReceived; + + /** + * Application list notification expected + */ + TBool iAppListNtfExpected; + + /** + * Application list notification received + */ + TBool iAppListNtfReceived; + + CActiveSchedulerWait iWait; + + /** + * Unit test data + */ + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // MTHSCCAPICLIENT_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/src/mt_hsccapiclient_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/src/mt_hsccapiclient_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Entry point to Homescreen content control server +* module test dll +* +*/ + +#include + +#include "mthsccapiclient.h" + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return CMTHsCcApiClient::NewL(); + } + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 contentcontrolsrv/tsrc/src/mthsccapiclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/tsrc/src/mthsccapiclient.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,2381 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit module test class for CPS Wrapper +* +*/ + +// System include files +#include +#include +#include +#include +#include + +// User include files +#include "mthsccapiclient.h" + +// Local constants +_LIT8( KInfoTypeWidget, "widget" ); +_LIT8( KInfoTypeTemplate, "template" ); +_LIT8( KInfoTypeView, "view" ); +_LIT8( KInfoTypeApp, "application" ); +_LIT8( KTemplateViewUid, "0x20026f50" ); +_LIT8( KHsViewUid, "0x2001f48b" ); +_LIT8( KDesktopWidgetUid, "0x20026f4f" ); +_LIT8( KNotFoundAppUid, "0xffffffff" ); +_LIT8( KNotFoundViewUid, "0xffffffff" ); +_LIT8( KNotFoundWidgetUid, "0xffffffff" ); +_LIT8( KNotFoundViewPluginId, "999" ); + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::NewL() +// ----------------------------------------------------------------------- +// +CMTHsCcApiClient* CMTHsCcApiClient::NewL() + { + CMTHsCcApiClient* self = new ( ELeave ) CMTHsCcApiClient(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ConstructL() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::CMTHsCcApiClient() +// ----------------------------------------------------------------------- +// +CMTHsCcApiClient::CMTHsCcApiClient() + :iApiClient( NULL ) + { + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::~CMTHsCcApiClient() +// ----------------------------------------------------------------------- +// +CMTHsCcApiClient::~CMTHsCcApiClient() + { + delete iApiClient; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::SetupL() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::SetupL() + { + iWidgetListNtfExpected = EFalse; + iWidgetListNtfReceived = EFalse; + iViewListNtfExpected = EFalse; + iViewListNtfReceived = EFalse; + iAppListNtfExpected = EFalse; + iAppListNtfReceived = EFalse; + + if ( iApiClient ) + { + delete iApiClient; + iApiClient = NULL; + } + iApiClient = CHsCcApiClient::NewL( NULL ); + + // Remove all removable views from Home screen + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + iApiClient->ActiveAppL( *app ); + + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + iApiClient->ViewListL( *app, *views ); + + for ( TInt i = 0; i < views->Array().Count(); i++ ) + { + CHsContentInfo* info = views->Array()[ i ]; + if ( info->CanBeRemoved() ) + { + iApiClient->RemoveViewL( *info ); + } + } + + CleanupStack::PopAndDestroy( views ); + + // Remove all removable widgets from Home screen + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + iApiClient->WidgetListL( *app, *widgets ); + + for ( TInt i = 0; i < widgets->Array().Count(); i++ ) + { + CHsContentInfo* info = widgets->Array()[ i ]; + if ( info->CanBeRemoved() ) + { + iApiClient->RemoveWidgetL( *info ); + } + } + + CleanupStack::PopAndDestroy( widgets ); + + CleanupStack::PopAndDestroy( app ); + + delete iApiClient; + iApiClient = NULL; + + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::Teardown() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::Teardown() + { + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::NotifyWidgetListChanged() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::NotifyWidgetListChanged() + { + if ( iWidgetListNtfExpected ) + { + iWidgetListNtfReceived = ETrue; + iWait.AsyncStop(); + } + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::NotifyViewListChanged() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::NotifyViewListChanged() + { + if ( iViewListNtfExpected ) + { + iViewListNtfReceived = ETrue; + iWait.AsyncStop(); + } + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::NotifyAppListChanged() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::NotifyAppListChanged() + { + if ( iAppListNtfExpected ) + { + iAppListNtfReceived = ETrue; + iWait.AsyncStop(); + } + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ConnectHsCcApiClientL() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ConnectHsCcApiClientL( MHsContentControl* aObserver ) + { + iApiClient = CHsCcApiClient::NewL( aObserver ); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::DisconnectHsCcApiClient() +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::DisconnectHsCcApiClient() + { + delete iApiClient; + iApiClient = NULL; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AddViewL() +// ----------------------------------------------------------------------- +// +CHsContentInfo* CMTHsCcApiClient::AddViewL( + const TDesC8& aUid ) + { + CHsContentInfo* info = GetViewL( NULL, aUid ); + CleanupStack::PushL( info ); + + TInt err = iApiClient->AddViewL( *info ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( info ); + info = NULL; + + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + info = GetViewL( app, aUid ); + + CleanupStack::PopAndDestroy( app ); + + User::LeaveIfNull( info ); + return info; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AddWidgetL() +// ----------------------------------------------------------------------- +// +CHsContentInfo* CMTHsCcApiClient::AddWidgetL( + const TDesC8& aUid ) + { + + CHsContentInfo* info = GetWidgetL( NULL, aUid ); + CleanupStack::PushL( info ); + + TInt err = iApiClient->AddWidgetL( *info ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( info ); + info = NULL; + + CHsContentInfo* view = CHsContentInfo::NewL(); + CleanupStack::PushL( view ); + + err = iApiClient->ActiveViewL( *view ); + User::LeaveIfError( err ); + + info = GetWidgetL( view, aUid ); + + CleanupStack::PopAndDestroy( view ); + + User::LeaveIfNull( info ); + return info; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::GetViewL() +// ----------------------------------------------------------------------- +// +CHsContentInfo* CMTHsCcApiClient::GetViewL( + CHsContentInfo* aApp, + const TDesC8& aUid ) + { + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + TInt err( KErrNone ); + if ( aApp ) + { + err = iApiClient->ViewListL( *aApp, *views ); + } + else + { + err = iApiClient->ViewListL( *views ); + } + User::LeaveIfError( err ); + + CHsContentInfo* info = NULL; + for ( TInt i = 0; i < views->Array().Count() && !info; i++ ) + { + if ( views->Array()[ i ]->Uid().CompareF( aUid ) == 0 ) + { + info = views->Array()[ i ]; + views->Array().Remove( i ); + break; + } + } + CleanupStack::PopAndDestroy( views ); + + User::LeaveIfNull( info ); + return info; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::GetWidgetL() +// ----------------------------------------------------------------------- +// +CHsContentInfo* CMTHsCcApiClient::GetWidgetL( + CHsContentInfo* aView, + const TDesC8& aUid ) + { + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + TInt err( KErrNone ); + if ( aView ) + { + err = iApiClient->WidgetListL( *aView, *widgets ); + } + else + { + err = iApiClient->WidgetListL( *widgets ); + } + User::LeaveIfError( err ); + + CHsContentInfo* info = NULL; + for ( TInt i = 0; i < widgets->Array().Count() && !info; i++ ) + { + if ( widgets->Array()[ i ]->Uid().CompareF( aUid ) == 0 ) + { + info = widgets->Array()[ i ]; + widgets->Array().Remove( i ); + break; + } + } + CleanupStack::PopAndDestroy( widgets ); + + User::LeaveIfNull( info ); + return info; + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ConnectDisconnectHsCcApiClientL() +// +// Test purpose: +// The purpose of this test case is to verify that a connection to the +// Home screen Content Control server is successfully established and +// closed via Home screen Content Control API client when the api observer +// is not defined +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ConnectDisconnectHsCcApiClientL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::RegisterUnregisterHsCcApiObserverL() +// +// Test purpose: +// The purpose of this test case is to verify that a connection to the +// Home screen Content Control server is successfully established and +// closed via Home screen Content Control API client when the api observer +// is defined +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established and +// observation is successfully started +// +// Test step 2: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::RegisterUnregisterHsCcApiObserverL() + { + // Test step 1 + ConnectHsCcApiClientL( this ); + + // Test step 2 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::RegisterUnregisterMultipleObserversL() +// +// Test purpose: +// The purpose of this test case is to verify that multiple connections to +// the Home screen Content Control server are successfully established and +// closed via Home screen Content Control API client when the api observer +// is defined +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established and +// observation is successfully started +// +// Test step 2 +// Create additional connection 1 +// +// Expected result: +// Connection is successfully established and +// observation is successfully started +// +// Test step 3 +// Create additional connection 2 +// +// Expected result: +// Connection is successfully established and +// observation is successfully started +// +// Test step 4: +// Delete additional connection 1 +// +// Expected result: +// Connection is successfully closed +// +// Test step 5: +// Delete additional connection 2 +// +// Expected result: +// Connection is successfully closed +// +// Test step 6: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::RegisterUnregisterMultipleObserversL() + { + // Test step 1 + ConnectHsCcApiClientL( this ); + + // Test step 2 + CHsCcApiClient* addClient1 = CHsCcApiClient::NewL( this ); + CleanupStack::PushL( addClient1 ); + + // Test step 3 + CHsCcApiClient* addClient2 = CHsCcApiClient::NewL( this ); + + // Test step 4 + CleanupStack::PopAndDestroy( addClient1 ); + + // Test step 5 + delete addClient2; + + // Test step 6 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::WidgetListL() +// +// Test purpose: +// The purpose of this test case is to verify that a correct list of +// widgets is returned +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get widget list +// +// Expected result: +// Content info list with widget or template type content info +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::WidgetListL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + TInt err = iApiClient->WidgetListL( *widgets ); + // Check widget list + for ( TInt i = 0; i < widgets->Array().Count() && !err ; i++ ) + { + CHsContentInfo* info = widgets->Array()[ i ]; + if ( info->Type().Compare( KInfoTypeWidget ) != 0 && + info->Type().Compare( KInfoTypeTemplate ) != 0 ) + { + // Invalid widget type + err = KErrArgument; + } + } + CleanupStack::PopAndDestroy( widgets ); + User::LeaveIfError( err ); + + // Test step 3 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AddRemoveWidgetL() +// +// Test purpose: +// The purpose of this test case is to verify that a widget which can be +// added to the Home scree is successfully added +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test view +// +// Expected result: +// View successfully aded +// +// Test step 3: +// Activate test view +// +// Expected result: +// View successfully activated +// +// Test step 4: +// Add desktop widget +// +// Expected result: +// Widget is successfully added +// +// Test step 5: +// Remove desktop widget +// +// Expected result +// Widget is removed succesfully +// +// Test step 6: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AddRemoveWidgetL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + CHsContentInfo* widget = AddWidgetL( KDesktopWidgetUid ); + User::LeaveIfNull( widget ); + CleanupStack::PushL( widget ); + + // Test step 5 + err = iApiClient->RemoveWidgetL( *widget ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( widget ); + + // Test step 6 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AddWidgetFails1L() +// +// Test purpose: +// The purpose of this test case is to verify that adding of widget fails +// if a widget which cannot be found is request to be added +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test view +// +// Expected result: +// View successfully added +// +// Test step 3: +// Activate test view +// +// Expected result: +// View successfully activated +// +// Test step 4: +// Add invalid widget +// +// Expected result: +// Widget adding fails +// +// Test step 5: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AddWidgetFails1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + CHsContentInfo* widget = GetWidgetL( NULL, KDesktopWidgetUid ); + User::LeaveIfNull( widget ); + CleanupStack::PushL( widget ); + widget->SetUidL( KNotFoundWidgetUid ); + err = iApiClient->AddWidgetL( *widget ); + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( widget ); + + // Test step 5 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::RemoveWidgetFails1L() +// +// Test purpose: +// The purpose of this test case is to verify that removing of widget fails +// if a widget request to be removed cannot be found +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test view +// +// Expected result: +// View successfully added +// +// Test step 3: +// Activate test view +// +// Expected result: +// View successfully activated +// +// Test step 4: +// Remove invalid widget +// +// Expected result: +// Widget removing fails +// +// Test step 5: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::RemoveWidgetFails1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + CHsContentInfo* widget = GetWidgetL( NULL, KDesktopWidgetUid ); + User::LeaveIfNull( widget ); + CleanupStack::PushL( widget ); + widget->SetUidL( KNotFoundWidgetUid ); + err = iApiClient->RemoveWidgetL( *widget ); + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( widget ); + + // Test step 5 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::WidgetListChangeNtfL() +// +// Test purpose: +// The purpose of this test case is to verify that a notification is +// received after a widget is successfully addded to Home screen +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test view +// +// Expected result: +// View successfully added +// +// Test step 3: +// Activate test view +// +// Expected result: +// View successfully activated +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Test step 5: +// Create CHsCcApiClient and register it as Content Control server api +// observer +// +// Expected result: +// Connection is successfully established observation registration +// succeeded +// +// Test step 6: +// Add desktop widget +// +// Expected result: +// 1) Widget added successfully +// 2) Widget list change notification received +// +// Test step 7: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::WidgetListChangeNtfL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + DisconnectHsCcApiClient(); + + // Test step 5 + ConnectHsCcApiClientL( this ); + + // Test step 6 + iWidgetListNtfExpected = ETrue; + CHsContentInfo* widget = GetWidgetL( NULL, KDesktopWidgetUid ); + User::LeaveIfNull( widget ); + CleanupStack::PushL( widget ); + err = iApiClient->AddWidgetL( *widget ); + User::LeaveIfError( err ); + + // Wait for notification + iWait.Start(); + if ( !iWidgetListNtfReceived ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( widget ); + + // Test step 7 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ViewListL() +// +// Test purpose: +// The purpose of this test case is to verify that a correct list of +// views is returned +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get view list +// +// Expected result: +// Content info list with view type content info +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ViewListL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + TInt err = iApiClient->ViewListL( *views ); + // Check widget list + for ( TInt i = 0; i < views->Array().Count() && !err ; i++ ) + { + CHsContentInfo* info = views->Array()[ i ]; + if ( info->Type().Compare( KInfoTypeView ) != 0 ) + { + // Invalid widget type + err = KErrArgument; + } + } + CleanupStack::PopAndDestroy( views ); + User::LeaveIfError( err ); + + // Test step 3 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AddRemoveViewL() +// +// Test purpose: +// The purpose of this test case is to verify that a widget which can be +// added to the Home scree is successfully added +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test view +// +// Expected result: +// View added successfully +// +// Test step 3: +// Remove test view +// +// Expected result: +// View is successfully removed +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AddRemoveViewL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->RemoveViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ActivateViewL() +// +// Test purpose: +// The purpose of this test case is to verify that a view can be +// successfully activated +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test view +// +// Expected result: +// View successfully added +// +// Test step 3: +// Activate test view +// +// Expected result: +// View successfully activated +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ActivateViewL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AddViewFails1L() +// +// Test purpose: +// The purpose of this test case is to verify that adding of view fails +// if an unknown view (invalid UID) is tried to add to Home screen +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add view which cannot be found to the Home screen +// +// Expected result: +// View adding fails +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AddViewFails1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = GetViewL( NULL, KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + view->SetUidL( KNotFoundViewUid ); + TInt err = iApiClient->AddViewL( *view ); + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( view ); + + // Test step 3 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::RemoveViewFails1L() +// +// Test purpose: +// The purpose of this test case is to verify that removing of view fails +// if a view which cannot be removed (last view) is request to be removed +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Remove last view +// +// Expected result: +// Removing of last view fails +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::RemoveViewFails1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = GetViewL( NULL, KHsViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + TInt err = iApiClient->RemoveViewL( *view ); + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( view ); + + // Test step 3 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ViewListChangeNtfL() +// +// Test purpose: +// The purpose of this test case is to verify that a notification is +// received after a view is successfully addded to Home screen +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient and register it as Content Control server api +// observer +// +// Expected result: +// Connection is successfully established observation registration +// succeeded +// +// Test step 2: +// Add template view +// +// Expected result: +// 1) View added successfully +// 2) View list change notification received +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ViewListChangeNtfL() + { + // Test step 1 + ConnectHsCcApiClientL( this ); + + // Test step 2 + iViewListNtfExpected = ETrue; + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + User::LeaveIfNull( view ); + CleanupStack::PushL( view ); + + // Wait for notification + iWait.Start(); + if ( !iViewListNtfReceived ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( view ); + + // Test step 6 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AppListL() +// +// Test purpose: +// The purpose of this test case is to verify that a correct list of +// application configurations is returned +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get app list +// +// Expected result: +// Content info list with app type content info +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AppListL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfoArray* apps = CHsContentInfoArray::NewL(); + CleanupStack::PushL( apps ); + TInt err = iApiClient->AppListL( *apps ); + // Check app list + for ( TInt i = 0; i < apps->Array().Count() && !err ; i++ ) + { + CHsContentInfo* info = apps->Array()[ i ]; + if ( info->Type().Compare( KInfoTypeApp ) != 0 ) + { + // Invalid widget type + err = KErrArgument; + } + } + CleanupStack::PopAndDestroy( apps ); + User::LeaveIfError( err ); + + // Test step 3 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ActivateAppL() +// +// Test purpose: +// The purpose of this test case is to verify that a application +// configuration can be successfully activated +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get app list +// +// Expected result: +// Content info list with application type content info +// +// Test step 3: +// Activate application type content info +// +// Expected result +// Application content info is activated +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ActivateAppL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfoArray* apps = CHsContentInfoArray::NewL(); + CleanupStack::PushL( apps ); + TInt err = iApiClient->AppListL( *apps ); + User::LeaveIfError( err ); + // Get application content info which can be activated + CHsContentInfo* info = NULL; + if ( apps->Array().Count() ) + { + info = apps->Array()[ 0 ]; + apps->Array().Remove( 0 ); + } + apps->Array().ResetAndDestroy(); + User::LeaveIfNull( info ); + CleanupStack::PushL( info ); + + // Test step 3 + err = iApiClient->ActivateAppL( *info ); + User::LeaveIfError( err ); + + CleanupStack::PopAndDestroy( info ); + CleanupStack::PopAndDestroy( apps ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ActiveAppL() +// +// Test purpose: +// The purpose of this test case is to verify that an active application +// configuration is successfully returned +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get app list +// +// Expected result: +// Content info list with application type content info +// +// Test step 3: +// Activate application type content info +// +// Expected result +// Application content info is activated +// +// Test step 4: +// Get active app +// +// Expected result: +// Content info with active application info +// +// Test step 5: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ActiveAppL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfoArray* apps = CHsContentInfoArray::NewL(); + CleanupStack::PushL( apps ); + TInt err = iApiClient->AppListL( *apps ); + User::LeaveIfError( err ); + // Get application content info which can be activated + CHsContentInfo* info = NULL; + if ( apps->Array().Count() ) + { + info = apps->Array()[ 0 ]; + apps->Array().Remove( 0 ); + } + apps->Array().ResetAndDestroy(); + User::LeaveIfNull( info ); + CleanupStack::PushL( info ); + + // Test step 3 + err = iApiClient->ActivateAppL( *info ); + User::LeaveIfError( err ); + + + // Test step 4 + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + if ( app->Uid().CompareF( info->Uid() ) != 0 ) + { + User::Leave( KErrGeneral ); + } + + CleanupStack::PopAndDestroy( app ); + + CleanupStack::PopAndDestroy( info ); + CleanupStack::PopAndDestroy( apps ); + + // Test step 5 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ActiveViewL() +// +// Test purpose: +// The purpose of this test case is to verify that an active view is +// successfully returned +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get active view +// +// Expected result: +// Active view successfully returned +// +// Test step 3: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ActiveViewL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = CHsContentInfo::NewL(); + CleanupStack::PushL( view ); + TInt err = iApiClient->ActiveViewL( *view ); + User::LeaveIfError( err ); + if ( view->Uid().CompareF( KHsViewUid ) != 0 ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( view ); + + // Test step 7 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ViewWidgetList1L() +// +// Test purpose: +// The purpose of this test case is to verify that an empty widget list +// is returned if the active view is empty +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add empty view to Home screen +// +// Expected result: +// Empty view successfully added +// +// Test step 3: +// Activate added view +// +// Expected result: +// View is successfully activated +// +// Test step 4: +// Get widget list of active view +// +// Expected result: +// Empty widget list is returned +// +// Test step 5: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ViewWidgetList1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + + // Test step 4 + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + err = iApiClient->WidgetListL( *view, *widgets ); + User::LeaveIfError( err ); + + if ( widgets->Array().Count() != 0 ) + { + User::Leave( KErrGeneral ); + } + CleanupStack::PopAndDestroy( widgets ); + CleanupStack::PopAndDestroy( view ); + + // Test step 5 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ViewWidgetList2L() +// +// Test purpose: +// The purpose of this test case is to verify that an empty widget list +// is returned if the active view is empty +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add empty view to Home screen +// +// Expected result: +// Empty view successfully added +// +// Test step 3: +// Activate added view +// +// Expected result: +// View is successfully activated +// +// Test step 4: +// Add widget to Home screen view +// +// Expected result: +// Widget added successfully +// +// Test step 5: +// Get widget list of active view +// +// Expected result: +// Widget list including added widget +// +// Test step 6: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ViewWidgetList2L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + CleanupStack::PushL( view ); + + // Test step 3 + TInt err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + + // Test step 4 + CHsContentInfo* widget = AddWidgetL( KDesktopWidgetUid ); + CleanupStack::PushL( widget ); + + // Test step 5 + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + err = iApiClient->WidgetListL( *view, *widgets ); + User::LeaveIfError( err ); + + err = KErrGeneral; + if ( widgets->Array().Count() == 1 && + widgets->Array()[ 0 ]->PluginId().CompareF( widget->PluginId() ) == + 0 && widgets->Array()[ 0 ]->Uid().CompareF( widget->Uid() ) == 0 ) + { + err = KErrNone; + } + User::LeaveIfError( err ); + + CleanupStack::PopAndDestroy( widgets ); + CleanupStack::PopAndDestroy( widget ); + CleanupStack::PopAndDestroy( view ); + + // Test step 6 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::ViewWidgetListFailsL() +// +// Test purpose: +// The purpose of this test case is to verify that requesting of a +// widget list fails if the widget list is requested from a view which +// cannot be found +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add empty view to Home screen +// +// Expected result: +// Empty view successfully added +// +// Test step 3: +// Get widget list of invalid view +// +// Expected result: +// Widget list request fails +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::ViewWidgetListFailsL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + CleanupStack::PushL( view ); + + // Test step 3 + view->SetPluginIdL( KNotFoundViewPluginId ); + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + TInt err = iApiClient->WidgetListL( *view, *widgets ); + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + + CleanupStack::PopAndDestroy( widgets ); + CleanupStack::PopAndDestroy( view ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AppWidgetList1L() +// +// Test purpose: +// The purpose of this test case is to verify that correct list of widgets +// is returned when a widget list of an application configuration is +// requested +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get active application configuration +// +// Expected result: +// Application configuration successfully received +// +// Test step 3: +// Get widget list of active application configuration +// +// Expected result: +// Widget list is successfully returned +// +// Test step 4: +// Add empty view to Home screen +// +// Expected result: +// Empty view successfully added +// +// Test step 5: +// Activate added view +// +// Expected result: +// View is successfully activated +// +// Test step 6: +// Add widget to Home screen view +// +// Expected result: +// Widget added successfully +// +// Test step 7: +// Get widget list of active application configuration +// +// Expected result: +// Widget list is successfully returned +// +// Test step 8: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AppWidgetList1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + TInt err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + // Test step 3 + CHsContentInfoArray* widgets1 = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets1 ); + err = iApiClient->WidgetListL( *app, *widgets1 ); + User::LeaveIfError( err ); + + // Test step 4 + CHsContentInfo* view = AddViewL( KTemplateViewUid ); + CleanupStack::PushL( view ); + + // Test step 5 + err = iApiClient->ActivateViewL( *view ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( view ); + + // Test step 6 + CHsContentInfo* widget = AddWidgetL( KDesktopWidgetUid ); + CleanupStack::PushL( widget ); + widgets1->Array().AppendL( widget ); + CleanupStack::Pop( widget ); + + // Test step 7 + CHsContentInfoArray* widgets2 = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets2 ); + err = iApiClient->WidgetListL( *app, *widgets2 ); + User::LeaveIfError( err ); + + err = KErrGeneral; + if ( widgets1->Array().Count() == widgets2->Array().Count() ) + { + err = KErrNone; + for ( TInt i = 0; i < widgets1->Array().Count() && + err == KErrNone; i++ ) + { + TBool found( EFalse ); + for ( TInt j = 0; j < widgets2->Array().Count() && !found; j++ ) + { + if ( widgets1->Array()[ i ]->PluginId() == + widgets2->Array()[ j ]->PluginId() ) + { + found = ETrue; + } + } + if ( !found ) + { + err = KErrGeneral; + } + } + } + + CleanupStack::PopAndDestroy( widgets2 ); + CleanupStack::PopAndDestroy( widgets1 ); + CleanupStack::PopAndDestroy( app ); + + // Test step 8 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AppWidgetListFailsL() +// +// Test purpose: +// The purpose of this test case is to verify that requesting of a +// widget list fails if the widget list is requested from a application +// configuration which cannot be found +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get active application configuration +// +// Expected result: +// Application configuration successfully received +// +// Test step 3: +// Get widget list of invalid application configuration +// +// Expected result: +// Widget list request fails +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AppWidgetListFailsL() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + TInt err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + // Test step 3 + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + app->SetUidL( KNotFoundAppUid ); + err = iApiClient->WidgetListL( *app, *widgets ); + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + + CleanupStack::PopAndDestroy( widgets ); + CleanupStack::PopAndDestroy( app ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AppViewList1L() +// +// Test purpose: +// The purpose of this test case is to verify that correct view list is +// returned when there is mandatory views included in active application +// configuration +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get active application configuration +// +// Expected result: +// Application configuration is successfully returned +// +// Test step 3: +// Get view list from active application configuration +// +// Expected result: +// View list is successfully returned +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AppViewList1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + TInt err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + // Test step 3 + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + + err = iApiClient->ViewListL( *app, *views ); + User::LeaveIfError( err ); + + for ( TInt i = 0; i < views->Array().Count(); i++ ) + { + CHsContentInfo* view = views->Array()[ i ]; + if ( view->Type().Compare( KInfoTypeView ) != 0 ) + { + User::Leave( KErrGeneral ); + } + } + + CleanupStack::PopAndDestroy( views ); + CleanupStack::PopAndDestroy( app ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AppViewList2L() +// +// Test purpose: +// The purpose of this test case is to verify that correct view list is +// returned when there is maximum count of views in application +// configuration +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Add test views +// +// Expected result: +// Views added successfully +// +// Test step 3: +// Get active application configuration +// +// Expected result: +// Application configuration is successfully returned +// +// Test step 4: +// Get view list from active application configuration +// +// Expected result: +// View list is successfully returned +// +// Test step 5: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AppViewList2L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + TInt err( KErrNone ); + CHsContentInfo* view( NULL ); + while ( !err ) + { + TRAP( err, view = AddViewL( KTemplateViewUid ) ); + delete view; + view = NULL; + } + + // Test step 3 + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + // Test step 4 + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + + err = iApiClient->ViewListL( *app, *views ); + User::LeaveIfError( err ); + + for ( TInt i = 0; i < views->Array().Count(); i++ ) + { + CHsContentInfo* view = views->Array()[ i ]; + if ( view->Type().Compare( KInfoTypeView ) != 0 ) + { + User::Leave( KErrGeneral ); + } + } + + CleanupStack::PopAndDestroy( views ); + CleanupStack::PopAndDestroy( app ); + + // Test step 5 + DisconnectHsCcApiClient(); + } + +// ----------------------------------------------------------------------- +// CMTHsCcApiClient::AppViewListFails1L() +// +// Test purpose: +// The purpose of this test case is to verify that requesting of a +// view list fails if the view list is requested from a application +// configuration which cannot be found +// +// Pre conditions (SetupL()): +// Empty homescreen +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 1: +// Create CHsCcApiClient +// +// Expected result: +// Connection is successfully established +// +// Test step 2: +// Get active application configuration +// +// Expected result: +// Application configuration is successfully returned +// +// Test step 3: +// Get view list from invalid active application configuration +// +// Expected result: +// Request fails +// +// Test step 4: +// Delete CHsCcApiClient +// +// Expected result: +// Connection is successfully closed +// +// Post conditions (Teardown()): +// - +// +// ----------------------------------------------------------------------- +// +void CMTHsCcApiClient::AppViewListFails1L() + { + // Test step 1 + ConnectHsCcApiClientL( NULL ); + + // Test step 2 + CHsContentInfo* app = CHsContentInfo::NewL(); + CleanupStack::PushL( app ); + + TInt err = iApiClient->ActiveAppL( *app ); + User::LeaveIfError( err ); + + // Test step 3 + app->SetUidL( KNotFoundAppUid ); + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + + err = iApiClient->ViewListL( *app, *views ); + + if ( err != KErrArgument ) + { + User::Leave( KErrGeneral ); + } + + CleanupStack::PopAndDestroy( views ); + CleanupStack::PopAndDestroy( app ); + + // Test step 4 + DisconnectHsCcApiClient(); + } + +//------------------------------------------------------------------------------ +// Test case table +//------------------------------------------------------------------------------ +EUNIT_BEGIN_TEST_TABLE( + CMTHsCcApiClient, + "This is a test suite for Home screen Content Control API Client", + "UNIT" ) + + EUNIT_TEST( + "Connect/disconnect", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ConnectDisconnectHsCcApiClientL, Teardown ) + + EUNIT_TEST( + "Register/Unregister observer", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, RegisterUnregisterHsCcApiObserverL, Teardown ) + + EUNIT_TEST( + "Register/Unregister multiple observers", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, RegisterUnregisterMultipleObserversL, Teardown ) + + EUNIT_TEST( + "Widget List", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, WidgetListL, Teardown ) + + EUNIT_TEST( + "Add/Remove Widget", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AddRemoveWidgetL, Teardown ) + + EUNIT_TEST( + "Add Widget fails 1", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AddWidgetFails1L, Teardown ) + + EUNIT_TEST( + "Remove Widget fails 1", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, RemoveWidgetFails1L, Teardown ) + + EUNIT_TEST( + "Widget list change notification", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, WidgetListChangeNtfL, Teardown ) + + EUNIT_TEST( + "View List", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ViewListL, Teardown ) + + EUNIT_TEST( + "Add/Remove View", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AddRemoveViewL, Teardown ) + + EUNIT_TEST( + "Activate View", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ActivateViewL, Teardown ) + + EUNIT_TEST( + "Add View fails 1", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AddViewFails1L, Teardown ) + + EUNIT_TEST( + "Remove View fails 1", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, RemoveViewFails1L, Teardown ) + + EUNIT_TEST( + "View list change notification", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ViewListChangeNtfL, Teardown ) + + EUNIT_TEST( + "App list", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AppListL, Teardown ) + + EUNIT_TEST( + "Activate App", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ActivateAppL, Teardown ) + + EUNIT_TEST( + "Active App", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ActiveAppL, Teardown ) + + EUNIT_TEST( + "Active View", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ActiveViewL, Teardown ) + + EUNIT_TEST( + "Widget list of a view", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ViewWidgetList1L, Teardown ) + + EUNIT_TEST( + "Widget list of a view", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ViewWidgetList2L, Teardown ) + + EUNIT_TEST( + "Widget list of a view fails", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, ViewWidgetListFailsL, Teardown ) + + EUNIT_TEST( + "Widget list of an app", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AppWidgetList1L, Teardown ) + + EUNIT_TEST( + "Widget list of an app fails", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AppWidgetListFailsL, Teardown ) + + EUNIT_TEST( + "View list of an app mandatory views", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AppViewList1L, Teardown ) + + EUNIT_TEST( + "View list of an app view list full", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AppViewList2L, Teardown ) + + EUNIT_TEST( + "View list fails invalid app", + "CHsCcApiClient", + "", + "FUNCTIONALITY", + SetupL, AppViewListFails1L, Teardown ) + + EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -31,6 +31,8 @@ 0x10282E5A }; +const TInt KADatFactorySettingsServerPluginUid(0x102830EF); + // ======== MEMBER FUNCTIONS ======== // ---------------------------------------------------------------------------- @@ -167,18 +169,30 @@ void CHarvesterPluginValidator::UpdatePluginsL() { // set property value to 1 (which means "in progress") - iInProgressProperty.Set(TUid::Uid(KHarvesterUid), KInProgressPropertyKey, - 1); + iInProgressProperty.Set(TUid::Uid(KHarvesterUid), KInProgressPropertyKey, 1); + CContentHarvesterPlugin* plugin = NULL; + CContentHarvesterPlugin* fsplugin = + static_cast (GetImplementation( + TUid::Uid(KADatFactorySettingsServerPluginUid))); + + if (fsplugin) + { + iBlacklist->AppendL(TUid::Uid(KADatFactorySettingsServerPluginUid)); + TRAP_IGNORE( fsplugin->UpdateL() ); + iBlacklist->RemoveL(TUid::Uid(KADatFactorySettingsServerPluginUid)); + } for (TInt i = 0; i < iPluginArray.Count(); i++) { - //first we append UID to the blacklist - iBlacklist->AppendL(iPluginArray[i].iImplementationUid); - - TRAP_IGNORE( static_cast - ( iPluginArray[i].iPlugin )->UpdateL() ); - - //no panic during update so we can remove UID from blacklist - iBlacklist->RemoveL(iPluginArray[i].iImplementationUid); + plugin + = static_cast (iPluginArray[i].iPlugin); + if (plugin != fsplugin) + { + //first we append UID to the blacklist + iBlacklist->AppendL(iPluginArray[i].iImplementationUid); + TRAP_IGNORE( plugin->UpdateL() ); + //no panic during update so we can remove UID from blacklist + iBlacklist->RemoveL(iPluginArray[i].iImplementationUid); + } } // set property value to 0 (which means "finished") iInProgressProperty.Set(TUid::Uid(KHarvesterUid), KInProgressPropertyKey, diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def --- a/homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def Thu Jul 15 18:59:18 2010 +0300 @@ -6,26 +6,26 @@ ?hspsRemovePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 5 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemovePlugin(int, int) ?hspsInstallNextPhaseL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@AAVTDes8@@@Z @ 6 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL(class TDes8 &) ?GethspsResult@ChspsClient@@QAEXAAVChspsResult@@@Z @ 7 NONAME ; void ChspsClient::GethspsResult(class ChspsResult &) - ?NewLC@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 8 NONAME ; class ChspsClient * ChspsClient::NewLC(class MhspsThemeManagementServiceObserver &) - ?hspsInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@AAVChspsODT@@@Z @ 9 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(class TDesC16 const &, class ChspsODT &) - ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 10 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int) - ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &) - ?hspsReplacePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHH@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReplacePlugin(int, int, int) - ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 13 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class ChspsODT const &, class ChspsODT &) - ?hspsPluginUpdateL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 14 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsPluginUpdateL(class ChspsODT const &) - ?hspsInstallNextPhaseL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@AAVChspsODT@@@Z @ 15 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL(class ChspsODT &) - ?hspsAddPlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHHHAAH@Z @ 16 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsAddPlugin(int, int, int, int, int &) - ?hspsSetPluginSettings@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAVChspsDomDocument@@H@Z @ 17 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetPluginSettings(class ChspsODT const &, int, class ChspsDomDocument &, int) - ?hspsRestoreConfigurations@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HW4ThspsRestore@@@Z @ 18 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreConfigurations(int, enum ThspsRestore) - ?NewL@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 19 NONAME ; class ChspsClient * ChspsClient::NewL(class MhspsThemeManagementServiceObserver &) - ?SetLogBus@ChspsClient@@QAEXPAX@Z @ 20 NONAME ; void ChspsClient::SetLogBus(void *) - ?hspsSetActivePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 21 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActivePlugin(int, int) - ?hspsCancelInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 22 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsCancelInstallTheme(void) - ?hspsGetNextHeader@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 23 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetNextHeader(void) - ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, int, class CArrayPtrFlat &) - ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &) - ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *) - ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int, int) + ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@H@Z @ 8 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int) + ?NewLC@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 9 NONAME ; class ChspsClient * ChspsClient::NewLC(class MhspsThemeManagementServiceObserver &) + ?hspsInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@AAVChspsODT@@@Z @ 10 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(class TDesC16 const &, class ChspsODT &) + ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int) + ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &) + ?hspsReplacePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHH@Z @ 13 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReplacePlugin(int, int, int) + ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 14 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class ChspsODT const &, class ChspsODT &) + ?hspsPluginUpdateL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 15 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsPluginUpdateL(class ChspsODT const &) + ?hspsInstallNextPhaseL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@AAVChspsODT@@@Z @ 16 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL(class ChspsODT &) + ?hspsAddPlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHHHAAH@Z @ 17 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsAddPlugin(int, int, int, int, int &) + ?hspsSetPluginSettings@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAVChspsDomDocument@@H@Z @ 18 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetPluginSettings(class ChspsODT const &, int, class ChspsDomDocument &, int) + ?hspsRestoreConfigurations@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HW4ThspsRestore@@@Z @ 19 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreConfigurations(int, enum ThspsRestore) + ?NewL@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 20 NONAME ; class ChspsClient * ChspsClient::NewL(class MhspsThemeManagementServiceObserver &) + ?SetLogBus@ChspsClient@@QAEXPAX@Z @ 21 NONAME ; void ChspsClient::SetLogBus(void *) + ?hspsSetActivePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 22 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActivePlugin(int, int) + ?hspsCancelInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 23 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsCancelInstallTheme(void) + ?hspsGetNextHeader@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetNextHeader(void) + ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, int, class CArrayPtrFlat &) + ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &) + ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *) ?hspsMovePluginsL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHABV?$CArrayFixFlat@H@@@Z @ 28 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL(int, int, class CArrayFixFlat const &) ?hspsGetHeaders@ChspsClient@@QAEHABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 29 NONAME ; int ChspsClient::hspsGetHeaders(class ChspsODT const &, int, class CArrayPtrFlat &) ?hspsRemoveThemeL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 30 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(class ChspsODT const &) diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/client/hspsclient.cpp --- a/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -873,14 +873,12 @@ // ----------------------------------------------------------------------------- // EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf( - const TInt aAppUid, - const TInt aConfUid ) + const TInt aAppUid ) { ThspsServiceCompletedMessage ret = EhspsRestoreActiveAppConfFailed; ThspsParamRestoreActiveAppConf params; - params.appUid = aAppUid; - params.confUid = aConfUid; + params.appUid = aAppUid; ret = ( ThspsServiceCompletedMessage )iSession.RestoreActiveAppConf( iResultData, params ); diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def --- a/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Thu Jul 15 18:59:18 2010 +0300 @@ -24,7 +24,7 @@ _ZN11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 23 NONAME _ZN11ChspsClient22hspsCancelInstallThemeEv @ 24 NONAME _ZN11ChspsClient24hspsCancelGetListHeadersEv @ 25 NONAME - _ZN11ChspsClient24hspsRestoreActiveAppConfEii @ 26 NONAME + _ZN11ChspsClient24hspsRestoreActiveAppConfEi @ 26 NONAME _ZN11ChspsClient25hspsRestoreConfigurationsEi12ThspsRestore @ 27 NONAME _ZN11ChspsClient4NewLER35MhspsThemeManagementServiceObserver @ 28 NONAME _ZN11ChspsClient5NewLCER35MhspsThemeManagementServiceObserver @ 29 NONAME @@ -52,5 +52,5 @@ _ZThn32_N11ChspsClient19hspsSetActivePluginEii @ 51 NONAME _ZThn32_N11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 52 NONAME _ZThn32_N11ChspsClient24hspsCancelGetListHeadersEv @ 53 NONAME - _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEii @ 54 NONAME + _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEi @ 54 NONAME diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/inc/hspsinstaller.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsinstaller.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstaller.h Thu Jul 15 18:59:18 2010 +0300 @@ -68,6 +68,11 @@ ThspsServiceCompletedMessage InstallConfigurationL( const TDesC& aFileName ); + /** + * Get installation handler. + */ + ChspsInstallationHandler& InstallationHandler(); + public: // Functions from base classes /** diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Thu Jul 15 18:59:18 2010 +0300 @@ -438,8 +438,7 @@ * Not used - see ServiceRestoreActiveAppConfL instead which has a diffrent input */ ThspsServiceCompletedMessage hspsRestoreActiveAppConf( - const TInt /*aAppUid*/, - const TInt /*aConfUid*/ ); + const TInt /*aAppUid*/ ); /** * Updates plugin configuration in all application configuration @@ -639,16 +638,7 @@ const TInt aPluginUid, TInt& aInstanceCount ); - /** - * Removes plugin resources from the provided ODT - * @since S60 5.0 - * @param aAppODT is an instance of the the application configuration - * @param aPluginUid is an UID of the plugin instance - * @return KErrNone if succeeded - */ - TInt RemovePluginResourcesL( - ChspsODT& aAppODT, - const TInt aPluginUid ); + /** * Adds plugin resouces to the provided ODT diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h Thu Jul 15 18:59:18 2010 +0300 @@ -151,15 +151,26 @@ void ConstructL(); /** - * Retrieves manifest files from all internal drives in - * \\private\200159C0\install\ paths. - * @since S60 5.0 + * Retrieves manifest files from all internal drives under the + * \\private\200159C0\install\ path. + * @since S60 5.2 * @param aFileArray An array of file names */ - void FindInstallationFilesL( - RPointerArray& aFileArray ); + void FindInstallFilesL( + RPointerArray& aFileArray ); + void DoFindInstallFilesL( + RPointerArray& aFileArray, + const TDesC& aPath ); - void DoFindInstallationFilesL( + /** + * Retrieves manifest files from all internal drives under the + * \\private\200159C0\import\ path. + * @since S60 5.2 + * @param aFileArray An array of file names + */ + void FindImportFilesL( + RPointerArray& aFileArray ); + void DoFindImportFilesL( RPointerArray& aFileArray, const TDesC& aPath ); diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Thu Jul 15 18:59:18 2010 +0300 @@ -638,6 +638,16 @@ */ static TInt GetEmmcDrivePath( RFs& aFs ); + /** + * Removes all plugin resources from the provided ODT instance. + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginUid is an UID of the plugin instance + * @return KErrNone if succeeded + */ + static TInt RemovePluginResourcesL( + ChspsODT& aAppODT, + const TInt aPluginUid ); private: /** * Internal method. Do not call directly! diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Thu Jul 15 18:59:18 2010 +0300 @@ -737,6 +737,12 @@ void ConstructL(); /** + * Initialized headers. + * @since S60 5.2 + */ + void InitializeHeadersL(); + + /** * NewSessionL * @since S60 3.1 */ diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -163,8 +163,7 @@ // ----------------------------------------------------------------------------- // ChspsInstallationHandler::~ChspsInstallationHandler() - { - iFsSession.Close(); + { delete iXmlParser; delete iOdt; delete iDtdFile; @@ -196,8 +195,8 @@ delete iDefEngine; } - REComSession::FinalClose(); - + iFsSession.Close(); + REComSession::FinalClose(); } @@ -210,6 +209,8 @@ // void ChspsInstallationHandler::ConstructL() { + User::LeaveIfError( iFsSession.Connect() ); + _LIT8(KMimeType, "text/xml"); MContentHandler* contentHandler = this; iXmlParser = Xml::CParser::NewL( KMimeType, *contentHandler ); @@ -219,11 +220,11 @@ iOdt = ChspsODT::NewL(); iResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); iTempLocalizedResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); - User::LeaveIfError( iFsSession.Connect() ); + iResult = ChspsResult::NewL(); - - iMultiInstanceFound = EFalse; + iXmlFile = KNullDesC().AllocL(); + iMultiInstanceFound = EFalse; } // ----------------------------------------------------------------------------- @@ -955,7 +956,48 @@ iOdt->SetConfigurationType( iConfigurationType ); iOdt->SetFlags( iThemeStatus ); - + + // Check that there is only one restorable application configuration + // for a client in a device family + if( iOdt->Flags() & EhspsThemeStatusLicenceeRestorable + && iConfigurationType == EhspsAppConfiguration ) + { + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetRootUid( iOdt->RootUid() ); + searchMask->SetFlags( EhspsThemeStatusLicenceeRestorable ); + + TInt pos( 0 ); + ChspsODT* header = NULL; + iThemeServer.GetConfigurationHeader( *searchMask, header, pos ); + while( header ) + { + // If another plugin has already been installed with the restorable status + if( header->Family() & iOdt->Family() + && header->ThemeUid() != iOdt->ThemeUid() ) + { + // Unset the restorable bit + TUint flags = iOdt->Flags(); + flags &= ~EhspsThemeStatusLicenceeRestorable; + iOdt->SetFlags( flags ); +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - too many restorable plugins were found!" ) ); + } +#endif + break; + } + + // Get next application configuration header + pos++; + iThemeServer.GetConfigurationHeader( *searchMask, header, pos ); + } + + header = NULL; + CleanupStack::PopAndDestroy(); + } + // If configuration file is missing if( !iXmlFile ) { diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/src/hspsinstaller.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsinstaller.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstaller.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -100,6 +100,15 @@ } // ----------------------------------------------------------------------------- +// CHSPSInstaller::InstallationHandler +// ----------------------------------------------------------------------------- +// +ChspsInstallationHandler& CHSPSInstaller::InstallationHandler() + { + return *iInstallationHandler; + } + +// ----------------------------------------------------------------------------- // CHSPSInstaller::RunError // ----------------------------------------------------------------------------- // diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -1891,7 +1891,7 @@ // Remove plugin resources from the application configuration: // By default remove all plugin's resources from all instances // - otherwise, after upgrades, there might be various versions of the same resources - err = RemovePluginResourcesL( aAppODT, pluginUid ); + err = hspsServerUtil::RemovePluginResourcesL( aAppODT, pluginUid ); if ( !err ) { // If the application configuration holds other instances of the same plugin @@ -2015,31 +2015,7 @@ CleanupStack::PopAndDestroy( iter ); } -// ----------------------------------------------------------------------------- -// Removes plugin resources from the provided ODT -// ----------------------------------------------------------------------------- -// -TInt ChspsMaintenanceHandler::RemovePluginResourcesL( - ChspsODT& aAppODT, - const TInt aPluginUid ) - { - // Loop resources of the application configuration - for(TInt aresIndex = 0; aresIndex < aAppODT.ResourceCount(); aresIndex++ ) - { - ChspsResource& ares = aAppODT.ResourceL( aresIndex ); - - // If the plugin resource was found at resource list of the application configuration - if ( ares.ConfigurationUid() == aPluginUid ) - { - // Deletes resource from the application configuration - aAppODT.DeleteResourceL( aresIndex ); - aresIndex--; - } - - } - - return KErrNone; - } + // ----------------------------------------------------------------------------- // Adds plugin resources to the provided application ODT @@ -2783,12 +2759,18 @@ ThspsParamRestoreActiveAppConf params; TPckg packagedStruct( params ); aMessage.ReadL( 1, packagedStruct ); + + // Get active root configuration for the application + TInt confUid = 0; + User::LeaveIfError( + iCentralRepository.Get( params.appUid, confUid ) + ); // Create search criteria ChspsODT* searchMask = ChspsODT::NewL(); CleanupStack::PushL( searchMask ); searchMask->SetRootUid( params.appUid ); - searchMask->SetThemeUid( params.confUid ); + searchMask->SetThemeUid( confUid ); // Get configuration header ChspsODT* confHeader( NULL ); @@ -3469,7 +3451,7 @@ if ( processedCount ) { // Remove uninstalled resources from the server (copies will remain in client's private directory) - RemovePluginResourcesL( aAppODT, aPluginUid ); + hspsServerUtil::RemovePluginResourcesL( aAppODT, aPluginUid ); // Store changes User::LeaveIfError( iDefinitionRepository.SetOdtL( aAppODT ) ); @@ -3660,7 +3642,7 @@ TInt err(KErrNone); // remove old resources - err = RemovePluginResourcesL( aOdt, aPluginOdt.ThemeUid() ); + err = hspsServerUtil::RemovePluginResourcesL( aOdt, aPluginOdt.ThemeUid() ); if( err ) { @@ -3844,8 +3826,7 @@ // ----------------------------------------------------------------------------- // ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsRestoreActiveAppConf( - const TInt /*aAppUid*/, - const TInt /*aConfUid*/ ) + const TInt /*aAppUid*/ ) { return EhspsServiceNotSupported; } @@ -4522,20 +4503,15 @@ void ChspsMaintenanceHandler::RestoreDefaultAppConfL( ChspsODT*& aHeader, ChspsODT& aOdt) - { - - // If active application configuration is LicenceeRestorable - if ( aHeader->Flags() & EhspsThemeStatusLicenceeRestorable ) - { - // Reinstall the configuration from ROM - iThemeServer.ReinstallConfL( aHeader->RootUid(), aHeader->ThemeUid() ); - } - else - { + { + // If active application configuration is not "LicenceeRestorable" + if ( !(aHeader->Flags() & EhspsThemeStatusLicenceeRestorable) ) + { // Try to activate a configuation with the LicenceeRestorable status ChspsODT* searchMask = ChspsODT::NewL(); CleanupStack::PushL( searchMask ); searchMask->SetRootUid( aHeader->RootUid() ); + searchMask->SetFamily( aHeader->Family() ); searchMask->SetFlags( EhspsThemeStatusLicenceeRestorable ); TInt pos( 0 ); iThemeServer.GetConfigurationHeader( *searchMask, aHeader, pos ); @@ -4548,12 +4524,17 @@ } else { - // Licensee restorable configuration not found - // There must be at least one licensee restorable configuration + // Licensee restorable configuration not found. There must be + // at least one licensee restorable configuration per application User::Leave( KErrNotFound ); } CleanupStack::PopAndDestroy( searchMask ); - } + } + else + { + // Reinstall the application configuration from ROM + iThemeServer.ReinstallConfL( aHeader->RootUid(), aHeader->ThemeUid() ); + } } // ----------------------------------------------------------------------------- @@ -4737,29 +4718,9 @@ // void ChspsMaintenanceHandler::HandleReinstallationL( const TBool aInstallUdaEmmc ) - { + { // Install plug-in configurations from the "install" directories iThemeServer.InstallWidgetsL( aInstallUdaEmmc ); - if( aInstallUdaEmmc ) - { - // Install plug-in configurations from the "import" directories in C - // and emmc(if exists) - iThemeServer.InstallUDAWidgetsL( KImportDirectoryC ); - - TInt drive = hspsServerUtil::GetEmmcDrivePath( - iServerSession->FileSystem() ); - if ( drive != KErrNotFound ) - { - TDriveUnit unit(drive); - HBufC* importDirectoryE = HBufC::NewLC( - KImportDirectory().Length() + unit.Name().Length() ); - importDirectoryE->Des().Append( unit.Name() ); - importDirectoryE->Des().Append( KImportDirectory ); - - iThemeServer.InstallUDAWidgetsL( *importDirectoryE ); - CleanupStack::PopAndDestroy( importDirectoryE ); - } - } // Force updating of the header cache iThemeServer.UpdateHeaderListCacheL(); diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -28,13 +28,15 @@ #include "hspsserverutil.h" _LIT(KPrivateInstallC, "C:\\private\\200159c0\\install\\"); -_LIT(KPrivateInstallE, "E:\\private\\200159c0\\install\\"); +_LIT(KPrivateInstall, "\\private\\200159c0\\install\\"); _LIT(KPrivateInstallZ, "Z:\\private\\200159c0\\install\\"); _LIT(KBackslash, "\\"); _LIT(KHsps, "hsps"); _LIT(KTestLanguage, "00"); _LIT(KManifest, "manifest.dat"); + +const TInt KExcludedDrives = KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted; // ========================= LOCAL FUNCTIONS ================================== @@ -137,9 +139,12 @@ RPointerArray fileArray; CleanupResetAndDestroyPushL( fileArray ); - // Find the manifest files - FindInstallationFilesL( fileArray ); - + // Find manifest files from the "install" directories + FindInstallFilesL( fileArray ); + + // Find manifest files from the "imports" directories + FindImportFilesL( fileArray ); + // Install the manifest files for( TInt index=0; index < fileArray.Count(); index++ ) { @@ -163,38 +168,145 @@ CleanupStack::PopAndDestroy(); // fileArray } +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::FindImportFilesL() +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::FindImportFilesL( + RPointerArray& aFileArray ) + { + if( iInstallUdaEmmc ) + { + // If eMMC is present + TInt drive = hspsServerUtil::GetEmmcDrivePath( iFsSession ); + if ( drive != KErrNotFound ) + { + TDriveUnit unit(drive); + + HBufC* path = HBufC::NewLC( + KImportDirectory().Length() + unit.Name().Length() ); + path->Des().Append( unit.Name() ); + path->Des().Append( KImportDirectory ); + + // Find manifest files from eMMC + DoFindImportFilesL( aFileArray, *path ); + + CleanupStack::PopAndDestroy( path ); + } + + // Find manifest files from C + DoFindImportFilesL( aFileArray, KImportDirectoryC ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DoFindImportFilesL() +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::DoFindImportFilesL( + RPointerArray& aFileArray, + const TDesC& aPath ) + { + _LIT(KDat, ".dat"); + CDir* importDir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.SetFindMask( KExcludedDrives ); + fileFinder.FindWildByPath( aPath, NULL, importDir ); + if ( importDir ) + { + CleanupStack::PushL( importDir ); + + for ( TInt i=0; i < importDir->Count(); i++ ) + { + const TEntry& dirEntry = (*importDir)[i]; + if ( !dirEntry.IsDir() + && dirEntry.iName.FindF( KDat ) > 0 ) + { + // Get path to the manifest file + HBufC* manifestBuf = + iThemeServer.GetManifestFromImportLC( dirEntry.iName, aPath ); + if( !manifestBuf ) + { + continue; + } + + // Check for duplicates + TBool isShadowed = EFalse; + TParsePtrC manifestPtr( *manifestBuf ); + for( TInt i=0; i < aFileArray.Count(); i++ ) + { + TParsePtrC ptr( aFileArray[i]->Des() ); + if( ptr.Path() == manifestPtr.Path() ) + { + isShadowed = ETrue; + break; + } + } + + if( !isShadowed ) + { + if( BaflUtils::FileExists( iFsSession, *manifestBuf ) ) + { + HBufC* nameBuf = manifestBuf->Des().AllocLC(); + aFileArray.AppendL( nameBuf ); + CleanupStack::Pop( nameBuf ); + } + } + + CleanupStack::PopAndDestroy( manifestBuf ); + } + } + + CleanupStack::PopAndDestroy( importDir ); + } + } // ----------------------------------------------------------------------------- // ChspsRomInstaller::FindInstallationFilesL() // ----------------------------------------------------------------------------- // -void ChspsRomInstaller::FindInstallationFilesL( +void ChspsRomInstaller::FindInstallFilesL( RPointerArray& aFileArray ) { __ASSERT_DEBUG( aFileArray.Count() == 0, User::Leave( KErrArgument ) ); if( iInstallUdaEmmc ) { - // Handle installation of the imaker exports - DoFindInstallationFilesL( aFileArray, KPrivateInstallE ); - DoFindInstallationFilesL( aFileArray, KPrivateInstallC ); + // If eMMC is present + TInt drive = hspsServerUtil::GetEmmcDrivePath( iFsSession ); + if ( drive != KErrNotFound ) + { + TDriveUnit unit(drive); + + HBufC* path = HBufC::NewLC( + KPrivateInstall().Length() + unit.Name().Length() ); + path->Des().Append( unit.Name() ); + path->Des().Append( KPrivateInstall ); + + // Find manifest files from eMMC + DoFindInstallFilesL( aFileArray, *path ); + + CleanupStack::PopAndDestroy( path ); + } + + // Find manifest files from C + DoFindInstallFilesL( aFileArray, KPrivateInstallC ); } - // ROM - DoFindInstallationFilesL( aFileArray, KPrivateInstallZ ); + // Find manifest files from Z + DoFindInstallFilesL( aFileArray, KPrivateInstallZ ); } // ----------------------------------------------------------------------------- -// ChspsRomInstaller::DoFindInstallationFilesL() +// ChspsRomInstaller::DoFindInstallFilesL() // ----------------------------------------------------------------------------- // -void ChspsRomInstaller::DoFindInstallationFilesL( +void ChspsRomInstaller::DoFindInstallFilesL( RPointerArray& aFileArray, const TDesC& aPath ) { TFindFile fileFinder( iFsSession ); - fileFinder.SetFindMask( - KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted ); + fileFinder.SetFindMask( KExcludedDrives ); CDir* dirList( NULL ); fileFinder.FindWildByPath( aPath, NULL, dirList ); if ( dirList ) diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -30,7 +30,7 @@ #include "bautils.h" #include "sysutil.h" #include -#include +#include _LIT(KHspsFolder, "\\200159c0\\themes\\" ); @@ -724,17 +724,7 @@ aTargetPath, 0, KEntryAttReadOnly, - TTime( 0 ) ); // TTime(0) = preserve original time stamp. - -#ifdef HSPS_LOG_ACTIVE - if ( iLogBus ) - { - iLogBus->LogText( - _L( "hspsServerUtil::CopyResourceFileL(): - %S was copied" ), - &aTargetPath - ); - } -#endif + TTime( 0 ) ); // TTime(0) = preserve original time stamp. } } @@ -2225,6 +2215,32 @@ } // ----------------------------------------------------------------------------- +// Removes plugin resources from the provided ODT +// ----------------------------------------------------------------------------- +// +TInt hspsServerUtil::RemovePluginResourcesL( + ChspsODT& aAppODT, + const TInt aPluginUid ) + { + // Loop resources of the application configuration + for(TInt aresIndex = 0; aresIndex < aAppODT.ResourceCount(); aresIndex++ ) + { + ChspsResource& ares = aAppODT.ResourceL( aresIndex ); + + // If the plugin resource was found at resource list of the application configuration + if ( ares.ConfigurationUid() == aPluginUid ) + { + // Deletes resource from the application configuration + aAppODT.DeleteResourceL( aresIndex ); + aresIndex--; + } + + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- // hspsServerUtil::hspsServerUtil // ----------------------------------------------------------------------------- // diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -347,7 +347,7 @@ #endif // Find header files from the Plug-in Repository - UpdateHeaderListCacheL(); + TRAP_IGNORE( UpdateHeaderListCacheL() ); // Initialize remove index iThemeIndexToRemove = KErrNotFound; @@ -357,26 +357,17 @@ // Start observing the notifications iDefinitionRepository->RegisterObserverL( *this ); - - + #if defined(WINSCW) || defined(__WINS__) // Resolution & orientation change listener iFamily = ChspsFamilyListener::NewL( *this ); #else iFamily = ChspsFamily::NewL(); #endif //defined(WINSCW) || defined(__WINS__) - - // Auto-localize ODTs in the Definition Repository when the device language has changed - HandleLanguageChangeL(); - - // Installs manifest files from the ROM drive when server is starting for the first time - HandleRomInstallationsL(); - -#ifndef __DISABLE_SISX_INSTALLATION_ - // Start observing of import folder to enable autoinstallations - EnableAutoInstallationL(); -#endif //__DISABLE_SISX_INSTALLATION_ - + + // These might leave if configurations are invalid + TRAP_IGNORE( InitializeHeadersL() ); + // Update configurations // When server is started all configurations with "WaitForConfirmation" state are updated // to "NotConfirmed" state to allow client to validate configurations @@ -407,6 +398,20 @@ #endif } +void ChspsThemeServer::InitializeHeadersL() + { + // Auto-localize ODTs in the Definition Repository when the device language has changed + HandleLanguageChangeL(); + + // Reinstall plug-ins/handle FOTA updates + HandleRomInstallationsL(); + +#ifndef __DISABLE_SISX_INSTALLATION_ + // Start observing of import folder to enable autoinstallations + EnableAutoInstallationL(); +#endif //__DISABLE_SISX_INSTALLATION_ + } + // Destructor ChspsThemeServer::~ChspsThemeServer() { @@ -2174,7 +2179,9 @@ if ( res.Count() == 0 ) { #ifdef HSPS_LOG_ACTIVE - iLogBus->LogText( _L( "ChspsThemeServer::HandleLanguageChangeL(): - Couldn't find %d key from the HSPS cenrep!" ), KCenrepLangKey ); + iLogBus->LogText( + _L( "ChspsThemeServer::HandleLanguageChangeL(): - Couldn't find %d key from the HSPS cenrep!" ), + KCenrepKeyLang ); #endif User::Leave( KErrNotFound ); @@ -2752,27 +2759,9 @@ if( ( errorCode == KErrNone ) && ( fwVersion.Length() == 0 ) ) { - // Install widgets from \private\200159C0\install\ directories (ROM and UDA image) - InstallWidgetsL(); - - // Install widgets from \private\200159C0\imports\ directory - //from c (UDA image) and from emmc - InstallUDAWidgetsL( KImportDirectoryC ); + // Install widgets from install and import directories (eMMC, UDA ROM) + InstallWidgetsL( ETrue ); - TInt drive = hspsServerUtil::GetEmmcDrivePath( iFsSession ); - if ( drive != KErrNotFound ) - { - TDriveUnit unit(drive); - HBufC* importDirectoryE = HBufC::NewLC( - KImportDirectory().Length() + unit.Name().Length() ); - - importDirectoryE->Des().Append( unit.Name() ); - importDirectoryE->Des().Append( KImportDirectory ); - - InstallUDAWidgetsL( *importDirectoryE ); - CleanupStack::PopAndDestroy( importDirectoryE ); - } - // Post RFS installations have been done, prevent re-installations at next startup // by reading firmware version and saving it to cenrep. GetFWVersion( fwVersion ); @@ -2805,7 +2794,8 @@ { // Phone software has been updated. CreateBackupDataL(); - InstallWidgetsL(); + InstallWidgetsL( EFalse ); + // Restore the personalization RestoreApplicationConfigurationsL(); // Save new firmware version to cenrep if ( errorCode == KErrNone ) @@ -2855,7 +2845,10 @@ const TBool aInstallUdaEmmc ) { __ASSERT_DEBUG( !iRomInstaller, User::Leave( KErrGeneral) ); - iRomInstaller = ChspsRomInstaller::NewL( *this, iFsSession, aInstallUdaEmmc ); + iRomInstaller = ChspsRomInstaller::NewL( + *this, + iFsSession, + aInstallUdaEmmc ); #ifdef HSPS_LOG_ACTIVE iRomInstaller->SetLogBus( iLogBus ); #endif @@ -2879,14 +2872,17 @@ TInt& aPos ) { ChspsODT* header( NULL ); - TBool rootUidMatch( ETrue ); - TBool themeUidMatch( ETrue ); - TBool flagsMatch( ETrue ); - TBool typeMatch( ETrue ); aConfHeader = NULL; for ( TInt i = aPos; i < iHeaderListCache->Count() && aConfHeader == NULL; i++ ) { + TBool rootUidMatch( ETrue ); + TBool themeUidMatch( ETrue ); + TBool flagsMatch( ETrue ); + TBool typeMatch( ETrue ); + TBool familyMatch( ETrue ); + header = iHeaderListCache->At(i); + if ( aSearchMask.RootUid() && aSearchMask.RootUid() != header->RootUid() ) { @@ -2913,19 +2909,18 @@ { typeMatch = EFalse; } + if ( aSearchMask.Family() && + !( aSearchMask.Family() & header->Family() ) ) + { + // Family does not match + familyMatch = EFalse; + } // else configuration type ignored - if ( rootUidMatch && themeUidMatch && flagsMatch && typeMatch ) + if ( rootUidMatch && themeUidMatch && flagsMatch && typeMatch && familyMatch ) { aConfHeader = header; aPos = i; } - else - { - rootUidMatch = ETrue; - themeUidMatch = ETrue; - flagsMatch = ETrue; - typeMatch = ETrue; - } } } @@ -3045,6 +3040,8 @@ DisableAutoInstallation(); // Restore imported configurations from backup/import folder RestoreImportedConfigurationsL(); + // Update cache + UpdateHeaderListCacheL(); // Restore application configurations from backup/themes folder RestoreApplicationConfigurationsL(); // Restore completed @@ -3212,6 +3209,7 @@ // Install found configurations TInt err( KErrNone ); CHSPSInstaller* installer = CHSPSInstaller::NewL( *this ); + installer->InstallationHandler().DisableNotifications(); CleanupStack::PushL( installer ); for ( TInt i = 0; i < files.Count(); i++ ) { @@ -3408,18 +3406,12 @@ if ( err != KErrNone ) { - // Invalid configuration + // Set plugin configuration to "error" state state.Set( KConfStateError ); - // Delete related resource files - const TInt count = aOdt.ResourceCount(); - for( TInt j( 0 ); j < count; j++ ) - { - ChspsResource& resource = aOdt.ResourceL( j ); - if( resource.ConfigurationUid() == uids[ i ] ) - { - aOdt.DeleteResourceL( j ); - } - } + + // Remove missing plugins, thus there will be no error note later on + hspsServerUtil::RemovePluginResourcesL( aOdt, uids[ i ] ); + } else if ( state.CompareF( KConfStateError ) != 0 ) { @@ -3621,11 +3613,11 @@ // Skip family change if it's already up to date TInt activeConfigurationUid = -1; - User::LeaveIfError( - iCentralRepository->Get( - header->RootUid(), - activeConfigurationUid ) - ); + const TInt err = iCentralRepository->Get( header->RootUid(), activeConfigurationUid ); + if( err ) + { + continue; + } // Notify each client only once TBool alreadyIncluded = EFalse; @@ -3641,9 +3633,23 @@ if ( !alreadyIncluded ) { notificationTargets.Append( header ); - - TBool updateRequired = ( activeConfigurationUid != header->ThemeUid() ); - if ( updateRequired ) + + // Check if active configuration supports the current family + TBool updateRequired = ETrue; + for( TInt i=0; i < iHeaderListCache->Count(); i++ ) + { + ChspsODT* h = iHeaderListCache->At( i ); + if( h->ThemeUid() == activeConfigurationUid ) + { + if( (ThspsFamily)h->Family() & aNewFamily ) + { + // No need to change the active root configuration + updateRequired = EFalse; + break; + } + } + } + if( updateRequired && activeConfigurationUid != header->ThemeUid() ) { // Activate the resolution specific theme ChspsODT* newOdt = ChspsODT::NewL(); diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/inc/hsps_builds_cfg.hrh --- a/homescreenpluginsrv/inc/hsps_builds_cfg.hrh Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/inc/hsps_builds_cfg.hrh Thu Jul 15 18:59:18 2010 +0300 @@ -66,7 +66,6 @@ #define _hsps_SERVER_SHUTDOWN_ENABLED_ #ifdef _hsps_DEBUG_ - #define _hsps_PERFORMANCE_TEST_ #if defined(WINSCW) || defined(__WINS__) #define _hsps_EMULATOR_SUPPORT_ #endif diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/inc/hspsclient.h --- a/homescreenpluginsrv/inc/hspsclient.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/inc/hspsclient.h Thu Jul 15 18:59:18 2010 +0300 @@ -403,8 +403,7 @@ * From MhspsMaintenanceService */ IMPORT_C ThspsServiceCompletedMessage hspsRestoreActiveAppConf( - const TInt aAppUid, - const TInt aConfUid ); + const TInt aAppUid ); /** * Updates plugin configuration in all application configuration diff -r 9e077f9a342c -r 2c7f27287390 homescreenpluginsrv/inc/hspsthememanagement.h --- a/homescreenpluginsrv/inc/hspsthememanagement.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreenpluginsrv/inc/hspsthememanagement.h Thu Jul 15 18:59:18 2010 +0300 @@ -180,7 +180,7 @@ const TInt KMaxHeaderDataLength8=512; /** KHeaderListGranularity. List granularity used in header listing operations: */ -const TInt KHeaderListGranularity = 4; +const TInt KHeaderListGranularity = 8; /** * KHeaderListUpdatePollingTimeSpan. The time between the subsequent @@ -1006,8 +1006,7 @@ */ struct ThspsParamRestoreActiveAppConf { - TInt appUid; // uid of the application - TInt confUid; // uid of the restored configuration + TInt appUid; // uid of the application }; /** @@ -1466,13 +1465,11 @@ /** * Restores active application configuration * @since S60 5.0 - * @param aAppUid identifies the application which configuration is requested to be restored - * @param aConfUid identifies the configuration to be restored + * @param aAppUid identifies the application which configuration is requested to be restored * @return ThspsServiceCompletedMessage expressing the result of the call. */ virtual ThspsServiceCompletedMessage hspsRestoreActiveAppConf( - const TInt aAppUid, - const TInt aConfUid ) = 0; + const TInt aAppUid ) = 0; /** * Updates plugin configuration in all application configurations diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Thu Jul 15 18:59:18 2010 +0300 @@ -237,7 +237,15 @@ * @return Converted unicode-encoded (16 bit) string. */ HBufC* StdStringToUnicodeLC( const std::string& aSrcString ) const; - + + /** + * Convert template name if needed + * + * @param aSrcString utf8-encoded std::string. + * @return Converted utf8-encoded std::string. + */ + std::string TemplateName(const std::string &aSrcTemplate); + private: std::vector mWidgets; diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp --- a/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -83,6 +83,7 @@ std::string& aWidgetName, std::string& aIdentifier, std::string& aDescription, std::string& aIconLocation) { + aTemplateName = TemplateName( aTemplateName ); if( CheckIfWidgetExist( aTemplateName, aWidgetName, aIdentifier, EFalse ) ) { throw HsException( KErrAlreadyExists ); @@ -543,6 +544,7 @@ std::string& aWidgetName, std::string& aIdentifier ) { + aTemplateName = TemplateName( aTemplateName ); HsWidget* ret( 0 ); int count = mWidgets.size(); for (int index = 0; index < count; index++) @@ -637,6 +639,7 @@ std::string& aWidgetName, std::string& aIdentifier ) { + aTemplateName = TemplateName( aTemplateName ); HsWidget* ret( 0 ); int count = mWidgets.size(); for (int index = 0; index < count; index++) @@ -816,8 +819,7 @@ CLiwDefaultMap* aDataMap ) { __ASSERT_ALWAYS( aDataMap, User::Invariant() ); - - HBufC* templateType = StdStringToUnicodeLC( aWidget.getTemplateName() ); + HBufC* templateType = StdStringToUnicodeLC( TemplateName (aWidget.getTemplateName()) ); HBufC* widgetName = StdStringToUnicodeLC( aWidget.getWidgetName() ); aDataMap->InsertL( KTemplateType, TLiwVariant( *templateType ) ); @@ -1086,3 +1088,19 @@ aSrcString.c_str() ); return Utf8ToUnicodeLC( srcDescriptor ); } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +std::string HsWidgetPublisherImpl::TemplateName(const std::string &aSrcTemplate) + { + // In 9.2 HS wideimage template is reserved for wrt and cwrt widget. + // to support backward(5.0) compatability posterwideimage template + // will be usedfor wideimage template + if (aSrcTemplate == std::string("wideimage") ) + { + return std::string("posterwideimage"); + } + return aSrcTemplate; + } diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Thu Jul 15 18:59:18 2010 +0300 @@ -6,9 +6,9 @@ ?RemovePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 5 NONAME ; void CHspsPersonalisationService::RemovePluginL(int, class TDesC8 &) ?SetActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 6 NONAME ; void CHspsPersonalisationService::SetActiveAppConfL(int, class TDesC8 &) ?GetPluginListL@CHspsPersonalisationService@@QAEXAAVTDesC8@@0KHAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 7 NONAME ; void CHspsPersonalisationService::GetPluginListL(class TDesC8 &, class TDesC8 &, unsigned long, int, class CArrayPtrFlat &) - ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 8 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int, class TDesC8 &) - ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 9 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &) - ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 10 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *) + ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 8 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &) + ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 9 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *) + ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXH@Z @ 10 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int) ?GetAppUidL@CHspsConfigurationService@@QAEXAAH@Z @ 11 NONAME ; void CHspsConfigurationService::GetAppUidL(int &) ?MovePluginsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAV?$CArrayFixFlat@H@@@Z @ 12 NONAME ; void CHspsPersonalisationService::MovePluginsL(int, class TDesC8 &, class CArrayFixFlat &) ?RegisterObserverL@CHspsConfigurationService@@QAEHPAVCHspsReqNotifCallback@@@Z @ 13 NONAME ; int CHspsConfigurationService::RegisterObserverL(class CHspsReqNotifCallback *) diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Thu Jul 15 18:59:18 2010 +0300 @@ -19,7 +19,7 @@ _ZN27CHspsPersonalisationService16SetActivePluginLEiR6TDesC8 @ 18 NONAME _ZN27CHspsPersonalisationService17SetActiveAppConfLEiR6TDesC8 @ 19 NONAME _ZN27CHspsPersonalisationService18SetPluginSettingsLEiR6TDesC8R16ChspsDomDocumenti @ 20 NONAME - _ZN27CHspsPersonalisationService21RestoreActiveAppConfLEiR6TDesC8 @ 21 NONAME + _ZN27CHspsPersonalisationService21RestoreActiveAppConfLEi @ 21 NONAME _ZN27CHspsPersonalisationService22RestoreConfigurationsLEiNS_8TRestoreE @ 22 NONAME _ZN27CHspsPersonalisationService4NewLEv @ 23 NONAME _ZTI25CHspsConfigurationService @ 24 NONAME diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Thu Jul 15 18:59:18 2010 +0300 @@ -47,7 +47,8 @@ enum TRestore { - EDefault, + EDefault, + EAll, ERom, EViews }; @@ -218,12 +219,10 @@ /** * Restore active application configuration - * @param aAppUid - application uid - * @param aConfId - configuration id + * @param aAppUid - application uid */ IMPORT_C void RestoreActiveAppConfL( - TInt aAppUid, - TDesC8& aConfUid ); + TInt aAppUid ); /** * Activates defined plugin in plugin list diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -347,16 +347,11 @@ // Restore active application configuration // ----------------------------------------------------------------------------- EXPORT_C void CHspsPersonalisationService::RestoreActiveAppConfL( - TInt aAppUid, - TDesC8& aConfUid ) - { - - const TInt confUid = HspsServiceUtilities::HexString2IntL( aConfUid ); - + TInt aAppUid ) + { // Set configuration state - const ThspsServiceCompletedMessage ret = iHspsClient->hspsRestoreActiveAppConf( - aAppUid, - confUid ); + const ThspsServiceCompletedMessage ret = + iHspsClient->hspsRestoreActiveAppConf( aAppUid ); if ( ret != EhspsRestoreActiveAppConfSuccess ) { @@ -434,8 +429,8 @@ const TInt aAppUid, const TRestore aOperation ) { - ThspsRestore operation( EhspsRestoreAll ); - if( aOperation == EDefault ) + ThspsRestore operation( EhspsRestoreAll ); + if( aOperation == EAll ) { operation = EhspsRestoreAll; } diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh --- a/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Thu Jul 15 18:59:18 2010 +0300 @@ -73,6 +73,7 @@ _LIT8( KHspsLiwStoreAppConf, "storeAppConf" ); _LIT8( KHspsLiwRestore, "restore" ); _LIT8( KHspsLiwRestoreDefault, "default"); +_LIT8( KHspsLiwRestoreAll, "all"); _LIT8( KHspsLiwRestoreRom, "rom"); _LIT8( KHspsLiwRestoreViews, "views"); diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -359,18 +359,11 @@ state ); if ( state.Compare( KConfStateError ) == 0 ) - { - // Restore active application configuration - TPtrC8 confUid; - CHspsLiwUtilities::GetAttributeValueL( - *node, - KConfigurationAttrUid, - confUid ); + { TInt appUid; iHspsConfigurationService->GetAppUidL( appUid ); iHspsPersonalisationService->RestoreActiveAppConfL( - appUid, - confUid ); + appUid ); // Invalidate ODT. iHspsConfigurationService->InvalidateODT(); @@ -1200,6 +1193,10 @@ { operation = CHspsPersonalisationService::EDefault; } + else if( restorePtr.CompareF( KHspsLiwRestoreAll ) == 0 ) + { + operation = CHspsPersonalisationService::EAll; + } else if( restorePtr.CompareF( KHspsLiwRestoreRom ) == 0 ) { operation = CHspsPersonalisationService::ERom; @@ -1216,8 +1213,17 @@ // Get client application's uid TInt appUid; iHspsConfigurationService->GetAppUidL( appUid ); - - iHspsPersonalisationService->RestoreConfigurationsL( appUid, operation ); + + if( operation == CHspsPersonalisationService::EDefault ) + { + // Try to activate another application configuration which has a restorable status + iHspsPersonalisationService->RestoreActiveAppConfL( appUid ); + } + else + { + // Re-install or strip plugins + iHspsPersonalisationService->RestoreConfigurationsL( appUid, operation ); + } // Invalidate ODT. iHspsConfigurationService->InvalidateODT(); diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hsps.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hsps.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hsps.h Thu Jul 15 18:59:18 2010 +0300 @@ -19,8 +19,8 @@ #ifndef C_MT_HSPS_H #define C_MT_HSPS_H -#include -#include +#include +#include #include #include diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include #include "mt_hsps.h" #include "mt_hspsteststep.h" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include "mt_hspsteststep.h" #ifdef HSPS_LOG_ACTIVE diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/bld.inf --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/bld.inf Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -16,16 +16,18 @@ */ -#include "../hspsconfigurationif/group/bld.inf" -#include "../hspsprovider/group/bld.inf" - - PRJ_PLATFORMS PRJ_EXPORTS PRJ_MMPFILES +PRJ_TESTEXPORTS + PRJ_TESTMMPFILES +#include "../hspsconfigurationif/group/bld.inf" +#include "../hspsprovider/group/bld.inf" +#include "../testthemes/group/bld.inf" + // End of file diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Thu Jul 15 18:59:18 2010 +0300 @@ -37,108 +37,4 @@ "\epoc32\release\armv5\urel\mt_hspsprovider.dll"-"c:\sys\bin\mt_hspsprovider.dll" ; Test configurations - -; MinimalConfiguration - Widget -"../testthemes/minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" -"../testthemes/minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" -"../testthemes/minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" - -; MinimalConfiguration - View -"../testthemes/minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" -"../testthemes/minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" -"../testthemes/minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" -"../testthemes/minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" -"../testthemes/minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" -"../testthemes/minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" -"../testthemes/minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" - -; MinimalConfiguration - Root -"../testthemes/minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" -"../testthemes/minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" -"../testthemes/minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" - -; TypicalConfiguration - Widget -"../testthemes/typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" -"../testthemes/typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" -"../testthemes/typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" -"../testthemes/typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" -"../testthemes/typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" -"../testthemes/typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" -"../testthemes/typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" - -; TypicalConfiguration - View1 -"../testthemes/typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" -"../testthemes/typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" -"../testthemes/typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" -"../testthemes/typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" -"../testthemes/typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" -"../testthemes/typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" -"../testthemes/typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" -"../testthemes/typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" -"../testthemes/typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" - -; TypicalConfiguration - View2 -"../testthemes/typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" -"../testthemes/typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" -"../testthemes/typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" -"../testthemes/typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" -"../testthemes/typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" -"../testthemes/typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" - -; TypicalConfiguration - Root -"../testthemes/typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" -"../testthemes/typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" -"../testthemes/typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" -"../testthemes/typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" -"../testthemes/typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" -"../testthemes/typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" - -; OperatorConfiguration - View -"../testthemes/operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" -"../testthemes/operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" -"../testthemes/operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" -"../testthemes/operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" - -; OperatorConfiguration - Root -"../testthemes/operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" -"../testthemes/operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" -"../testthemes/operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" - -; FinnishWidget - Widget -"../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" -"../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" -"../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" -"../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" -"../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" -"../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" -"../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" -"../testthemes/finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" - -; InstalledWidget -"../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" -"../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" -"../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" -"../testthemes/installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" -"../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" -"../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" -"../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" -"../testthemes/installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" -"../testthemes/installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" -"../testthemes/installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" -"../testthemes/installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" -"../testthemes/installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" -"../testthemes/installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" - -; InstalledWidget_v2 -"../testthemes/installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" -"../testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" -"../testthemes/installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" -"../testthemes/installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" -"../testthemes/installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" -"../testthemes/installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" -"../testthemes/installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" -"../testthemes/installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" -"../testthemes/installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" -"../testthemes/installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" -"../testthemes/installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" -"../testthemes/installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" +@"..\testthemes\group\test_themes.sisx",(0xEf111203) diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Thu Jul 15 18:59:18 2010 +0300 @@ -37,108 +37,4 @@ "\epoc32\release\winscw\udeb\mt_hspsprovider.dll"-"c:\sys\bin\mt_hspsprovider.dll" ; Test configurations - -; MinimalConfiguration - Widget -"../testthemes/minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" -"../testthemes/minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" -"../testthemes/minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" - -; MinimalConfiguration - View -"../testthemes/minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" -"../testthemes/minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" -"../testthemes/minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" -"../testthemes/minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" -"../testthemes/minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" -"../testthemes/minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" -"../testthemes/minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" - -; MinimalConfiguration - Root -"../testthemes/minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" -"../testthemes/minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" -"../testthemes/minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" - -; TypicalConfiguration - Widget -"../testthemes/typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" -"../testthemes/typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" -"../testthemes/typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" -"../testthemes/typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" -"../testthemes/typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" -"../testthemes/typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" -"../testthemes/typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" - -; TypicalConfiguration - View1 -"../testthemes/typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" -"../testthemes/typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" -"../testthemes/typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" -"../testthemes/typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" -"../testthemes/typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" -"../testthemes/typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" -"../testthemes/typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" -"../testthemes/typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" -"../testthemes/typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" - -; TypicalConfiguration - View2 -"../testthemes/typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" -"../testthemes/typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" -"../testthemes/typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" -"../testthemes/typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" -"../testthemes/typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" -"../testthemes/typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" - -; TypicalConfiguration - Root -"../testthemes/typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" -"../testthemes/typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" -"../testthemes/typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" -"../testthemes/typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" -"../testthemes/typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" -"../testthemes/typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" - -; OperatorConfiguration - View -"../testthemes/operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" -"../testthemes/operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" -"../testthemes/operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" -"../testthemes/operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" - -; OperatorConfiguration - Root -"../testthemes/operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" -"../testthemes/operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" -"../testthemes/operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" - -; FinnishWidget - Widget -"../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" -"../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" -"../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" -"../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" -"../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" -"../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" -"../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" -"../testthemes/finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" - -; InstalledWidget -"../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" -"../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" -"../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" -"../testthemes/installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" -"../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" -"../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" -"../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" -"../testthemes/installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" -"../testthemes/installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" -"../testthemes/installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" -"../testthemes/installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" -"../testthemes/installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" -"../testthemes/installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" - -; InstalledWidget_v2 -"../testthemes/installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" -"../testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" -"../testthemes/installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" -"../testthemes/installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" -"../testthemes/installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" -"../testthemes/installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" -"../testthemes/installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" -"../testthemes/installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" -"../testthemes/installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" -"../testthemes/installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" -"../testthemes/installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" -"../testthemes/installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" +@"..\testthemes\group\test_themes.sisx",(0xEf111203) diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -18,13 +18,14 @@ #include +#include #include "../../../inc/hsps_log_cfg.hrh" TARGET mt_hspsconfigurationif.dll TARGETTYPE dll UID 0x1000af5a 0x01700000 -CAPABILITY ALL -TCB -DRM +CAPABILITY EUNIT_CAPS VENDORID 0x00000000 SOURCEPATH ../src @@ -47,8 +48,6 @@ // System include folders required by the tested code MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/platform/digia/eunit - LIBRARY bafl.lib LIBRARY efsrv.lib LIBRARY EUnit.lib diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif_armv5.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif_armv5.pkg Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,143 @@ +; +; 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 "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; mt_sapi_homescreenplugin_winscw.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"mt_sapi_homescreenplugin"},(0xEf111202),1,0,0 + +; Supports Series 60 v5.0 +[0x1028315F], 0, 0, 0, {"Series60ProductID"} + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +; Files to copy + +; Module test dll +"\epoc32\release\armv5\urel\mt_hspsconfigurationif.dll"-"c:\sys\bin\mt_hspsconfigurationif.dll" + +; Test configurations +; MinimalConfiguration - Widget +"../../testthemes/minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" +"../../testthemes/minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" +"../../testthemes/minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" + +; MinimalConfiguration - View +"../../testthemes/minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" +"../../testthemes/minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" +"../../testthemes/minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" +"../../testthemes/minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" +"../../testthemes/minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" +"../../testthemes/minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" +"../../testthemes/minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" + +; MinimalConfiguration - Root +"../../testthemes/minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" +"../../testthemes/minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" +"../../testthemes/minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" + +; TypicalConfiguration - Widget +"../../testthemes/typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" +"../../testthemes/typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" +"../../testthemes/typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" +"../../testthemes/typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" +"../../testthemes/typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" +"../../testthemes/typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" +"../../testthemes/typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" + +; TypicalConfiguration - View1 +"../../testthemes/typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" +"../../testthemes/typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" +"../../testthemes/typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" +"../../testthemes/typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" +"../../testthemes/typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" +"../../testthemes/typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" +"../../testthemes/typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" +"../../testthemes/typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" +"../../testthemes/typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" + +; TypicalConfiguration - View2 +"../../testthemes/typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" +"../../testthemes/typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" +"../../testthemes/typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" +"../../testthemes/typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" +"../../testthemes/typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" +"../../testthemes/typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" + +; TypicalConfiguration - Root +"../../testthemes/typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" +"../../testthemes/typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" +"../../testthemes/typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" +"../../testthemes/typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" +"../../testthemes/typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" +"../../testthemes/typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" + +; OperatorConfiguration - View +"../../testthemes/operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" +"../../testthemes/operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" +"../../testthemes/operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" +"../../testthemes/operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" + +; OperatorConfiguration - Root +"../../testthemes/operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" +"../../testthemes/operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" +"../../testthemes/operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" + +; FinnishWidget - Widget +"../../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" +"../../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" +"../../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" +"../../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" +"../../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" +"../../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" +"../../testthemes/finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" + +; InstalledWidget +"../../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" +"../../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" +"../../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../../testthemes/installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" +"../../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" +"../../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" +"../../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" +"../../testthemes/installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" +"../../testthemes/installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" +"../../testthemes/installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" +"../../testthemes/installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" +"../../testthemes/installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" +"../../testthemes/installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" + +; InstalledWidget_v2 +"../../testthemes/installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" +"../../testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" +"../../testthemes/installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" +"../../testthemes/installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" +"../../testthemes/installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" +"../../testthemes/installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" +"../../testthemes/installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" +"../../testthemes/installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" +"../../testthemes/installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" +"../../testthemes/installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" +"../../testthemes/installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" +"../../testthemes/installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" + diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreconfigurations_1.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreconfigurations_1.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreconfigurations_1.h Thu Jul 15 18:59:18 2010 +0300 @@ -37,37 +37,44 @@ • Input: RestoreConfigurations(“default”) • Expected output: - Restoring from eMMC/UDA/ROM succeeded - + Restoring of the licensee restorable app configuration succeeded + Test step 2: • Input: GetActiveAppConf • Expected output: - Default configuration is restored and returned. + Operator configuration was returned with a view. Test step 3: • Input: - GetPluginConf(“Typical - View1”) + RestoreConfigurations(“all”) +• Expected output: + Restoring from eMMC/UDA/ROM succeeded + +Test step 4: +• Input: + AddPlugin(“Operator configuration”“ TypicalWidgetConf”, “0”) • Expected output: - ROM's view configuration from is returned. + Plugin id of the added widget configuration. + +Test step 5: +• Input: + GetPluginConf(“operatorview”) +• Expected output: + There is one widget plugin -Test step 4: +Test step 6: • Input: RestoreConfigurations(“views”) • Expected output: Restoring of the views succeeded - -Test step 5: + +Test step 7: • Input: - GetActiveAppConf + GetPluginConf(“operatorview”) • Expected output: - There is now only one view, which was the first view previously, and it's active - -Test step 6: -• Input: - GetPluginConf(“Typical - View1”) -• Expected output: - There are no plugins (widgets) in the remaining view + The view is empty of plugins + */ // Test step 1 method: @@ -139,13 +146,11 @@ -// Test step 2 method: +// Test step 2 method const TUint8 restoreconfigurations_1_ts_2_method[] = "GetActiveAppConf"; - // Test step 2 input: const TUint8 restoreconfigurations_1_ts_2_input = 0; - // Test step 2 expected output: const TUint8 restoreconfigurations_1_ts_2_output[] = { @@ -223,7 +228,7 @@ 5, 10,0,0,0, 42, -'0','x','2','0','0','0','B','1','1','0', +'0','x','2','0','0','0','B','1','3','0', // - appConf::type // - Variant name // - Version 1.0 @@ -293,9 +298,9 @@ // - Variant value 10, 5, -14,0,0,0, -58, -'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','r','o','o','t', // - appConf::multiinstance // - Variant name // - Version 1.0 @@ -413,7 +418,7 @@ // - Version 1.0 // - Item count (LE) 10, -2,0,0,0, +1,0,0,0, // - appConf::plugins // - Version 1.0 // - List item starts @@ -476,7 +481,7 @@ 5, 10,0,0,0, 42, -'0','x','2','0','0','0','B','1','1','1', +'0','x','2','0','0','0','B','1','3','1', // - plugins[0]::activationstate // - Variant name // - Version 1.0 @@ -525,117 +530,6 @@ 4,0,0,0, 18, 'n','o','n','e', -// - appConf::plugins -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - appConf::plugins[1] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - plugins[1] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - plugins[1]::id -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -2,0,0,0, -10, -'i','d', -// - plugins[1]::id -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'5', -// - plugins[1]::uid -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'u','i','d', -// - plugins[1]::uid -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','B','1','1','2', -// - plugins[1]::activationstate -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -15,0,0,0, -62, -'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', -// - plugins[1]::activationstate -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'0', -// - plugins[1]::locking_status -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -14,0,0,0, -58, -'l','o','c','k','i','n','g','_','s','t','a','t','u','s', -// - plugins[1]::locking_status -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -4,0,0,0, -18, -'n','o','n','e', // - appConf::settings // - Variant name // - Version 1.0 @@ -681,23 +575,23 @@ // - Version 1.0 // - List item count 10, -1,0,0,0, -// - resources[0]::object -// - Version 1.0 -// - List item starts +0,0,0,0 +}; + + + + +// Test step 3 method: +const TUint8 restoreconfigurations_1_ts_3_method[] = "RestoreConfigurations"; + +// Test step 3 input: +const TUint8 restoreconfigurations_1_ts_3_input[] = { +// RestoreConfigurations(Input) +// - Version 1.0 +// - Item count (LE) 10, -0,0,0,0, -// - Object[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - Object[0] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - Object[0]::name +1,0,0,0, +// - RestoreConfigurations(Input)::restore // - Variant name // - Version 1.0 // - Semantic ID (LE) @@ -706,10 +600,10 @@ // - Variant name 10, 12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - Object[0]::name +7,0,0,0, +30, +'r','e','s','t','o','r','e', +// - RestoreConfigurations::value // - Variant value // - Version 1.0 // - Variant value type, EVariantTypeDesC @@ -718,10 +612,19 @@ // - Variant value 10, 5, -8,0,0,0, -34, -'r','o','o','t','.','b','m','p', -// - Object[0]::path +3,0,0,0, +14, +'a','l','l' +}; + +// Test step 3 output: +const TUint8 restoreconfigurations_1_ts_3_output[] = { +// RestoreConfigurations(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RestoreConfigurations(Output)::status // - Variant name // - Version 1.0 // - Semantic ID (LE) @@ -730,10 +633,46 @@ // - Variant name 10, 12,0,0,0, -4,0,0,0, -18, -'p','a','t','h', -// - Object[0]::path +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + + + +// Test step 4 method: +const TUint8 restoreconfigurations_1_ts_4_method[] = "AddPlugin"; + +// Test step 4 input: +const TUint8 restoreconfigurations_1_ts_4_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId // - Variant value // - Version 1.0 // - Variant value type, EVariantTypeDesC @@ -742,10 +681,10 @@ // - Variant value 10, 5, -42,0,0,0, -170, -'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', -// - Object[0]::mediatype +1,0,0,0, +6, +'2', +// - AddPlugin(Input)::pluginUid // - Variant name // - Version 1.0 // - Semantic ID (LE) @@ -756,8 +695,8 @@ 12,0,0,0, 9,0,0,0, 38, -'m','e','d','i','a','t','y','p','e', -// - Object[0]::mediatype +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid // - Variant value // - Version 1.0 // - Variant value type, EVariantTypeDesC @@ -766,10 +705,10 @@ // - Variant value 10, 5, -9,0,0,0, -38, -'m','i','m','e','_','t','y','p','e', -// - Object[0]::tag +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - AddPlugin(Input)::position // - Variant name // - Version 1.0 // - Semantic ID (LE) @@ -778,10 +717,30 @@ // - Variant name 10, 12,0,0,0, -3,0,0,0, -14, -'t','a','g', -// - Object[0]::tag +8,0,0,0, +34 +}; + +// Test step 4 output: +const TUint8 restoreconfigurations_1_ts_4_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId // - Variant value // - Version 1.0 // - Variant value type, EVariantTypeDesC @@ -790,18 +749,19 @@ // - Variant value 10, 5, -0,0,0,0, -2 +1,0,0,0, +6, +'2', }; -// Test step 3 method: -const TUint8 restoreconfigurations_1_ts_3_method[] = "GetPluginConf"; +// Test step 5 method: +const TUint8 restoreconfigurations_1_ts_5_method[] = "GetPluginConf"; -// Test step 3 input: -const TUint8 restoreconfigurations_1_ts_3_input[] = { +// Test step 5 input: +const TUint8 restoreconfigurations_1_ts_5_input[] = { // GetPluginConf(Input) // - Version 1.0 // - Item count (LE) @@ -833,8 +793,801 @@ '1' }; -// Test step 3 output: -const TUint8 restoreconfigurations_1_ts_3_output[] = { +// Test step 5 output: +const TUint8 restoreconfigurations_1_ts_5_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','V','i','e','w', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'S','t','r','i','n','g', +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'d','u','m','m','y','.','m','i','f', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'l','o','g','o' +}; + + + +// Test step 6 method: +const TUint8 restoreconfigurations_1_ts_6_method[] = "RestoreConfigurations"; + +// Test step 6 input: +const TUint8 restoreconfigurations_1_ts_6_input[] = { +// RestoreConfigurations(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RestoreConfigurations(Input)::restore +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'r','e','s','t','o','r','e', +// - RestoreConfigurations::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','i','e','w','s' +}; + +// Test step 6 output: +const TUint8 restoreconfigurations_1_ts_6_output[] = { +// RestoreConfigurations(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RestoreConfigurations(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + + + +// Test step 7 method: +const TUint8 restoreconfigurations_1_ts_7_method[] = "GetPluginConf"; + +// Test step 7 input: +const TUint8 restoreconfigurations_1_ts_7_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 7 output: +const TUint8 restoreconfigurations_1_ts_7_output[] = { // GetPluginConf(Output) // - Version 1.0 // - Item count (LE) @@ -1099,13 +1852,13 @@ // - Version 1.0 // - Item count (LE) 10, -3,0,0,0, -// - appConf::plugins +1,0,0,0, +// - pluginConf::plugins // - Version 1.0 // - List item starts 10, 0,0,0,0, -// - appConf::plugins[0] +// - pluginConf::plugins[0] // - Version 1.0 // - Variant value type, EVariantTypeMap 10, @@ -1211,1566 +1964,6 @@ 4,0,0,0, 18, 'n','o','n','e', -// - appConf::plugins -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - appConf::plugins[1] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - plugins[1] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - plugins[1]::id -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -2,0,0,0, -10, -'i','d', -// - plugins[1]::id -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'3', -// - plugins[1]::uid -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'u','i','d', -// - plugins[1]::uid -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','B','1','2','0', -// - plugins[1]::activationstate -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -15,0,0,0, -62, -'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', -// - plugins[1]::activationstate -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'0', -// - plugins[1]::locking_status -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -14,0,0,0, -58, -'l','o','c','k','i','n','g','_','s','t','a','t','u','s', -// - plugins[1]::locking_status -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -4,0,0,0, -18, -'n','o','n','e', -// - appConf::plugins -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - appConf::plugins[2] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - plugins[2] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - plugins[2]::id -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -2,0,0,0, -10, -'i','d', -// - plugins[2]::id -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'4', -// - plugins[2]::uid -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'u','i','d', -// - plugins[2]::uid -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','B','1','2','0', -// - plugins[2]::activationstate -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -15,0,0,0, -62, -'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', -// - plugins[2]::activationstate -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'0', -// - plugins[2]::locking_status -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -14,0,0,0, -58, -'l','o','c','k','i','n','g','_','s','t','a','t','u','s', -// - plugins[2]::locking_status -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -4,0,0,0, -18, -'n','o','n','e', -// - pluginConf::settings -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -8,0,0,0, -34, -'s','e','t','t','i','n','g','s', -// - pluginConf::settings -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - pluginConf::settings -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// - pluginConf::settings -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - items[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - items[0] map -// - Version 1.0 -// - Item count (LE) -10, -3,0,0,0, -// - items[0]::itemId -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -6,0,0,0, -26, -'i','t','e','m','I','d', -// - items[0]::itemId -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value (empty) -10, -5, -7,0,0,0, -30, -'b','g','c','o','l','o','r', -// - items[0]::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - items[0]::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value (empty) -10, -5, -16,0,0,0, -66, -'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', -// - items[0]::properties -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -10,0,0,0, -42, -'p','r','o','p','e','r','t','i','e','s', -// - items[0]::properties -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - items[0]::properties -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// - items[0]::properties -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - properties[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - properties[0] map -// - Version 1.0 -// - Item count (LE) -10, -2,0,0,0, -// - prperties[0]::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - properties[0]::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -5,0,0,0, -22, -'v','a','l','u','e', -// - prperties[0]::value -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -5,0,0,0, -22, -'v','a','l','u','e', -// - properties[0]::value -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -9,0,0,0, -38, -'2','0','0',',','1','0','0',',','0', -// - pluginConf::resources -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'r','e','s','o','u','r','c','e','s', -// - pluginConf::resources -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - pluginConf::resources -// - Version 1.0 -// - Item count (LE) -10, -2,0,0,0, -// - pluginConf::resources -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - object[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - object[0] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - object[0]::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - object[0]::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -9,0,0,0, -38, -'v','i','e','w','1','.','b','m','p', -// - object[0]::path -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'p','a','t','h', -// - object[0]::path -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -37,0,0,0, -150, -'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', -// - object[0]::mediatype -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'m','e','d','i','a','t','y','p','e', -// - object[0]::mediatype -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -9,0,0,0, -38, -'m','i','m','e','_','t','y','p','e', -// - Object[0]::tag -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'t','a','g', -// - Object[0]::tag -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -0,0,0,0, -2, -// - pluginConf::resources -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - object[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - object[0] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - object[0]::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - object[0]::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -12,0,0,0, -50, -'h','s','_','l','o','g','o','z','.','j','p','g', -// - object[0]::path -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'p','a','t','h', -// - object[0]::path -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -37,0,0,0, -150, -'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', -// - object[0]::mediatype -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'m','e','d','i','a','t','y','p','e', -// - object[0]::mediatype -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -9,0,0,0, -38, -'m','i','m','e','_','t','y','p','e', -// - Object[1]::tag -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'t','a','g', -// - Object[1]::tag -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -0,0,0,0, -2 -}; - - - -// Test step 4 method: -const TUint8 restoreconfigurations_1_ts_4_method[] = "RestoreConfigurations"; - -// Test step 1 input: -const TUint8 restoreconfigurations_1_ts_4_input[] = { -// RestoreConfigurations(Input) -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// - RestoreConfigurations(Input)::restore -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -7,0,0,0, -30, -'r','e','s','t','o','r','e', -// - RestoreConfigurations::value -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -5,0,0,0, -22, -'v','i','e','w','s' -}; - -// Test step 4 output: -const TUint8 restoreconfigurations_1_ts_4_output[] = { -// RestoreConfigurations(Output) -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// - RestoreConfigurations(Output)::status -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -6,0,0,0, -26, -'s','t','a','t','u','s', -// - AddPlugin(Input)::status -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeTInt32 -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -1, -0,0,0,0 -}; - - - - -// Test step 5 method: -const TUint8 restoreconfigurations_1_ts_5_method[] = "GetActiveAppConf"; - - -// Test step 5 input: -const TUint8 restoreconfigurations_1_ts_5_input = 0; - - -// Test step 5 expected output: -const TUint8 restoreconfigurations_1_ts_5_output[] = { -// GetActiveAppConf(Output) -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// GetActiveAppConf(Output)::appConf -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -7,0,0,0, -30, -'a','p','p','C','o','n','f', -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - appConf map -// - Version 1.0 -// - Item count (LE) -10, -12,0,0,0, -// - appConf::id -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -2,0,0,0, -10, -'i','d', -// - appConf::id -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'1', -// - appConf::uid -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'u','i','d', -// - appConf::uid -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','B','1','1','0', -// - appConf::type -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'t','y','p','e', -// - appConf::type -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -11,0,0,0, -46, -'a','p','p','l','i','c','a','t','i','o','n', -// - appConf::interface -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'i','n','t','e','r','f','a','c','e', -// - appConf::interface -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','0','F','B','1', -// - appConf::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - appConf::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -14,0,0,0, -58, -'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', -// - appConf::multiinstance -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -13,0,0,0, -54, -'m','u','l','t','i','i','n','s','t','a','n','c','e', -// - appConf::multiinstance -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'1', -// - appConf::description -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'d','e','s','c', -// - appConf::description -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -0,0,0,0, -2, -// - appConf::state -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -5,0,0,0, -22, -'s','t','a','t','e', -// - appConf::state -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -12,0,0,0, -50, -'N','o','t','C','o','n','f','i','r','m','e','d', -// - appConf::max_child -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'m','a','x','_','c','h','i','l','d', -// - appConf::max_child -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'6', -// - appConf::plugins -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -7,0,0,0, -30, -'p','l','u','g','i','n','s', -// - appConf::plugins -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - appConf::plugins -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// - appConf::plugins -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - appConf::plugins[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - plugins[0] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - plugins[0]::id -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -2,0,0,0, -10, -'i','d', -// - plugins[0]::id -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'1', -// - plugins[0]::uid -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'u','i','d', -// - plugins[0]::uid -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','B','1','1','1', -// - plugins[0]::activationstate -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -15,0,0,0, -62, -'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', -// - plugins[0]::activationstate -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'1', -// - plugins[0]::locking_status -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -14,0,0,0, -58, -'l','o','c','k','i','n','g','_','s','t','a','t','u','s', -// - plugins[0]::locking_status -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -4,0,0,0, -18, -'n','o','n','e', -// - appConf::settings -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -8,0,0,0, -34, -'s','e','t','t','i','n','g','s', -// - appConf::settings -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - appConf::settings -// - Version 1.0 -// - Item count (LE) -10, -0,0,0,0, -// - appConf::resources -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'r','e','s','o','u','r','c','e','s', -// - appConf::resources -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - appConf::resources -// - Version 1.0 -// - List item count -10, -1,0,0,0, -// - resources[0]::object -// - Version 1.0 -// - List item starts -10, -0,0,0,0, -// - Object[0] -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - Object[0] map -// - Version 1.0 -// - Item count (LE) -10, -4,0,0,0, -// - Object[0]::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - Object[0]::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -8,0,0,0, -34, -'r','o','o','t','.','b','m','p', -// - Object[0]::path -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'p','a','t','h', -// - Object[0]::path -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -42,0,0,0, -170, -'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', -// - Object[0]::mediatype -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'m','e','d','i','a','t','y','p','e', -// - Object[0]::mediatype -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -9,0,0,0, -38, -'m','i','m','e','_','t','y','p','e', -// - Object[0]::tag -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'t','a','g', -// - Object[0]::tag -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -0,0,0,0, -2 -}; - - - -// Test step 6 method: -const TUint8 restoreconfigurations_1_ts_6_method[] = "GetPluginConf"; - -// Test step 6 input: -const TUint8 restoreconfigurations_1_ts_6_input[] = { -// GetPluginConf(Input) -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// - GetPluginConf(Input)::pluginId -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -8,0,0,0, -34, -'p','l','u','g','i','n','I','d', -// - GetPluginConf(Input)::pluginId -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'1' -}; - -// Test step 6 output: -const TUint8 restoreconfigurations_1_ts_6_output[] = { -// GetPluginConf(Output) -// - Version 1.0 -// - Item count (LE) -10, -1,0,0,0, -// GetPluginConf(Output)::pluginConf -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -10,0,0,0, -42, -'p','l','u','g','i','n','C','o','n','f', -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeMap -10, -8, -// - pluginConf map -// - Version 1.0 -// - Item count (LE) -10, -12,0,0,0, -// - pluginConf::id -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -2,0,0,0, -10, -'i','d', -// - pluginConf::id -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'2', -// - pluginConf::uid -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -3,0,0,0, -14, -'u','i','d', -// - pluginConf::uid -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -10,0,0,0, -42, -'0','x','2','0','0','0','B','1','1','1', -// - pluginConf::type -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'t','y','p','e', -// - pluginConf::type -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -4,0,0,0, -18, -'v','i','e','w', -// - pluginConf::interface -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'i','n','t','e','r','f','a','c','e', -// - pluginConf::interface -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -5,0,0,0, -22, -'0','x','9','9','8', -// - pluginConf::name -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'n','a','m','e', -// - pluginConf::name -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -15,0,0,0, -62, -'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', -// - pluginConf::multiinstance -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -13,0,0,0, -54, -'m','u','l','t','i','i','n','s','t','a','n','c','e', -// - pluginConf::multiinstance -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'1', -// - pluginConf::description -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -4,0,0,0, -18, -'d','e','s','c', -// - pluginConf::description -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -0,0,0,0, -2, -// - pluginConf::state -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -5,0,0,0, -22, -'s','t','a','t','e', -// - pluginConf::state -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -12,0,0,0, -50, -'N','o','t','C','o','n','f','i','r','m','e','d', -// - pluginConf::max_child -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -9,0,0,0, -38, -'m','a','x','_','c','h','i','l','d', -// - pluginConf::max_child -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeDesC -// - Variant value length (LE) -// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) -// - Variant value -10, -5, -1,0,0,0, -6, -'6', -// - pluginConf::plugins -// - Variant name -// - Version 1.0 -// - Semantic ID (LE) -// - Variant name length (LE) -// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) -// - Variant name -10, -12,0,0,0, -7,0,0,0, -30, -'p','l','u','g','i','n','s', -// - pluginConf::plugins -// - Variant value -// - Version 1.0 -// - Variant value type, EVariantTypeList -10, -7, -// - pluginConf::plugins -// - Version 1.0 -// - Item count (LE) -10, -0,0,0,0, // - pluginConf::settings // - Variant name // - Version 1.0 @@ -3188,4 +2381,6 @@ 0,0,0,0, 2 }; + + #endif // C_MT_HSPS_RESTORECONFIGURATIONS_1_H diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Thu Jul 15 18:59:18 2010 +0300 @@ -19,7 +19,7 @@ #ifndef C_MT_HSPSCONFIGURATIONIF_H #define C_MT_HSPSCONFIGURATIONIF_H -#include +#include #include #include "mt_hsps.h" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -16,9 +16,9 @@ */ #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -3192,6 +3192,14 @@ ( TUint8* )restoreconfigurations_1_ts_6_method, ( TUint8* )restoreconfigurations_1_ts_6_input, ( TUint8* )restoreconfigurations_1_ts_6_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 7 + EUNIT_PRINT( _L8( "Test step 7" ) ); + RunTestStepSyncL( + ( TUint8* )restoreconfigurations_1_ts_6_method, + ( TUint8* )restoreconfigurations_1_ts_6_input, + ( TUint8* )restoreconfigurations_1_ts_6_output ); EUNIT_PRINT( _L8( "Test step passed" ) ); } diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif_dllmain.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif_dllmain.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -16,7 +16,7 @@ */ -#include +#include #include "mt_hspsconfigurationif.h" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider.mmp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider.mmp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -17,13 +17,14 @@ #include +#include #include "../../../inc/hsps_log_cfg.hrh" TARGET mt_hspsprovider.dll TARGETTYPE dll UID 0x1000af5a 0x01700000 -CAPABILITY ALL -TCB -DRM +CAPABILITY EUNIT_CAPS VENDORID 0x00000000 diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider_armv5.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider_armv5.pkg Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,143 @@ +; +; 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 "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; mt_sapi_homescreenplugin_winscw.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"mt_sapi_homescreenplugin"},(0xEf111202),1,0,0 + +; Supports Series 60 v5.0 +[0x1028315F], 0, 0, 0, {"Series60ProductID"} + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +; Files to copy + +; Module test dll +"\epoc32\release\armv5\urel\mt_hspsprovider.dll"-"c:\sys\bin\mt_hspsprovider.dll" + +; Test configurations +; MinimalConfiguration - Widget +"../../testthemes/minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" +"../../testthemes/minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" +"../../testthemes/minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" + +; MinimalConfiguration - View +"../../testthemes/minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" +"../../testthemes/minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" +"../../testthemes/minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" +"../../testthemes/minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" +"../../testthemes/minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" +"../../testthemes/minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" +"../../testthemes/minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" + +; MinimalConfiguration - Root +"../../testthemes/minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" +"../../testthemes/minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" +"../../testthemes/minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" + +; TypicalConfiguration - Widget +"../../testthemes/typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" +"../../testthemes/typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" +"../../testthemes/typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" +"../../testthemes/typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" +"../../testthemes/typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" +"../../testthemes/typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" +"../../testthemes/typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" + +; TypicalConfiguration - View1 +"../../testthemes/typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" +"../../testthemes/typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" +"../../testthemes/typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" +"../../testthemes/typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" +"../../testthemes/typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" +"../../testthemes/typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" +"../../testthemes/typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" +"../../testthemes/typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" +"../../testthemes/typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" + +; TypicalConfiguration - View2 +"../../testthemes/typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" +"../../testthemes/typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" +"../../testthemes/typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" +"../../testthemes/typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" +"../../testthemes/typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" +"../../testthemes/typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" + +; TypicalConfiguration - Root +"../../testthemes/typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" +"../../testthemes/typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" +"../../testthemes/typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" +"../../testthemes/typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" +"../../testthemes/typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" +"../../testthemes/typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" + +; OperatorConfiguration - View +"../../testthemes/operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" +"../../testthemes/operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" +"../../testthemes/operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" +"../../testthemes/operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" + +; OperatorConfiguration - Root +"../../testthemes/operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" +"../../testthemes/operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" +"../../testthemes/operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" + +; FinnishWidget - Widget +"../../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" +"../../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" +"../../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" +"../../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" +"../../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" +"../../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" +"../../testthemes/finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" + +; InstalledWidget +"../../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" +"../../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" +"../../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../../testthemes/installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" +"../../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" +"../../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" +"../../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" +"../../testthemes/installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" +"../../testthemes/installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" +"../../testthemes/installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" +"../../testthemes/installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" +"../../testthemes/installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" +"../../testthemes/installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" + +; InstalledWidget_v2 +"../../testthemes/installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" +"../../testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" +"../../testthemes/installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" +"../../testthemes/installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" +"../../testthemes/installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" +"../../testthemes/installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" +"../../testthemes/installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" +"../../testthemes/installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" +"../../testthemes/installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" +"../../testthemes/installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" +"../../testthemes/installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" +"../../testthemes/installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" + diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/inc/mt_hspsprovider.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/inc/mt_hspsprovider.h Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/inc/mt_hspsprovider.h Thu Jul 15 18:59:18 2010 +0300 @@ -19,7 +19,7 @@ #ifndef C_MT_HSPSPROVIDER_H #define C_MT_HSPSPROVIDER_H -#include +#include #include #include "mt_hsps.h" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -16,8 +16,8 @@ */ -#include -#include +#include +#include #include "mt_hspsprovider.h" #include "mt_hspsinstallationservice.h" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider_dllmain.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider_dllmain.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -16,7 +16,7 @@ */ -#include +#include #include "mt_hspsprovider.h" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for HSPS SAPI module testing +* +*/ + + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES + + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/createsis_test_themes.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/createsis_test_themes.bat Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,20 @@ +@rem +@rem Copyright (c) 20010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +makesis test_themes.pkg +signsis test_themes.sis test_themes.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key +del test_themes.sis + diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/test_themes.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/test_themes.pkg Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,138 @@ +; +; 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 "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; mt_sapi_homescreenplugin_winscw.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"test themes"},(0xEf111203),1,0,0 + +; Supports Series 60 v5.0 +[0x1028315F], 0, 0, 0, {"Series60ProductID"} + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +; Test configurations + +; MinimalConfiguration - Widget +"../minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" +"../minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" +"../minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" + +; MinimalConfiguration - View +"../minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" +"../minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" +"../minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" +"../minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" +"../minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" +"../minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" +"../minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" + +; MinimalConfiguration - Root +"../minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" +"../minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" +"../minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" + +; TypicalConfiguration - Widget +"../typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" +"../typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" +"../typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" +"../typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" +"../typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" +"../typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" +"../typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" + +; TypicalConfiguration - View1 +"../typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" +"../typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" +"../typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" +"../typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" +"../typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" +"../typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" +"../typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" +"../typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" +"../typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" + +; TypicalConfiguration - View2 +"../typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" +"../typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" +"../typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" +"../typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" +"../typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" +"../typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" + +; TypicalConfiguration - Root +"../typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" +"../typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" +"../typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" +"../typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" +"../typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" +"../typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" + +; OperatorConfiguration - View +"../operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" +"../operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" +"../operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" +"../operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" + +; OperatorConfiguration - Root +"../operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" +"../operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" +"../operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" + +; FinnishWidget - Widget +"../finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" +"../finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" +"../finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" +"../finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" +"../finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" +"../finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" +"../finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" + +; InstalledWidget +"../installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" +"../installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" +"../installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" +"../installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" +"../installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" +"../installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" +"../installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" +"../installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" +"../installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" +"../installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" +"../installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" +"../installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" + +; InstalledWidget_v2 +"../installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" +"../installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" +"../installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" +"../installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" +"../installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" +"../installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" +"../installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" +"../installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" +"../installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" +"../installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" +"../installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" +"../installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" diff -r 9e077f9a342c -r 2c7f27287390 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/test_themes.sisx Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/group/test_themes.sisx has changed diff -r 9e077f9a342c -r 2c7f27287390 idlefw/inc/framework/aicpsexecuteparam.h --- a/idlefw/inc/framework/aicpsexecuteparam.h Mon Jun 21 16:00:38 2010 +0300 +++ b/idlefw/inc/framework/aicpsexecuteparam.h Thu Jul 15 18:59:18 2010 +0300 @@ -137,6 +137,11 @@ /** action trigger list, owned. */ RPointerArray iActions; + +private: +#ifdef _SAPIDATAPLUGIN_TEST + friend class MT_SapiDataPlugin; +#endif }; #endif /* AICPSEXECUTEPARAM_H */ diff -r 9e077f9a342c -r 2c7f27287390 idlefw/plugins/sapidataplugin/inc/sapidataplugin.h --- a/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Mon Jun 21 16:00:38 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Thu Jul 15 18:59:18 2010 +0300 @@ -44,27 +44,27 @@ public: // data types - /** - * Plugin's network state. - */ - enum TPluginNetworkStatus - { - EUnknown, - EOffline, - EOnline - }; - - /** - * Plugin's state. - */ - enum TPluginStates - { - EStopped, - EStarted, - EResume, - ESuspend - }; - + /** + * Plugin's network state. + */ + enum TPluginNetworkStatus + { + EUnknown, + EOffline, + EOnline + }; + + /** + * Plugin's state. + */ + enum TPluginStates + { + EStopped, + EStarted, + EResume, + ESuspend + }; + public: // constructor and destructor @@ -318,6 +318,13 @@ TPluginStates iPluginState; /** Flag to indicate whether observer is registered */ TBool iPubObsRegistered; + +private: + // friend classes + +#ifdef _SAPIDATAPLUGIN_TEST + friend class MT_SapiDataPlugin; +#endif }; #endif // SAPIDATAPLUGIN_H diff -r 9e077f9a342c -r 2c7f27287390 idlefw/plugins/sapidataplugin/src/sapidata.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidata.cpp Mon Jun 21 16:00:38 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/src/sapidata.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -563,8 +563,7 @@ TLiwGenericParam cptype( KType, TLiwVariant( KPubData ) ); inParamList->AppendL( cptype ); cptype.Reset(); - // use the first item configuration to create the filter - filter = CreateFilterLC( KWidget() ); + filter = CreateFilterLC( KAll(), KAll() ); } else { diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/group/AiFwTestPlugins.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/group/AiFwTestPlugins.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +TARGET AiFwTestPlugins.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x10170001 + +CAPABILITY ALL -TCB +//VENDORID + +SOURCEPATH ../MT_aifw +SOURCE AiFwTestPluginsMain.cpp +SOURCE AiFwTestPluginsDllMain.cpp +SOURCE AiFwTestContentPlugin.cpp +SOURCE AiFwTestContentPlugin2.cpp +SOURCE AiFwTestContentPlugin3.cpp +SOURCE AiFwTestContentPlugin4.cpp +SOURCE AiFwTestContentPlugin5.cpp +SOURCE AiFwTestContentPlugin6.cpp +SOURCE AiFwTestContentPlugin7.cpp +SOURCE AiFwTestContentPlugin8.cpp +SOURCE AiFwTestContentPlugin9.cpp +SOURCE AiFwTestControllerPlugin.cpp +SOURCE AiFwTestControllerPlugin2.cpp + +START RESOURCE AiFwTestPlugins.rss +TARGET AiFwTestPlugins.rsc +END + +USERINCLUDE ../MT_aifw +USERINCLUDE ../../../../inc/framework +USERINCLUDE ../../../../inc/common +USERINCLUDE ../../../../../../homescreen/idlehomescreen/inc + + +SYSTEMINCLUDE ../../../../group +SYSTEMINCLUDE /epoc32/include/Digia/EUnit + +LANG SC + +#if defined(WINS) + DEFFILE ../BWINS/AiFwTestPlugins.DEF +#endif +#if defined(EABI) + DEFFILE ../EABI/AiFwTestPlugins.DEF +#endif +APP_LAYER_SYSTEMINCLUDE +LIBRARY euser.lib ecom.lib +LIBRARY cone.lib +LIBRARY aifw.lib aiutils.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/group/MT_aifw.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/group/MT_aifw.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +TARGET MT_aifw.dll +TARGETTYPE dll +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB +//VENDORID + +SOURCEPATH ../MT_aifw +SOURCE MT_aifwDllMain.cpp +SOURCE MT_aifw.cpp + +USERINCLUDE ../MT_aifw +USERINCLUDE ../../../../inc/framework +USERINCLUDE ../../../../inc/common +USERINCLUDE ../../../../../../homescreen/idlehomescreen/inc +SYSTEMINCLUDE /epoc32/include/platform/mw + + +SYSTEMINCLUDE ../../../../group +SYSTEMINCLUDE /epoc32/include/Digia/EUnit +APP_LAYER_SYSTEMINCLUDE +LIBRARY eunit.lib +LIBRARY eunitutil.lib +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY aifw.lib +LIBRARY aifwtestplugins.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib + + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +//../mt_aifw/10275102_1.cre /epoc32/release/winscw/udeb/z/system/apps/aifweunit/10275102_1.cre +//../mt_aifw/10275102_2.cre /epoc32/release/winscw/udeb/z/system/apps/aifweunit/10275102_2.cre +//../mt_aifw/10275102_1.txt /epoc32/release/winscw/udeb/z/system/apps/aifweunit/10275102_1.txt +//../mt_aifw/10275102_2.txt /epoc32/release/winscw/udeb/z/system/apps/aifweunit/10275102_2.txt +//../mt_aifw/10170FFF.txt /epoc32/release/winscw/udeb/z/private/10202be9/10170FFF.txt + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +#include "../ut_aifw/group/bld.inf" +//aifwtestplugins.mmp +//mt_aifw.mmp + +PRJ_TESTEXPORTS +// ../mt_aifw/10275102_1.cre /epoc32/release/winscw/udeb/z/system/apps/aifweunit/10275102_1.cre + + + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/10170FFF.txt Binary file idlefw/tsrc/framework/mt_aifw/10170FFF.txt has changed diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/10275102_1.cre Binary file idlefw/tsrc/framework/mt_aifw/10275102_1.cre has changed diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/10275102_1.txt Binary file idlefw/tsrc/framework/mt_aifw/10275102_1.txt has changed diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/10275102_2.cre Binary file idlefw/tsrc/framework/mt_aifw/10275102_2.cre has changed diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/10275102_2.txt Binary file idlefw/tsrc/framework/mt_aifw/10275102_2.txt has changed diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentModel.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTCONTENTMODEL_H +#define AIFWTESTCONTENTMODEL_H + +// INCLUDES +#include "aicontentmodel.h" + +// CONSTANTS +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +const TAiContentItem KTestPluginContent[] = +{ + { 1, L"Counter", "text/plain" }, + { 2, L"Status", "text/plain" }, + { 3, L"Runtime", "text/plain" } +}; + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +const TAiContentItem KTestPluginResources[] = +{ + { 1, L"Even", "text/plain" }, + { 2, L"Odd", "text/plain" } +}; + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +const TAiContentItem KTestPluginEvents[] = +{ + { 1, L"StartTimer", "" }, + { 2, L"StopTimer", "" }, + { 3, L"test_event", "" } +}; + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +const TAiContentItem KTestControllerContent[] = +{ + { 1, L"Counter", "text/plain" }, + { 2, L"Status", "text/plain" }, + { 3, L"Runtime", "text/plain" }, + { 4, L"Downtime", "text/plain" } +}; + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +const TAiContentItem KTestControllerResources[] = +{ + { 1, L"Even", "text/plain" }, + { 2, L"Odd", "text/plain" } +}; + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +const TAiContentItem KTestControllerEvents[] = +{ + { 1, L"StartTimer", "" }, + { 2, L"StopTimer", "" } +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +#include +#include +#include + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin::CAiFwTestContentPlugin() +{} + +EXPORT_C CAiFwTestContentPlugin* CAiFwTestContentPlugin::Instance() + { + TAny* ptr = Dll::Tls(); + + if ( ptr ) + { + TAiTestTLSStorage* tlsSet = static_cast( ptr ); + return tlsSet->iContentPlugin; + } + return NULL; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::ConstructL() +{ + iText = HBufC8::NewL(128); + + iInfo = new (ELeave) TAiPublisherInfo; + + iContent = AiUtility::CreateContentItemArrayIteratorL(KTestPluginContent); + iResources = AiUtility::CreateContentItemArrayIteratorL(KTestPluginResources); + iEvents = AiUtility::CreateContentItemArrayIteratorL(KTestPluginEvents); + + TAiTestTLSStorage* tlsSet = TAiTestTLSStorage::CreateInstanceL(); + tlsSet->iContentPlugin = this; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin* CAiFwTestContentPlugin::NewL() +{ + CAiFwTestContentPlugin* self = new (ELeave) CAiFwTestContentPlugin; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin::~CAiFwTestContentPlugin() +{ + TAiTestTLSStorage::DestroyInstance(); + + delete iText; + iObservers.Close(); + + delete iInfo; + Release( iContent ); + Release( iResources ); + Release( iEvents ); + + if( iTicker ) + iTicker->Cancel(); + delete iTicker; + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin::Callback(TAny* aPtr) +{ + CAiFwTestContentPlugin* plugin = reinterpret_cast (aPtr); + plugin->iCounter++; + plugin->iText->Des().Copy(_L8("Count:")); + plugin->iText->Des().AppendNum(plugin->iCounter); + + // Notify + for (TInt i = 0; i < plugin->iObservers.Count(); i++) + { + MAiContentObserver* observer = plugin->iObservers[i]; + observer->StartTransaction(0); + + HBufC* value = HBufC::NewLC(plugin->iText->Length()); + value->Des().Copy(*plugin->iText); + + observer->Publish((MAiPropertyExtension&) *plugin, KTestPluginContent[0].id, *value, 0); + + if (plugin->iCounter % 2 == 0) + { + observer->Publish((MAiPropertyExtension&) *plugin, KTestPluginContent[1].id, KTestPluginResources[0].id, 0); + } + else + { + observer->Publish((MAiPropertyExtension&) *plugin, KTestPluginContent[1].id, KTestPluginResources[1].id, 0); + } + + observer->Commit(0); + + CleanupStack::PopAndDestroy(); // value + } + + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::LoadEngineL(TAiTransitionReason /*aReason*/) +{ + iPluginLoaded = ETrue; + if( !iTicker ) + { + iTicker = CPeriodic::NewL(CActive::EPriorityStandard); + } +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::Resume(TAiTransitionReason aReason) +{ + TRAP_IGNORE( LoadEngineL( aReason ) ); + iPluginResumed = ETrue; + if( iTicker && !iTicker->IsActive() ) + { + TCallBack cb(Callback, this); + iTicker->Start(1000000, 1000000, cb); + } +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::Suspend(TAiTransitionReason /*aReason*/) +{ + if( iTicker && iTicker->IsActive() ) + { + iTicker->Cancel(); + } +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::Stop(TAiTransitionReason /*aReason*/) +{ + if( iTicker ) + { + iTicker->Cancel(); + delete iTicker; + iTicker = NULL; + } +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::SubscribeL(MAiContentObserver& aObserver) +{ + return iObservers.AppendL(&aObserver); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::ConfigureL(RAiSettingsItemArray& aSettings) + { + iSettingFound = ETrue; + for( TInt i = 0; i < aSettings.Count(); ++i ) + { + MAiPluginSettingsItem& item = aSettings[i]->AiPluginSettingsItem(); + if( item.Value().Compare( _L("DesValue") ) == 0 ) + { + // pass + if( item.Key() == 1 ) + { + } + item.PublisherId(); + } + /*TRAP_IGNORE( + item.UpdateFromCenRepL(); + item.SetKey( -1 ); + item.UpdateFromCenRepL(); + item.SetKey( 0 ); + item.SetPublisherId( TUid::Uid( 0 ) ); + item.UpdateFromCenRepL(); + );*/ + } + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + return static_cast(this); + } + + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin::GetPropertyL(TInt aProperty) +{ + switch (aProperty) + { + case EAiPublisherInfo: + return iInfo; + + case EAiPublisherContent: + return static_cast( iContent ); + + case EAiPublisherResources: + return static_cast( iResources ); + + case EAiPublisherEvents: + return static_cast( iEvents ); + + case EAiContentRequest: + return static_cast(this); + + case EAiResourceRequest: + return static_cast(this); + } + + User::Leave(KErrNotSupported); + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::SetPropertyL(TInt aProperty, TAny* aValue) + { + if( aValue ) + { + switch( aProperty ) + { + case EAiPublisherInfo: + { + const TAiPublisherInfo* info = + static_cast(aValue); + iInfo->iUid.iUid = info->iUid.iUid; + iInfo->iName.Copy( info->iName ); + iInfo->iNamespace.Copy( info->iNamespace ); + break; + } + } + } + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin::HandleEvent(TInt aEvent, const TDesC& aParam) + { + if( i2ndEvent ) + { + return; + } + if( aEvent == 3 && aParam.Length() == 0 ) + { + iEventReceived = ETrue; + } + i2ndEvent = ETrue; + } + +TBool CAiFwTestContentPlugin::RefreshContent( TInt aContentId ) + { + iContentRefreshed = ETrue; + return ETrue; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// + +EXPORT_C TBool CAiFwTestContentPlugin::ContentRefreshed() + { + return iContentRefreshed; + } + +EXPORT_C RPointerArray& CAiFwTestContentPlugin::Observers() + { + return iObservers; + } + +EXPORT_C TBool CAiFwTestContentPlugin::WasLoaded() + { + return iPluginLoaded; + } + +EXPORT_C TBool CAiFwTestContentPlugin::WasResumed() + { + return iPluginResumed; + } + +EXPORT_C TBool CAiFwTestContentPlugin::WasConfigured() + { + return iSettingFound; + } + +EXPORT_C TBool CAiFwTestContentPlugin::EventReceived() + { + return iEventReceived; + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN_H +#define AIFWTESTPLUGIN_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aicontentmodel.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; +class MAiContentItemIterator; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension, + public MAiContentRequest +{ +public: // Constructors and destructor + + static CAiFwTestContentPlugin* NewL(); + + IMPORT_C static CAiFwTestContentPlugin* Instance(); + + virtual ~CAiFwTestContentPlugin(); + +public: // from CAiContentPublisher + + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +// from base class MAiContentRequest + TBool RefreshContent( TInt aContentId ); + +public: // Test functions + + IMPORT_C RPointerArray& Observers(); + + IMPORT_C TBool WasLoaded(); + + IMPORT_C TBool WasResumed(); + + IMPORT_C TBool WasConfigured(); + + IMPORT_C TBool EventReceived(); + + IMPORT_C TBool ContentRefreshed(); + +public: // from MAiPropertyExtension + TAny* GetPropertyL(TInt aProperty); + void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin(); + void ConstructL(); + void LoadEngineL(TAiTransitionReason aReason); + static TInt Callback(TAny* aPtr); + +private: // Data + + RPointerArray iObservers; + + TAiPublisherInfo* iInfo; + MAiContentItemIterator* iContent; + MAiContentItemIterator* iResources; + MAiContentItemIterator* iEvents; + + CPeriodic* iTicker; + + TInt iCounter; + HBufC8* iText; + + TBool iContentRefreshed; + + TBool iPluginLoaded; + + TBool iPluginResumed; + + TBool iSettingFound; + + TBool iEventReceived; + TBool i2ndEvent; + + // Reserved pointer for future extension + //TAny* iReserved; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin2.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin2.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin2::CAiFwTestContentPlugin2() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::ConstructL() +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin2* CAiFwTestContentPlugin2::NewL() +{ + CAiFwTestContentPlugin2* self = new (ELeave) CAiFwTestContentPlugin2; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin2::~CAiFwTestContentPlugin2() +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin2::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::Resume(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::Suspend(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::Stop(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::SubscribeL(MAiContentObserver& /*aObserver*/) +{ + User::Leave(KErrNotSupported); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::ConfigureL(RAiSettingsItemArray& /*aSettings*/) + { + User::Leave(KErrNotSupported); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin2::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty && !iFirstExt) + { + iFirstExt = ETrue; + return static_cast(this); + } + User::Leave(KErrNotSupported); + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin2::GetPropertyL(TInt /*aProperty*/) +{ + User::Leave(KErrNotSupported); + + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::SetPropertyL(TInt aProperty, TAny* aValue) + { + if( aValue ) + { + switch( aProperty ) + { + case EAiPublisherInfo: + { + return; + } + } + } + User::Leave(KErrNotSupported); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin2::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + User::Leave(KErrNotFound); + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin2.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN2_H +#define AIFWTESTPLUGIN2_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aicontentmodel.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin2 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin2* NewL(); + ~CAiFwTestContentPlugin2(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // from MAiPropertyExtension + virtual TAny* GetPropertyL(TInt aProperty); + virtual void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + + /** + * C++ default constructor. + */ + CAiFwTestContentPlugin2(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + static TInt Callback(TAny* aPtr); + +private: // Data + + TBool iFirstExt; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin3.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,226 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin3.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin3::CAiFwTestContentPlugin3() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::ConstructL() +{ + iInfo = new (ELeave) TAiPublisherInfo; + iInfo->iUid.iUid = KImplementationUidAiTestContentPlugin4; + iInfo->iName.Copy( _L8( "AiFwTestPlugin3" ) ); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin3* CAiFwTestContentPlugin3::NewL() +{ + CAiFwTestContentPlugin3* self = new (ELeave) CAiFwTestContentPlugin3; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin3::~CAiFwTestContentPlugin3() +{ + delete iInfo; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin3::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::Resume(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::Suspend(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::Stop(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::SubscribeL(MAiContentObserver& /*aObserver*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin3::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + User::Leave( KErrNotSupported ); + return static_cast(this); + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin3::GetPropertyL(TInt aProperty) +{ + if( aProperty == EAiPublisherInfo ) + { + return iInfo; + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::SetPropertyL(TInt aProperty, TAny* aValue) + { + if( aValue ) + { + switch( aProperty ) + { + case EAiPublisherInfo: + { + return; + } + } + } + User::Leave(KErrNotSupported); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin3::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin3.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN3_H +#define AIFWTESTPLUGIN3_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin3 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin3* NewL(); + ~CAiFwTestContentPlugin3(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // MAiPropertyExtension + TAny* GetPropertyL(TInt aProperty); + void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin3(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TAiPublisherInfo* iInfo; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin4.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin4.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,220 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin4.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin4::CAiFwTestContentPlugin4() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::ConstructL() +{ + iInfo = new (ELeave) TAiPublisherInfo; + iInfo->iUid.iUid = KImplementationUidAiTestContentPlugin4; + iInfo->iName.Copy( _L8( "AiFwTestPlugin4" ) ); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin4* CAiFwTestContentPlugin4::NewL() +{ + CAiFwTestContentPlugin4* self = new (ELeave) CAiFwTestContentPlugin4; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin4::~CAiFwTestContentPlugin4() +{ + delete iInfo; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin4::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::Resume(TAiTransitionReason /*aReason*/) +{ + User::Leave( KErrNotFound ); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::Suspend(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::Stop(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::SubscribeL(MAiContentObserver& /*aObserver*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin4::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + return NULL; + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin4::GetPropertyL(TInt aProperty) +{ + if( aProperty == EAiPublisherInfo ) + { + return iInfo; + } + User::Leave(KErrNotSupported); + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::SetPropertyL(TInt /*aProperty*/, TAny* /*aValue*/) + { + + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin4::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin4.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN4_H +#define AIFWTESTPLUGIN4_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aicontentmodel.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin4 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin4* NewL(); + ~CAiFwTestContentPlugin4(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // MAiPropertyExtension + TAny* GetPropertyL(TInt aProperty); + void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin4(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TAiPublisherInfo* iInfo; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin5.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin5.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin5.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin5::CAiFwTestContentPlugin5() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::ConstructL() +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin5* CAiFwTestContentPlugin5::NewL() +{ + CAiFwTestContentPlugin5* self = new (ELeave) CAiFwTestContentPlugin5; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin5::~CAiFwTestContentPlugin5() +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin5::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::Resume(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::Suspend(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::Stop(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::SubscribeL(MAiContentObserver& /*aObserver*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin5::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty && !iFirstExt) + { + iFirstExt = ETrue; + return static_cast(this); + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin5::GetPropertyL(TInt /*aProperty*/) +{ + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::SetPropertyL(TInt /*aProperty*/, TAny* /*aValue*/) + { + User::Leave(KErrNotSupported); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin5::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin5.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN5_H +#define AIFWTESTPLUGIN5_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin5 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin5* NewL(); + ~CAiFwTestContentPlugin5(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // from MAiPropertyExtension + TAny* GetPropertyL(TInt aProperty); + void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin5(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TBool iFirstExt; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin6.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin6.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin6.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin6::CAiFwTestContentPlugin6() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::ConstructL() +{ + iInfo = new (ELeave) TAiPublisherInfo; + iInfo->iUid.iUid = KImplementationUidAiTestContentPlugin6; + iInfo->iName.Copy( _L8( "erronouspluginname" ) ); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin6* CAiFwTestContentPlugin6::NewL() +{ + CAiFwTestContentPlugin6* self = new (ELeave) CAiFwTestContentPlugin6; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin6::~CAiFwTestContentPlugin6() +{ +delete iInfo; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin6::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::Resume(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::Suspend(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::Stop(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::SubscribeL(MAiContentObserver& /*aObserver*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin6::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty && iExtCount < 2) + { + ++iExtCount; + return static_cast(this); + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin6::GetPropertyL(TInt /*aProperty*/) +{ + return iInfo; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::SetPropertyL(TInt aProperty, TAny* aValue) + { + if( aValue ) + { + switch( aProperty ) + { + case EAiPublisherInfo: + { + return; + } + } + } + + User::Leave(KErrNotSupported); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin6::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin6.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN6_H +#define AIFWTESTPLUGIN6_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin6 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin6* NewL(); + ~CAiFwTestContentPlugin6(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // from MAiPropertyExtension + virtual TAny* GetPropertyL(TInt aProperty); + virtual void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin6(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TInt iExtCount; + + TAiPublisherInfo* iInfo; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin7.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin7.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin7.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin7::CAiFwTestContentPlugin7() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::ConstructL() +{ + iInfo = new (ELeave) TAiPublisherInfo; + iInfo->iUid.iUid = KImplementationUidAiTestContentPlugin4; + iInfo->iName.Copy( _L8( "AiFwTestPlugin7" ) ); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin7* CAiFwTestContentPlugin7::NewL() +{ + CAiFwTestContentPlugin7* self = new (ELeave) CAiFwTestContentPlugin7; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin7::~CAiFwTestContentPlugin7() +{ + delete iInfo; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin7::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::Resume(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::Suspend(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::Stop(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::SubscribeL(MAiContentObserver& /*aObserver*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin7::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + return NULL; + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin7::GetPropertyL(TInt aProperty) +{ + if( aProperty == EAiPublisherInfo ) + { + iLeaveOrNull = !iLeaveOrNull; + if( !iLeaveOrNull ) + { + User::Leave( KErrNotSupported ); + } + } + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::SetPropertyL(TInt /*aProperty*/, TAny* /*aValue*/) + { + + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin7::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin7.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin7.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN7_H +#define AIFWTESTPLUGIN7_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aicontentmodel.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin7 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin7* NewL(); + ~CAiFwTestContentPlugin7(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // from MAiPropertyExtension + virtual TAny* GetPropertyL(TInt aProperty); + virtual void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin7(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TAiPublisherInfo* iInfo; + + TBool iLeaveOrNull; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin8.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin8.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin8.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin8::CAiFwTestContentPlugin8() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::ConstructL() +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin8* CAiFwTestContentPlugin8::NewL() +{ + CAiFwTestContentPlugin8* self = new (ELeave) CAiFwTestContentPlugin8; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin8::~CAiFwTestContentPlugin8() +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin8::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::Resume(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::Suspend(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::Stop(TAiTransitionReason /*aReason*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::SubscribeL(MAiContentObserver& /*aObserver*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin8::Extension(TUid /*aUid*/) +{ + User::Leave(KErrNotSupported); + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin8::GetPropertyL(TInt /*aProperty*/) +{ + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::SetPropertyL(TInt /*aProperty*/, TAny* /*aValue*/) + { + User::Leave(KErrNotSupported); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin8::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin8.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN8_H +#define AIFWTESTPLUGIN8_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin8 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin8* NewL(); + ~CAiFwTestContentPlugin8(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // from MAiPropertyExtension + virtual TAny* GetPropertyL(TInt aProperty); + virtual void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin8(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TBool iFirstExt; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin9.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin9.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestContentPlugin9.h" +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin9::CAiFwTestContentPlugin9() +{} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::ConstructL() +{ + iInfo = new (ELeave) TAiPublisherInfo; + iInfo->iUid.iUid = KImplementationUidAiTestContentPlugin4; + iInfo->iName.Copy( _L8( "AiFwTestPlugin4" ) ); +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin9* CAiFwTestContentPlugin9::NewL() +{ + CAiFwTestContentPlugin9* self = new (ELeave) CAiFwTestContentPlugin9; + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestContentPlugin9::~CAiFwTestContentPlugin9() +{ + delete iInfo; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestContentPlugin9::Callback(TAny* /*aPtr*/) +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::Resume(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::Suspend(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::Stop(TAiTransitionReason /*aReason*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::SubscribeL(MAiContentObserver& /*aObserver*/) +{ + +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin9::Extension(TUid /*aUid*/) +{ + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestContentPlugin9::GetPropertyL(TInt /*aProperty*/) +{ + return NULL; +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::SetPropertyL(TInt /*aProperty*/, TAny* /*aValue*/) + { + + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestContentPlugin9::HandleEvent(TInt /*aEvent*/, const TDesC& /*aParam*/) + { + + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin9.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestContentPlugin9.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AIFWTESTPLUGIN9_H +#define AIFWTESTPLUGIN9_H + +// INCLUDES +#include +#include "aicontentpublisher.h" +#include "aicontentmodel.h" +#include "aipropertyextension.h" +#include "aieventhandlerextension.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAiContentObserver; + +// CLASS DECLARATION + +/** + * ?one_line_short_description. + * ?other_description_lines + * + * @lib ?library + * @since Series ?XX ?SeriesXX_version + */ +class CAiFwTestContentPlugin9 : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension +{ +public: // Constructors and destructor + static CAiFwTestContentPlugin9* NewL(); + ~CAiFwTestContentPlugin9(); + +public: // from CAiContentPublisher + void Resume(TAiTransitionReason aReason); + void Suspend(TAiTransitionReason aReason); + void Stop(TAiTransitionReason aReason); + void SubscribeL(MAiContentObserver& aObserver); + void ConfigureL(RAiSettingsItemArray& aSettings); + TAny* Extension(TUid aUid); + +public: // from MAiPropertyExtension + virtual TAny* GetPropertyL(TInt aProperty); + virtual void SetPropertyL(TInt aProperty, TAny* aValue); + +public: // from MAiEventHandlerExtension + void HandleEvent(TInt aEvent, const TDesC& aParam); + +private: + CAiFwTestContentPlugin9(); + void ConstructL(); + static TInt Callback(TAny* aPtr); + +private: // Data + + TAiPublisherInfo* iInfo; + + TBool iLeaveOrNull; + +}; + +#endif // ?CLASSNAME_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,547 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestControllerPlugin.h" + +#include + +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +#include +#include "aifweventhandler.h" +#include +#include +#include "aiuiframeworkobserver.h" +using namespace AiTestUiController; + + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestControllerPlugin::CAiFwTestControllerPlugin() + { + } + +EXPORT_C CAiFwTestControllerPlugin* CAiFwTestControllerPlugin::Instance() + { + TAny* ptr = Dll::Tls(); + + if ( ptr ) + { + TAiTestTLSStorage* tlsSet = static_cast( ptr ); + return tlsSet->iControllerPlugin; + } + return NULL; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin::ConstructL() + { + TAiTestTLSStorage* tlsSet = TAiTestTLSStorage::CreateInstanceL(); + tlsSet->iControllerPlugin = this; + + iContent = AiUtility::CreateContentItemArrayIteratorL(KTestPluginContent); + iResources = AiUtility::CreateContentItemArrayIteratorL(KTestPluginResources); + iEvents = AiUtility::CreateContentItemArrayIteratorL(KTestPluginEvents); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestControllerPlugin* CAiFwTestControllerPlugin::NewL() + { + CAiFwTestControllerPlugin* self = new (ELeave) CAiFwTestControllerPlugin(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestControllerPlugin::~CAiFwTestControllerPlugin() + { + TAiTestTLSStorage::DestroyInstance(); + Release( iContent ); + Release( iResources ); + Release( iEvents ); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::StartTransaction(TInt /*aTxId*/) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::Commit(TInt /*aTxId*/) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::CancelTransaction(TInt /*aTxId*/) + { + return 0; + } + +TBool CAiFwTestControllerPlugin::CanPublish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, + TInt /*aIndex*/ ) + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) + { + /* // Read ref value. + MAiContentItemIterator* i = + (MAiContentItemIterator*) aPlugin->GetPropertyL( EAiPublisherResources ); + + const TAiContentItem& ref = i->ItemL( aResource ); + + const TDesC8& refType = ContentType( ref ); + const TDesC& refCid = ContentCid( ref ); + + if ( refType.Match( KDataTypeText ) != KErrNotFound ) + { + const TDesC* text = GetText( refCid ); + + if ( text ) + { + HBufC8* buf8 = HBufC8::NewLC( text->Length() ); + buf8->Des().Copy( *text ); + TPtrC8 ptr = buf8->Des(); + Publish( aPlugin, aContent, ptr ); + CleanupStack::PopAndDestroy(); // buf8 + } + } + + // TODO: Support another types. + */ + + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, const TDesC16& /*aBuf*/, TInt /*aIndex*/ ) + { + /* + MAiContentItemIterator* i = + (MAiContentItemIterator*) aPlugin->GetPropertyL( EAiPublisherContent ); + + const TAiContentItem& item = i->ItemL( aContent ); + + const TDesC8& type = ContentType( item ); + const TDesC& cid = ContentCid( item ); + + if ( type.Match( KDataTypeText ) != KErrNotFound ) + { + SetText( cid, aBuf ); + } + + // TODO: Support another types. + + */ + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex */) + { + /* + MAiContentItemIterator* i = + (MAiContentItemIterator*) aPlugin->GetPropertyL( EAiPublisherContent ); + + const TAiContentItem& item = i->ItemL( aContent ); + + const TDesC8& type = ContentType( item ); + const TDesC& cid = ContentCid( item ); + + if ( type.Match( KDataTypeText ) != KErrNotFound ) + { + SetText( cid, aBuf ); + } + + // TODO: Support another types. + + */ + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) + { + // TODO: get content from aFile. + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin::Clean( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, TInt /*aIndex*/ ) + { + // TODO: clean content. + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestControllerPlugin::Extension( TUid /*aUid*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TBool CAiFwTestControllerPlugin::RequiresSubscription( + const TAiPublisherInfo& aPublisherInfo ) const + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin::LoadUIDefinitionL() + { + iDefinitionLoaded = ETrue; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin::GetPluginsL( RAiPublisherInfoArray& aPlugins ) + { + TAiPublisherInfo info; + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin); + info.iName = _L( "AiFwTestPlugin" ); + info.iNamespace = _L8( "AiFw" ); + User::LeaveIfError( aPlugins.Append( info ) ); + /* + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin2); + info.iName = _L( "AiFwTestPlugin2" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin3); + info.iName = _L( "AiFwTestPlugin3" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin6); + info.iName = _L( "Plurgin" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin4); + info.iName = _L( "AiFwTestPlugin4" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin5); + info.iName = _L( "AiFwTestPlugin5" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin7); + info.iName = _L( "AiFwTestPlugin7" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin8); + info.iName = _L( "AiFwTestPlugin8" ); + User::LeaveIfError( aPlugins.Append( info ) ); + info.iUid = TUid::Uid(KImplementationUidAiTestContentPlugin9); + info.iName = _L( "AiFwTestPlugin9" ); + User::LeaveIfError( aPlugins.Append( info ) ); + */ + } + +void CAiFwTestControllerPlugin::GetSettingsL( + const TAiPublisherInfo& /*aPubInfo*/, + RAiSettingsItemArray& aSettings) + { + MAiPluginSettings* settings = AiUtility::CreatePluginSettingsL(); + CleanupDeletePushL(settings); + MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); + item.SetPublisherId( TUid::Uid( 0x10170FFF ) ); + item.SetValueL( _L("DesValue") ); + item.SetKey( 1 ); + + // This will fail as no cenrep is setup, -> TRAP it. + //TRAP_IGNORE( item.UpdateFromCenRepL() ); + + aSettings.AppendL( settings ); + CleanupStack::Pop( settings ); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin::RunApplicationL() + { + iRunApplicationCalled = ETrue; + SendReadyEventL(); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin::ActivateUI() + { + iUiActivated = ETrue; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +MAiContentObserver& CAiFwTestControllerPlugin::GetContentObserver() + { + return *this; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin::SetText( const TDesC8& /*aId*/, TPtrC8& /*aBuf*/ ) + { + /*TBuf id; + id.Copy( aId ); + HBufC* value = HBufC::NewLC( aBuf.Length() ); + value->Des().Copy( aBuf ); + + CXnNode* node = UiEngine()->FindNodeByIdL( id ); + + if ( node ) + { + node = node->Parent(); + MXnTextInterface* textIntr = CXnText::MakeInterfaceL( *node ); + + if ( textIntr ) + { + const TDesC* text = textIntr->Text(); + textIntr->SetTextL( value->Des() ); + CXnComponentNodeImpl* nodeImpl = node->ComponentNodeImpl(); + CXnComponent* component = nodeImpl->Component(); + CXnControlAdapter* adapter = component->ControlAdapter(); + adapter->DrawNow(); + } + } + + CleanupStack::PopAndDestroy(); // value*/ + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +const TDesC* CAiFwTestControllerPlugin::GetText( const TDesC8& /*aId*/ ) + { + /*TBuf id; + id.Copy( aId ); + + CXnNode* node = UiEngine()->FindNodeByIdL( id ); + + if ( node ) + { + node = node->Parent(); + MXnTextInterface* textIntr = CXnText::MakeInterfaceL( *node ); + + if ( textIntr ) + { + return textIntr->Text(); + } + } + */ + return NULL; + } + +void CAiFwTestControllerPlugin::HandleLoadedPlugins( + const RAiPublisherInfoArray& aPlugins ) + { + for ( int i = 0; i < aPlugins.Count(); ++i ) + { + iFwEventHandler->HandleLoadPluginL( aPlugins[i] ); + } + } + +void CAiFwTestControllerPlugin::SetEventHandler(MAiFwEventHandler& aEventHandler) + { + iFwEventHandler = &aEventHandler; + } + +EXPORT_C TBool CAiFwTestControllerPlugin::UiActivated() + { + return iUiActivated; + } + +EXPORT_C TBool CAiFwTestControllerPlugin::RunApplicationCalled() + { + return iRunApplicationCalled; + } + +EXPORT_C TBool CAiFwTestControllerPlugin::DefinitionLoaded() + { + return iDefinitionLoaded; + } + +EXPORT_C void CAiFwTestControllerPlugin::SendReadyEventL() + { + if( iFwEventHandler ) + { + iFwEventHandler->HandleUiReadyEventL(*this); + } + } + +EXPORT_C void CAiFwTestControllerPlugin::SendTestEventL() + { + if( iFwEventHandler ) + { + iFwEventHandler->HandlePluginEvent( KTestEvent ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/not_supp") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/not_supp()") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/not_supp(34342fvdsf)") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/test_event(34342fvdsf)") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/test_event)") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/test_event(") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin/test_event()") ); + iFwEventHandler->HandlePluginEvent( _L("someerrorevent/error") ); + iFwEventHandler->HandlePluginEvent( KTestEvent ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin4/error") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin3/error") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin7/error") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin7/error") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin7") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin7/test(ehe)") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlugin7/test()") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlu/test(grrraaah)") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlu/test(grrraaah") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlu/test(") ); + iFwEventHandler->HandlePluginEvent( _L("AiFwTestPlu/test)") ); + iFwEventHandler->HandlePluginEvent( _L("theme_change_noticed") ); + iFwEventHandler->HandlePluginEvent( KTestEvent ); + iFwEventHandler->HandlePluginEvent( KTestEvent ); + } + } + +EXPORT_C void CAiFwTestControllerPlugin::SetResourceChangedL( TInt aRes ) + { + iFwObserver->HandleResourceChange( aRes ); + } + +EXPORT_C void CAiFwTestControllerPlugin::SetForegroundL( TBool aFore ) + { + iFwObserver->HandleForegroundEvent( aFore ); + } + +EXPORT_C void CAiFwTestControllerPlugin::SetAppEnvReadyL() + { + TRAP_IGNORE( iFwEventHandler->AppEnvReadyL() ); + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef INC_AIFWTESTCONTROLLER_H +#define INC_AIFWTESTCONTROLLER_H + +// ========== INCLUDE FILES =================================================== + +#include +#include "aicontentobserver.h" +#include "aipropertyextension.h" +#include "AiUiController.h" +#include +#include +#include + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== DATA TYPES ====================================================== + +// ========== FUNCTION PROTOTYPES ============================================= + +// ========== FORWARD DECLARATIONS ============================================ + +class MAiContentItemIterator; +class TAiPublisherInfo; + +// ========== CLASS DECLARATION =============================================== + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series 60 3.1 +*/ +namespace AiTestUiController +{ +class CAiFwTestControllerPlugin : public CAiUiController, + public MAiContentObserver, + public MAiMainUiController + /*public MAiSecondaryUiController*/ + { + public: // Constructors and destructor + + static CAiFwTestControllerPlugin* NewL(); + + IMPORT_C static CAiFwTestControllerPlugin* Instance(); + + ~CAiFwTestControllerPlugin(); + + private: // Constructors + + CAiFwTestControllerPlugin(); + + void ConstructL(); + + public: // Functions from MAiContentObserver + + TInt StartTransaction( TInt aTxId ); + + TInt Commit( TInt aTxId ); + + TInt CancelTransaction( TInt aTxId ); + + TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aBuf, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); + + TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + TAny* Extension( TUid aUid ); + + TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + + public: // Functions from base class CAiUiController + + virtual void LoadUIDefinitionL(); + + virtual void GetSettingsL(const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray& aSettings); + + virtual void GetPluginsL( RAiPublisherInfoArray& aPlugins ); + + virtual void ActivateUI(); + + virtual void SetEventHandler(MAiFwEventHandler& aEventHandler); + + virtual MAiContentObserver& GetContentObserver(); + + virtual MAiMainUiController* MainInterface() + { + return this; + }; + + virtual MAiSecondaryUiController* SecondaryInterface() + { + return NULL; + }; + + virtual void HandleLoadedPlugins( const RAiPublisherInfoArray& aPlugins ); + + virtual void RunApplicationL(); + + virtual CCoeEnv& CoeEnv() + { + return *CCoeEnv::Static(); + }; + + virtual void Exit() + { + }; + + virtual TBool IsMenuOpen() + { + return ETrue; + }; + + virtual void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ) + { + iFwObserver = &aObserver; + }; + + virtual void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) + { + } + + public: // Test functions + + IMPORT_C TBool UiActivated(); + + IMPORT_C TBool RunApplicationCalled(); + + IMPORT_C TBool DefinitionLoaded(); + + IMPORT_C void SendReadyEventL(); + + IMPORT_C void SendTestEventL(); + + IMPORT_C void SetResourceChangedL( TInt aRes ); + + IMPORT_C void SetForegroundL( TBool aFore ); + + IMPORT_C void SetAppEnvReadyL(); + + protected: // New functions + + void SetText(const TDesC8& aId, TPtrC8& aBuf); + const TDesC* GetText(const TDesC8& aId); + + private: // Data + + TBool iUiActivated; + TBool iRunApplicationCalled; + TBool iDefinitionLoaded; + + MAiContentItemIterator* iContent; + MAiContentItemIterator* iResources; + MAiContentItemIterator* iEvents; + MAiFwEventHandler* iFwEventHandler; + + MAiUiFrameworkObserver* iFwObserver; + // Reserved pointer for future extension + //TAny* iReserved; +}; + +} // namespace AiTestUiController + +#endif + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin2.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,310 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include "AiFwTestControllerPlugin2.h" +#include + +#include "AiFwTestDefines.h" +#include "AiFwTestContentModel.h" + +using namespace AiTestUiController2; + + +// ========== EXTERNAL DATA STRUCTURES ======================================== + +// ========== EXTERNAL FUNCTION PROTOTYPES ==================================== + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== LOCAL CONSTANTS AND MACROS ====================================== + +// ========== MODULE DATA STRUCTURES ========================================== + +// ========== LOCAL FUNCTION PROTOTYPES ======================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== LOCAL FUNCTIONS ================================================= + +// ========== MEMBER FUNCTIONS ================================================ + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestControllerPlugin2::CAiFwTestControllerPlugin2() + { + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin2::ConstructL() + { + User::Leave( KErrNotFound ); + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestControllerPlugin2* CAiFwTestControllerPlugin2::NewL() + { + CAiFwTestControllerPlugin2* self = new (ELeave) CAiFwTestControllerPlugin2(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +CAiFwTestControllerPlugin2::~CAiFwTestControllerPlugin2() + { + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::StartTransaction(TInt /*aTxId*/) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::Commit(TInt /*aTxId*/) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::CancelTransaction(TInt /*aTxId*/) + { + return 0; + } + +TBool CAiFwTestControllerPlugin2::CanPublish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, + TInt /*aIndex*/ ) + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, const TDesC16& /*aBuf*/, TInt /*aIndex */) + { + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex */) + { + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::Publish( MAiPropertyExtension& /*aPlugin*/, + TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) + { + // TODO: get content from aFile. + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TInt CAiFwTestControllerPlugin2::Clean( MAiPropertyExtension& /*aPlugin*/, TInt /*aContent*/, TInt /*aIndex*/ ) + { + // TODO: clean content. + + return 0; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TAny* CAiFwTestControllerPlugin2::Extension( TUid /*aUid*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +TBool CAiFwTestControllerPlugin2::RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin2::LoadUIDefinitionL() + { + iDefinitionLoaded = ETrue; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin2::GetPluginsL( RAiPublisherInfoArray& /*aPlugins */) + { + } + +void CAiFwTestControllerPlugin2::GetSettingsL(const TAiPublisherInfo& /*aPubInfo*/, RAiSettingsItemArray& /*aSettings*/) +{ +} + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin2::RunApplicationL() + { + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin2::ActivateUI() + { + iUiActivated = ETrue; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +MAiContentObserver& CAiFwTestControllerPlugin2::GetContentObserver() + { + return *this; + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +void CAiFwTestControllerPlugin2::SetText( const TDesC8& /*aId*/, TPtrC8& /*aBuf*/ ) + { + } + +// ---------------------------------------------------------------------------- +// +// +// +// ---------------------------------------------------------------------------- +// +const TDesC* CAiFwTestControllerPlugin2::GetText( const TDesC8& /*aId*/ ) + { + return NULL; + } + +void CAiFwTestControllerPlugin2::SetEventHandler(MAiFwEventHandler& aEventHandler) + { + iFwEventHandler = &aEventHandler; + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestControllerPlugin2.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef INC_AIFWTESTCONTROLLER2_H +#define INC_AIFWTESTCONTROLLER2_H + +// ========== INCLUDE FILES =================================================== + +#include +#include "aicontentobserver.h" +#include "aipropertyextension.h" +#include "AiUiController.h" +#include +#include + +// ========== CONSTANTS ======================================================= + +// ========== MACROS ========================================================== + +// ========== DATA TYPES ====================================================== + +// ========== FUNCTION PROTOTYPES ============================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== CLASS DECLARATION =============================================== + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series 60 3.1 +*/ +namespace AiTestUiController2 +{ +class CAiFwTestControllerPlugin2 : public MAiSecondaryUiController, + public MAiContentObserver + { + public: // Constructors and destructor + + static CAiFwTestControllerPlugin2* NewL(); + + IMPORT_C static CAiFwTestControllerPlugin2* Instance(); + + virtual ~CAiFwTestControllerPlugin2(); + + private: // Constructors + + CAiFwTestControllerPlugin2(); + + void ConstructL(); + + public: // Functions from MAiContentObserver + + TInt StartTransaction( TInt aTxId ); + + TInt Commit( TInt aTxId ); + + TInt CancelTransaction( TInt aTxId ); + + TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aBuf, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); + + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); + + TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + TAny* Extension( TUid aUid ); + + TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + + public: // Functions from base classes CAiUiController + + void LoadUIDefinitionL(); + + void GetSettingsL(const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray& aSettings); + + void GetPluginsL( RAiPublisherInfoArray& aPlugins ); + + void RunApplicationL(); + + virtual void ActivateUI(); + + virtual void SetEventHandler(MAiFwEventHandler& aEventHandler); + + void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) + { + } + + virtual MAiContentObserver& GetContentObserver(); + + MAiMainUiController* MainInterface() + { + return NULL; + }; + + MAiSecondaryUiController* SecondaryInterface() + { + return this; + }; + + virtual void SetCoeEnv( CCoeEnv& /*aCoeEnv*/ ) + { + }; + + virtual MAiUiFrameworkObserver* UiFrameworkObserver() + { + return NULL; + }; + + protected: // New functions + + void SetText(const TDesC8& aId, TPtrC8& aBuf); + + const TDesC* GetText(const TDesC8& aId); + + private: // Data + + TBool iUiActivated; + + TBool iDefinitionLoaded; + + MAiFwEventHandler* iFwEventHandler; + // Reserved pointer for future extension + //TAny* iReserved; +}; + +} // namespace AiTestUiController + +#endif + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestDefines.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestDefines.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef INC_AIFWTESTDEFINES_H +#define INC_AIFWTESTDEFINES_H + +// ========== INCLUDE FILES =================================================== + +#include "aicontentmodel.h" +#include "AiFwTestContentPlugin.h" +#include "AiFwTestControllerPlugin.h" + +// ========== CONSTANTS ======================================================= + +using namespace AiTestUiController; + +const TInt KImplementationUidAiTestContentPlugin = 0x10170010; +const TInt KImplementationUidAiFwTestUiController = 0x10170011; +const TInt KImplementationUidAiFwTestUiController2 = 0x10170016; +const TInt KImplementationUidAiTestContentPlugin2 = 0x10170012; +const TInt KImplementationUidAiTestContentPlugin3 = 0x10170013; +const TInt KImplementationUidAiTestContentPlugin4 = 0x10170014; +const TInt KImplementationUidAiTestContentPlugin5 = 0x10170015; +const TInt KImplementationUidAiTestContentPlugin6 = 0x10170017; +const TInt KImplementationUidAiTestContentPlugin7 = 0x10170018; +const TInt KImplementationUidAiTestContentPlugin8 = 0x10170019; +const TInt KImplementationUidAiTestContentPlugin9 = 0x10170020; + +_LIT( KTestEvent, "AiFwTestPlugin/test_event" ); + +// ========== MACROS ========================================================== + +// ========== DATA TYPES ====================================================== + +struct TAiTestTLSStorage + { + CAiFwTestContentPlugin* iContentPlugin; + CAiFwTestControllerPlugin* iControllerPlugin; + + TAiTestTLSStorage(); + static TAiTestTLSStorage* CreateInstanceL(); + static void DestroyInstance(); + }; + +// ========== FUNCTION PROTOTYPES ============================================= + +// ========== FORWARD DECLARATIONS ============================================ + +// ========== CLASS DECLARATION =============================================== + +#endif + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestPlugins.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestPlugins.rss Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// INCLUDES +#include +#include + +#include "aicontentpublisheruid.hrh" +#include "aiuicontrolleruid.hrh" + +//#include + + +// CONSTANTS +//#define ?constant ?value + + +// MACROS +//#define ?macro + + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// ?resource_name +// ?description +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + // UID for the DLL + dll_uid = 0x10170001; + + // Interface info array + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170010; + version_no = 1; + display_name = "AiFwTestPlugin"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_UICONTROLLER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170011; + version_no = 1; + display_name = "AiFwTestController"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_UICONTROLLER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170016; + version_no = 1; + display_name = "AiFwTestController2"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170012; + version_no = 1; + display_name = "AiFwTestPlugin2"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170013; + version_no = 1; + display_name = "AiFwTestPlugin3"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170014; + version_no = 1; + display_name = "AiFwTestPlugin4"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170015; + version_no = 1; + display_name = "AiFwTestPlugin5"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170017; + version_no = 1; + display_name = "AiFwTestPlugin6"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170018; + version_no = 1; + display_name = "AiFwTestPlugin7"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170019; + version_no = 1; + display_name = "AiFwTestPlugin8"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + }, + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10170020; + version_no = 1; + display_name = "AiFwTestPlugin9"; + default_data = ""; + opaque_data = " "; + rom_only = 1; + } + }; + } + }; +} + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestPluginsDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestPluginsDllMain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER + +#ifndef __SECURE_API__ +/** + * Standard Symbian DLL entry point function. + */ +GLDEF_C TInt E32Dll(TDllReason) + { + return KErrNone; + } +#endif + +// END OF FILE + + + + + + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/AiFwTestPluginsMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/AiFwTestPluginsMain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "AiFwTestContentPlugin.h" +#include "AiFwTestContentPlugin2.h" +#include "AiFwTestContentPlugin3.h" +#include "AiFwTestContentPlugin4.h" +#include "AiFwTestContentPlugin5.h" +#include "AiFwTestContentPlugin6.h" +#include "AiFwTestContentPlugin7.h" +#include "AiFwTestContentPlugin8.h" +#include "AiFwTestContentPlugin9.h" +#include "AiFwTestControllerPlugin.h" +#include "AiFwTestControllerPlugin2.h" +#include "AiFwTestDefines.h" +#include + +using namespace AiTestUiController; +using namespace AiTestUiController2; + +TAiTestTLSStorage::TAiTestTLSStorage() : + iContentPlugin(NULL), + iControllerPlugin(NULL) + { + } + +TAiTestTLSStorage* TAiTestTLSStorage::CreateInstanceL() + { + TAiTestTLSStorage* inst = NULL; + TAny* ptr = Dll::Tls(); + + if ( !ptr ) + { + inst = new(ELeave) TAiTestTLSStorage; + User::LeaveIfError(Dll::SetTls( inst )); + } + else + { + inst = static_cast( ptr ); + } + return inst; + } + +void TAiTestTLSStorage::DestroyInstance() + { + TAny* ptr = Dll::Tls(); + TAiTestTLSStorage* tlsSet = static_cast( ptr ); + + if ( tlsSet ) + { + delete tlsSet; + Dll::SetTls( NULL ); + } + } + +const TImplementationProxy KImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin, CAiFwTestContentPlugin::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiFwTestUiController, CAiFwTestControllerPlugin::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiFwTestUiController2, CAiFwTestControllerPlugin2::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin2, CAiFwTestContentPlugin2::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin3, CAiFwTestContentPlugin3::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin4, CAiFwTestContentPlugin4::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin5, CAiFwTestContentPlugin5::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin6, CAiFwTestContentPlugin6::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin7, CAiFwTestContentPlugin7::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin8, CAiFwTestContentPlugin8::NewL), + IMPLEMENTATION_PROXY_ENTRY(KImplementationUidAiTestContentPlugin9, CAiFwTestContentPlugin9::NewL) +}; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); + return KImplementationTable; +} + +// END OF FILE + + + + + + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/CAOUserAfter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/CAOUserAfter.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,89 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __CAOUSERAFTER_H__ +#define __CAOUSERAFTER_H__ + +// INCLUDES +#include +#include +#include + + +/** + * Active object version of User::After() + */ +class CAOUserAfter : public CTimer + { + private: + CActiveSchedulerWait iWait; + TInt iLength; + + + public: //new functions + + /** + * Constructs the waiting timer, executes + * it and when timer expires, deletes self. + * @param aLength The lenghth of wait in micro + * seconds. + */ + static void AfterLD( TInt aLenght ) + { + CAOUserAfter* wait= new ( ELeave ) CAOUserAfter( aLenght ); + CleanupStack::PushL( wait ); + wait->ConstructL(); + CleanupStack::Pop(); + + RDebug::Print( _L("CAOUserAfter - Starting time consuming...") ); + wait->StartWaitD(); + RDebug::Print( _L("CAOUserAfter - completed.") ); + } + + private: + CAOUserAfter( TInt aLenght ) + : CTimer( CActive::EPriorityStandard ), + iLength( aLenght ) + { + } + + void ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + + virtual ~CAOUserAfter() + { + } + + void StartWaitD() + { + After( iLength ); + iWait.Start(); + } + + void RunL() + { + iWait.AsyncStop(); + Cancel(); + delete this; + } + }; + +#endif // __CAOUSERAFTER_H__ +// End of File + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/MT_aifw.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/MT_aifw.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,281 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_aifw.h" +#include "aifw.h" +#include "AiFwTestContentPlugin.h" +#include "aicontentobserver.h" +#include "aipluginactivitypstool.h" +#include "caouserafter.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include // this include needs to be last +#include + +using namespace AiTestUiController; + +const TUint32 KAiFwCenrepKey( 0x2001952B ); + +void CopyFile1() + { + RFs fss; + fss.Connect(); + TInt err = BaflUtils::CopyFile( fss, + _L("z:\\system\\apps\\aifweunit\\10275102_1.cre"), + _L("c:\\private\\10202be9\\persists\\10275102.cre") ); + fss.Close(); + } + +void CopyFile2() + { + RFs fss; + fss.Connect(); + TInt err = BaflUtils::CopyFile( fss, + _L("z:\\system\\apps\\aifweunit\\10275102_2.cre"), + _L("c:\\private\\10202be9\\persists\\10275102.cre") ); + fss.Close(); + } + +void DeleteFile() + { + RFs fss; + fss.Connect(); + TInt err = BaflUtils::DeleteFile( fss, + _L("c:\\private\\10202be9\\persists\\10275102.cre") ); + fss.Close(); + } + +void ChangeSSValueL( TInt aValue ) + { + RProperty::Define( KPSUidScreenSaver, + KScreenSaverOn, + RProperty::EInt ); + + User::LeaveIfError( RProperty::Set( KPSUidScreenSaver, + KScreenSaverOn, + aValue ) ); + + } + +void ChangeBackupValueL( TInt aValue ) + { + RProperty::Define( KUidSystemCategory, + conn::KUidBackupRestoreKey, + RProperty::EInt ); + + User::LeaveIfError( RProperty::Set( KUidSystemCategory, + conn::KUidBackupRestoreKey, + aValue ) ); + + } + +// INTERNAL INCLUDES + +// CONSTRUCTION +MT_aifw* MT_aifw::NewL() + { + MT_aifw* self = MT_aifw::NewLC(); + CleanupStack::Pop(); + + return self; + } + +MT_aifw* MT_aifw::NewLC() + { + MT_aifw* self = new( ELeave ) MT_aifw(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +MT_aifw::~MT_aifw() + { + delete iFramework; + DeleteFile(); + } + +// Default constructor +MT_aifw::MT_aifw() + { + } + +// Second phase construct +void MT_aifw::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + SetupL(); + Teardown(); + } + +// METHODS + + +void MT_aifw::SetupL( ) + { + CopyFile1(); + iFramework = CAiFw::NewLC(); + CleanupStack::Pop( iFramework ); + iControllerPlugin = AiTestUiController::CAiFwTestControllerPlugin::Instance( /**iFramework*/ ); + //iControllerPlugin->SetAppEnvReadyL(); + //iControllerPlugin->SendReadyEventL(); + CAOUserAfter::AfterLD( 1 * 1000000 ); + + RAiPublisherInfoArray aPlugins; + iControllerPlugin->GetPluginsL( aPlugins ); + iControllerPlugin->HandleLoadedPlugins( aPlugins ); + + iContentPlugin = CAiFwTestContentPlugin::Instance(); + iContentPlugin->SubscribeL( *iControllerPlugin ); + iContentPlugin->Resume(EAiSystemStartup); + } + + +void MT_aifw::Teardown( ) + { + delete iFramework; + iFramework = NULL; + DeleteFile(); + } + +void MT_aifw::TestStartupL( ) + { + EUNIT_ASSERT( iControllerPlugin != NULL ); + EUNIT_ASSERT( iContentPlugin != NULL ); + } + +void MT_aifw::TestSubscriptionL( ) + { + RPointerArray& observers = iContentPlugin->Observers(); + TBool match = EFalse; + + for( TInt i = 0; i < observers.Count(); ++i ) + { + MAiContentObserver* obs = observers[i]; + if( obs == static_cast( iControllerPlugin ) ) + { + match = ETrue; + break; + } + } + + EUNIT_ASSERT( match ); + } + +void MT_aifw::TestStartupResumeL( ) + { +/* iControllerPlugin->SetForegroundL( EFalse ); + iControllerPlugin->SetForegroundL( ETrue ); + CAOUserAfter::AfterLD( 1 * 1000000 ); + iControllerPlugin->SetResourceChangedL( 0xfff );*/ + EUNIT_ASSERT( iContentPlugin->WasResumed() ); + } + +void MT_aifw::TestUiActivationL( ) + { + //EUNIT_ASSERT( iControllerPlugin->UiActivated() ); + } + +void MT_aifw::TestUiDefinitionLoadL( ) + { + //EUNIT_ASSERT( iControllerPlugin->DefinitionLoaded() ); + } + +void MT_aifw::TestSettingsPassingL( ) + { + EUNIT_ASSERT( iContentPlugin->WasConfigured() ); + } + +void MT_aifw::TestEventForwardingL( ) + { + iControllerPlugin->SendTestEventL(); + EUNIT_ASSERT( iContentPlugin->EventReceived()); + /*ChangeSSValueL( ETrue ); + ChangeSSValueL( EFalse ); + ChangeBackupValueL( conn::EBURNormal ); + ChangeBackupValueL( conn::KBURPartTypeMask ^ conn::EBURNormal );*/ + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + MT_aifw, + "Module test for XML AI framework.", + "MODULE" ) + +EUNIT_ALLOC_TEST( + "System startup setup test", // Test name + "Framework", // Class + "", // Method + "FUNCTIONALITY", + SetupL, TestStartupL, Teardown) + +EUNIT_ALLOC_TEST( + "Test plugin subscription", + "FW/Plugin manager", + "", + "FUNCTIONALITY", + SetupL, TestSubscriptionL, Teardown) + +EUNIT_TEST( + "Startup resume call", + "FW/Plugin manager", + "", + "FUNCTIONALITY", + SetupL, TestStartupResumeL, Teardown) + +EUNIT_ALLOC_TEST( + "Startup UI activation call", + "FW/UI Controller manager", + "", + "FUNCTIONALITY", + SetupL, TestUiActivationL, Teardown) + +EUNIT_ALLOC_TEST( + "Startup UI definition load call", + "FW/UI Controller manager", + "", + "FUNCTIONALITY", + SetupL, TestUiDefinitionLoadL, Teardown) + +EUNIT_ALLOC_TEST( + "Settings passing", + "FW/UI Controller manager", + "", + "FUNCTIONALITY", + SetupL, TestSettingsPassingL, Teardown) + +EUNIT_ALLOC_TEST( + "Plugin event forwarding", + "FW/Plugin manager", + "", + "FUNCTIONALITY", + SetupL, TestEventForwardingL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/MT_aifw.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/MT_aifw.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MT_AIFW_H__ +#define __MT_AIFW_H__ + +// EXTERNAL INCLUDES +#include +#include "AiFwTestControllerPlugin.h" +#include "aiuiframeworkobserver.h" + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS + +class CAiFw; +class CAiFwTestContentPlugin; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( MT_aifw ) + : public CEUnitTestSuiteClass, + public MAiUiFrameworkObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_aifw* NewL(); + static MT_aifw* NewLC(); + /** + * Destructor + */ + ~MT_aifw(); + + private: // Constructors and destructors + + MT_aifw(); + void ConstructL(); + + public: // From observer interface + + void HandleResourceChange( TInt /*aType*/ ) + { + }; + + void HandleForegroundEvent( TBool /*aForeground*/ ) + { + }; + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void TestStartupL(); + + void TestSubscriptionL(); + + void TestStartupResumeL(); + + void TestUiActivationL(); + + void TestUiDefinitionLoadL(); + + void TestSettingsPassingL(); + + void TestEventForwardingL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CAiFw* iFramework; + + AiTestUiController::CAiFwTestControllerPlugin* iControllerPlugin; + + CAiFwTestContentPlugin* iContentPlugin; + + }; + +#endif // __MT_AIFW_H__ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/mt_aifw/MT_aifwDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/mt_aifw/MT_aifwDllMain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_aifw.h" + +// EXTERNAL INCLUDES +#include + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return MT_aifw::NewL(); + } + +#ifndef __SECURE_API__ +/** + * Standard Symbian DLL entry point function. + */ +GLDEF_C TInt E32Dll(TDllReason) + { + return KErrNone; + } +#endif + +// END OF FILE + + + + + + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inf for coverage testing +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS +#include "../group/bld.inf" \ No newline at end of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/generate_armv5.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/generate_armv5.cmd Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,27 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem +@rem Description: +@rem +@rem + + + +@ECHO OFF + +ECHO ********** Build coverage report ********** + +call "C:\Apps\ctc\Sym_armv5\ctcrecvr.exe" -i ctcdata.txt +call ctcpost -p profile.txt +call ctc2html -i profile.txt diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/generate_winscw.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/generate_winscw.cmd Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,25 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem +@rem Description: +@rem +@rem + + +@ECHO OFF + +ECHO ********** Build coverage report ********** + +call ctcpost -p profile.txt +call ctc2html -i profile.txt diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/instrument_armv5_decision.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/instrument_armv5_decision.cmd Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,36 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem +@rem Description: +@rem +@rem + + + +@ECHO OFF +setlocal + +ECHO ********** Clean the environment ********** + +call sbs -c armv5_urel reallyclean -k +call del profile.txt +call del mon.sym +call del mon.dat + +ECHO ********** Build module tests and Instrument test subjects ********** + +call ctcwrap -i d -2comp sbs -c armv5_urel + +ECHO Generate image now. When you're done, copy ctcdata.txt into this directory +ECHO and call generate.cmd \ No newline at end of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/instrument_armv5_function.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/instrument_armv5_function.cmd Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,36 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem +@rem Description: +@rem +@rem + + + +@ECHO OFF +setlocal + +ECHO ********** Clean the environment ********** + +call sbs -c armv5_urel reallyclean -k +call del profile.txt +call del mon.sym +call del mon.dat + +ECHO ********** Build module tests and Instrument test subjects ********** + +call ctcwrap -i f -2comp sbs -c armv5_urel + +ECHO Generate image now. When you're done, copy ctcdata.txt into this directory +ECHO and call generate.cmd diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/instrument_winscw_decision.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/instrument_winscw_decision.cmd Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,35 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem +@rem Description: +@rem +@rem + + +@ECHO OFF +setlocal + +ECHO ********** Clean the environment ********** + +call sbs -c winscw_udeb reallyclean -k +call del profile.txt +call del mon.sym +call del mon.dat + +ECHO ********** Build module tests and Instrument test subjects ********** + +call ctcwrap -i d -2comp sbs -c winscw_udeb + +ECHO Start the emulator and run your tests now. Call "generate.cmd" when you're done. +ECHO NOTE! Close the emulator before calling generate.cmd diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/coverage/instrument_winscw_function.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/coverage/instrument_winscw_function.cmd Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,37 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem +@rem Description: +@rem +@rem + + + +@ECHO OFF +setlocal + +ECHO ********** Clean the environment ********** + +call sbs -c winscw_udeb reallyclean -k +call del profile.txt +call del mon.sym +call del mon.dat + +ECHO ********** Build module tests and Instrument test subjects ********** + +call ctcwrap -i f -2comp sbs -c winscw_udeb + +ECHO Start the emulator and run your tests now. Call "generate.cmd" when you're done. +ECHO NOTE! Close the emulator before calling generate.cmd + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +#include "../ut_aistatemanager/group/bld.inf" +#include "../ut_aistateprovider/group/bld.inf" +#include "../ut_aipluginfactory/group/bld.inf" +#include "../ut_aieventhandler/group/bld.inf" +#include "../ut_aiecomobserver/group/bld.inf" +#include "../ut_aiuicontrollermanager/group/bld.inf" +#include "../ut_hspublisherinfo/group/bld.inf" +#include "../ut_aicpscommandbuffer/group/bld.inf" +#include "../ut_aicpsexecuteparam/group/bld.inf" + + +PRJ_TESTMMPFILES diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/inc/aifw_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/inc/aifw_stub.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AiFw stub +* +*/ + + +#ifndef _AIFW_STUB_H +#define _AIFW_STUB_H + +// System includes +#include + +// User includes + +// Forward declarations +class CRepository; + +// Class declaration +/** + * @ingroup group_aifw + * + * AiFw stub. + */ +NONSHARABLE_CLASS( CAiFw ) : public CBase + { +public: + // constructors and destructor + + /** + * Leaving constructor + */ + static CAiFw* NewL(); + + /** + * Leaving constructor + */ + static CAiFw* NewLC(); + + /** + * Destructor + */ + ~CAiFw(); + +private: + // constructors + + /** + * Default C++ constructor + */ + CAiFw(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +public: + // new functions + + /** + * Get repository + * + * @since S60 5.2 + * @return Repositury + */ + CRepository& Repository() const; + +private: + // data + + /** Idle repository, Owned. */ + CRepository* iRepository; + }; + +#endif // _AIFW_STUB_H + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/inc/aipluginfactory_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/inc/aipluginfactory_stub.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content publisher factory stub +* +*/ + + + +#ifndef _AIPLUGINCFACTORY_STUB_H +#define _AIPLUGINCFACTORY_STUB_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CAiUiControllerManager; +class CAiStateManager; +class CAiCpsCommandBuffer; +class TAiFwPublisherInfo; +class CHsContentPublisher; +class THsPublisherInfo; + +// Class declaration +/** + * @ingroup group_aifw + * + * Plugin factory class for Active idle framework. + * + * @lib aifw + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiPluginFactory ) : public CTimer + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiPluginFactory* NewL( CAiUiControllerManager& aManager ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Destructor + */ + ~CAiPluginFactory(); + +public: + // new functions + + /** + * Lists KInterfaceUidHsContentPlugin ECom implementations + * + * @since S60 5.2 + */ + void ListImplementationsL(); + + /** + * Schedules plugin loading + * + * @since S60 5.2 + * @param aInfo Plugin to load + */ + void LoadPlugin( const TAiFwPublisherInfo& aInfo ); + + /** + * Schedules plugin destroyal + * + * @since S60 5.2 + * @param aInfo Plugin to destroy + */ + void DestroyPlugin( const TAiFwPublisherInfo& aInfo ); + + /** + * Destroy plugin + * + * @since S60 5.2 + * @param aUid Implementation UID of a plugin to destroy. + */ + void DestroyPlugin( + const TUid& aUid ); + + /** + * Destroys all plugins during system shutdown + * + * @since S60 5.2 + */ + void DestroyAllPlugins(); + + /** + * Flushes cps command buffer + * + * @since S60 5.2 + */ + void FlushCommandBuffer(); + + /** + * Finds plugin by publisher info. + * + * @since S60 5.2 + * @param aInfo publisher info. + * @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership. + */ + CHsContentPublisher* PluginByInfo( + const THsPublisherInfo& aPublisherInfo ) const; + + /** + * Finds plugin by uid. + * + * @since S60 5.2 + * @param aInfo publisher uid. + * @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership. + */ + CHsContentPublisher* PluginByUid( const TUid& aUid ) const; + + /** + * Finds plugin by name. + * + * @since S60 5.2 + * @param aInfo publisher info. + * @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership. + */ + CHsContentPublisher* PluginByName( const TDesC& aName ) const; + + /** + * Sets state manager + * + * @since S60 5.2 + * @param aStateManager State Manager + */ + void SetStateManager( CAiStateManager* aStateManager ); + + /** + * Gets all plugins from factory + * + * @since S60 5.2 + * @return Array of plugins + */ + RPointerArray< CHsContentPublisher >& Publishers() const; + +private: + // from CTimer + + /** + * @see CTimer + */ + void RunL(); + + /** + * @see CTimer + */ + void DoCancel(); + +private: + // private constructors + + /** + * C++ default constructor + */ + CAiPluginFactory( CAiUiControllerManager& aManager ); + +private: + // new functions + + TInt DoCreatePlugin( + const TAiFwPublisherInfo& aPublisherInfo ); + + void DoDestroyPlugin( + const TAiFwPublisherInfo& aPublisherInfo ); + + void DoCreatePluginL( + const TAiFwPublisherInfo& aPublisherInfo ); + + void SubscribePluginL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ); + + void ConfigurePluginL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ); + + void HandleQueueChanged(); + + static TInt ProcessQueue( TAny* aAny ); + +private: + // data + + /** UI Controller Manager, Not owned */ + CAiUiControllerManager& iUiControllerManager; + /** State Manager, Not owned */ + CAiStateManager* iStateManager; + /** Cps command buffer, Owned */ + CAiCpsCommandBuffer* iCommandBuffer; + /** Queue starter, Owned */ + CPeriodic* iStarter; + /** Array of loaded data plugins, Owned */ + mutable RPointerArray< CHsContentPublisher > iPublishers; + /** Ecom implementation info, Owned */ + RImplInfoPtrArray iEComPlugins; + /** Load queue, Owned */ + RArray< TAiFwPublisherInfo > iLoadQueue; + /** Destroy queue, Owned */ + RArray< TAiFwPublisherInfo > iDestroyQueue; + /** Flag to determine wheter flush is allowed */ + TBool iAllowFlush; + +private: + // friend classes + +#ifdef _AIFW_UNIT_TEST + friend class UT_AiPluginFactory; +#endif + }; + +#endif // _AIPLUGINCFACTORY_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/inc/aiuicontroller_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/inc/aiuicontroller_stub.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UI controller stub +* +*/ + + +#ifndef _AIUICONTROLLER_STUB_H +#define _AIUICONTROLLER_STUB_H + +// System includes +#include + +// User includes +#include +#include + +#include + +// Forward declarations +class MAiContentObserver; +class MAiFwEventHandler; +class MAiFwStateHandler; +class MAiMainUiController; +class MAiSecondaryUiController; + +// Class declaration +/** + * @ingroup group_aifw + * + * Active Idle UI Controller stub. + * + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiUiControllerStub ) : public CAiUiController, + public MAiMainUiController, + public MAiSecondaryUiController, + public MAiContentObserver + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiUiControllerStub* NewL(); + + /** + * Two-phased constructor. + */ + static CAiUiControllerStub* NewL( TUid aImpUid ); + + /** + * Destructor + */ + ~CAiUiControllerStub(); + +public: + // from CAiUiController + + /** + * Instructs this UI controller to load its UI definition. + * + * @since Series 60 3.2 + */ + void LoadUIDefinitionL(); + + /** + * Retrieves plug-in settings specified in this UI controller's UI definition. + * + * @param aPublisherInfo Publisher info of the plug-in for which to + * retrieve settings for. + * @param aSettings array to get settings items to. + */ + void GetSettingsL( + const THsPublisherInfo& aPublisherInfo, + RAiSettingsItemArray& aSettings ); + + /** + * Activate UI managed by this UI controller. + * + * @since Series 60 3.2 + */ + void ActivateUI(); + + /** + * Returns content observer interface implemented by this UI controller. + * + * @since Series 60 3.2 + * @return reference to content observer implementation. + */ + MAiContentObserver& GetContentObserver(); + + /** + * Sets the Active Idle Framework event handler for this UI Controller. + * + * @since Series 60 3.2 + * @param aEventHandler Framework event handler for this UI controller. + * Set to NULL to disable event callbacks from this + * UI Controller. + */ + void SetEventHandler( MAiFwEventHandler& aEventHandler ); + + /** + * Sets plugin state handler + * + * @since S60 5.2 + * @param aHandler Plugin State Handler + */ + void SetStateHandler( MAiFwStateHandler& aStateHandler ); + + /** + * Returns the main UI Controller interface, or NULL if this is not the + * main UI controller. + */ + MAiMainUiController* MainInterface(); + + /** + * Returns the secondary UI Controller interface, or NULL if this is not + * a secondary UI controller. + */ + MAiSecondaryUiController* SecondaryInterface(); + +public: + // from MAiMainUiController + + /** + * @see MAiMainUiController + */ + void RunApplicationL(); + + /** + * @see MAiMainUiController + */ + CCoeEnv& CoeEnv(); + + /** + * @see MAiMainUiController + */ + void Exit(); + + /** + * @see MAiMainUiController + */ + TBool IsMenuOpen(); + +public: + // from MAiSecondaryUiController + + /** + * @see MAiSecondaryUiController + */ + void SetCoeEnv( CCoeEnv& aCoeEnv ); + +public: + // from MAiContentObserver + + /** + * @see MAiContentObserver + */ + TInt StartTransaction( TInt aTxId ); + + TInt Commit( TInt aTxId ); + + TInt CancelTransaction( TInt aTxId ); + + TBool CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); + + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); + + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); + + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); + + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); + + TInt Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); + + TAny* Extension( TUid aUid ); + + TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const; + + TInt SetProperty( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue ); + + TInt SetProperty( CHsContentPublisher& aPlugin, + const TDesC8& aElementId, + const TDesC8& aPropertyName, + const TDesC8& aPropertyValue, + MAiContentObserver::TValueType aValueType); +private: + // private constructors + + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CAiUiControllerStub(); + +public: + // data + TBool iMain; + TBool iRunning; + TBool iExit; + TBool iActive; + TBool iSettings; + TBool iUiDefinition; + TBool iEventHandler; + TBool iStateHandler; + }; + +#endif // _AIUICONTROLLER_STUB_H + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/inc/aiuicontrollermanager_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/inc/aiuicontrollermanager_stub.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UI controller manager stub +* +*/ + + +#ifndef _AIUICONTROLLERMANAGER_STUB_H +#define _AIUICONTROLLERMANAGER_STUB_H + +// System includes +#include + +// User includes + +// Forward declarations +class CAiUiController; + +// Class declaration +/** + * @ingroup group_aifw + * + * Active Idle UI Controller manager. + * + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiUiControllerManager ) : public CBase + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiUiControllerManager* NewL(); + + /** + * Destructor + */ + ~CAiUiControllerManager(); + +public: + // new functions + + /** + * Gets UI controllers + * + * @since S60 5.2 + * @return Array of UI controllers + */ + RPointerArray< CAiUiController >& UiControllers() const; + + /** + * Actives UI by calling ActivateUI() for each UI controller + * + * @since S60 5.2 + */ + //void ActivateUI(); + + /** + * Gets the main UI controller + * + * @since S60 5.2 + * @return Main UI controller + */ + //MAiMainUiController& MainUiController() const; + + /** + * Queries whether aUiController is the main UI controller + * + * @since S60 5.2 + * @return ETrue if main UI controller, EFalse otherwise + */ + //TBool IsMainUiController( CAiUiController& aUiController ) const; + + /** + * Calls RunApplicationL for the main UI controller. + * + * @since S60 5.2 + */ + //void RunApplicationL(); + + /** + * Calls LoadUIDefinitionL for each UI controller. + * + * @since S60 5.2 + */ + //void LoadUIDefinition(); + + /** + * Returns the main UI Controller's CONE environment object. + * + * @since S60 5.2 + * @return Control Environment + */ + //CCoeEnv& CoeEnv() const; + + /** + * Destroys all UI controllers except the main controller. + * + * @since S60 5.2 + */ + //void DestroySecondaryUiControllers(); + + /** + * Exits main UI controller + * + * @since S60 5.2 + */ + //void ExitMainController(); + + /** + * Sets Fw state handler for each UI conttroller + * + * @since S60 5.2 + * @param aHandler State handler to set + */ + //void SetStateHandler( MAiFwStateHandler& aHandler ); + +private: + // private constructors + + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CAiUiControllerManager(); + +private: + // data + + /** UI controllers, Owned */ + mutable RPointerArray< CAiUiController > iUiControllerArray; + }; + +#endif // _AIUICONTROLLERMANAGER_STUB_H + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/src/aifw_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/src/aifw_stub.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AiFw stub +* +*/ + +// System includes +#include + +// User includes +#include +#include "aifw_stub.h" + +// Constants + + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiFw::CAiFw() +// +// ---------------------------------------------------------------------------- +// +CAiFw::CAiFw() + { + } + +// ---------------------------------------------------------------------------- +// CAiFw::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void CAiFw::ConstructL() + { + iRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiFw* CAiFw::NewL() + { + CAiFw* self = CAiFw::NewLC(); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiFw::NewLC() +// +// ---------------------------------------------------------------------------- +// +CAiFw* CAiFw::NewLC() + { + CAiFw* self = new ( ELeave ) CAiFw; + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiFw::~CAiFw() +// +// ---------------------------------------------------------------------------- +// +CAiFw::~CAiFw() + { + delete iRepository; + iRepository = NULL; + } + + +// ---------------------------------------------------------------------------- +// CAiFw::Repository() +// +// ---------------------------------------------------------------------------- +// +CRepository& CAiFw::Repository() const + { + return *iRepository; + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/src/aipluginfactory_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/src/aipluginfactory_stub.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,776 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content publisher factory stub +* +*/ + +// System includes +#include +#include + +// User includes +#include +#include +#include +#include +#include +#include +#include "caicpscommandbuffer.h" +#include "aiuicontrollermanager_stub.h" +#include "aistatemanager.h" +#include "aipluginfactory_stub.h" +#include "debug.h" + +// Constants +const TUid KDeviceStatusPluginUid = + { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN }; + +const TUid KProfilePluginUid = + { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN }; + +const TUid KSapiPluginImplUid = { 0x20019594 }; +const TUid KWrtPluginImplUid = { 0x200286DD }; + +_LIT( KDeviceStatusPluginName, "DeviceStatus" ); +_LIT( KProfilePluginName, "Profile" ); + +const TInt KQueueStartInterval( 500000 ); + +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// IsRecyclable() +// +// ---------------------------------------------------------------------------- +// +TBool IsRecyclable( const THsPublisherInfo& aInfo ) + { + if ( ( aInfo.Name() == KProfilePluginName && + aInfo.Uid() == KProfilePluginUid ) || + ( aInfo.Name() == KDeviceStatusPluginName && + aInfo.Uid() == KDeviceStatusPluginUid ) ) + { + return ETrue; + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// IsSapiOrWrt() +// +// ---------------------------------------------------------------------------- +// +TBool IsSapiOrWrt( const THsPublisherInfo& aInfo ) + { + return ( aInfo.Uid() == KSapiPluginImplUid || + aInfo.Uid() == KWrtPluginImplUid ); + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// +// ---------------------------------------------------------------------------- +// +template< class T > +static void CleanupResetAndDestroy( TAny* aObj ) + { + static_cast< T* >( aObj )->ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroyPushL() +// +// ---------------------------------------------------------------------------- +// +template< class T > +static void CleanupResetAndDestroyPushL( T& aArray ) + { + CleanupStack::PushL( + TCleanupItem( &CleanupResetAndDestroy< T >, &aArray ) ); + } + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::CAiPluginFactory() +// +// ---------------------------------------------------------------------------- +// +CAiPluginFactory::CAiPluginFactory( CAiUiControllerManager& aManager ) + : CTimer( CActive::EPriorityUserInput - 1 ), + iUiControllerManager( aManager ), iAllowFlush( ETrue ) + { + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::~CAiPluginFactory() +// +// ---------------------------------------------------------------------------- +// +CAiPluginFactory::~CAiPluginFactory() + { + Cancel(); + + delete iStarter; + + delete iCommandBuffer; + + iLoadQueue.Reset(); + iDestroyQueue.Reset(); + + // All publishers should be already deleted from CAiFw::HandleUiShutdown + iPublishers.ResetAndDestroy(); + + iEComPlugins.ResetAndDestroy(); + + REComSession::FinalClose(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiPluginFactory* CAiPluginFactory::NewL( CAiUiControllerManager& aManager ) + { + return new ( ELeave ) CAiPluginFactory( aManager ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::ConstructL() + { + ListImplementationsL(); + + iCommandBuffer = CAiCpsCommandBuffer::NewL(); + + // Ensure interface is available + iCommandBuffer->GetCPSInterfaceL(); + + CActiveScheduler::Add( this ); + + CTimer::ConstructL(); + + iStarter = CPeriodic::NewL( CActive::EPriorityIdle ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::ListImplementationsL() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::ListImplementationsL() + { + iEComPlugins.ResetAndDestroy(); + + REComSession::ListImplementationsL( + KInterfaceUidHsContentPlugin, iEComPlugins ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::LoadPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::LoadPlugin( const TAiFwPublisherInfo& aInfo ) + { + const THsPublisherInfo& info( aInfo.Info() ); + + for ( TInt i = 0; i < iDestroyQueue.Count(); i++ ) + { + if ( iDestroyQueue[i] == info ) + { + iDestroyQueue.Remove( i ); + break; + } + } + + if ( IsSapiOrWrt( info ) || IsRecyclable( info ) || !PluginByInfo( info ) ) + { + TBool append( ETrue ); + + for ( TInt i = 0; i < iLoadQueue.Count(); i++ ) + { + if ( iLoadQueue[i] == info ) + { + append = EFalse; + break; + } + } + + // Plugin is not in load queue and is not currently loaded + if( append ) + { + iLoadQueue.Append( aInfo ); + + HandleQueueChanged(); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DestroyPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DestroyPlugin( const TAiFwPublisherInfo& aInfo ) + { + const THsPublisherInfo& info( aInfo.Info() ); + + for ( TInt i = 0; i < iLoadQueue.Count(); i++ ) + { + if ( iLoadQueue[i] == info ) + { + iLoadQueue[i].Callback( KErrCancel ); + + iLoadQueue.Remove( i ); + break; + } + } + + if ( PluginByInfo( info ) ) + { + TBool append( ETrue ); + + for ( TInt i = 0; i < iDestroyQueue.Count(); i++ ) + { + if ( iDestroyQueue[i] == info ) + { + append = EFalse; + break; + } + } + + // Plugin is not in destroy queue and is currently loaded + if ( append ) + { + iDestroyQueue.Append( aInfo ); + + HandleQueueChanged(); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::HandleQueueChanged() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::HandleQueueChanged() + { + __PRINTS( "CAiPluginFactory::HandleQueueChanged" ); + + if ( iLoadQueue.Count() == 0 && iDestroyQueue.Count() == 0 ) + { + __PRINTS( "CAiPluginFactory::HandleQueueChanged - done, queues empty" ); + + return; + } + + Cancel(); + iStarter->Cancel(); + + __PRINTS( "CAiPluginFactory::HandleQueueChanged, iStarter->Start()" ); + + if ( iLoadQueue.Count() == 1 && iDestroyQueue.Count() == 0 && + iLoadQueue[0].Reason() == EAiFwPluginStartup ) + { + ProcessQueue( this ); + } + else + { + iStarter->Start( KQueueStartInterval, 0, + TCallBack( ProcessQueue, this ) ); + } + + __PRINTS( "CAiPluginFactory::HandleQueueChanged - done" ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DoCreatePlugin() +// +// ---------------------------------------------------------------------------- +// +TInt CAiPluginFactory::DoCreatePlugin( + const TAiFwPublisherInfo& aPublisherInfo ) + { + __PRINTS( "*** CAiPluginFactory::DoCreatePlugin: Start ***" ); + + const THsPublisherInfo& info( aPublisherInfo.Info() ); + + if ( IsRecyclable( info ) ) + { + CHsContentPublisher* plugin( PluginByUid( info.Uid() ) ); + + if ( plugin ) + { + if ( info.Namespace() == KNullDesC8 ) + { + // No namespace available + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Failed to Load Plug-in: KErrNotSupported ***" ); + return KErrNotSupported; + } + + // Plugin already exists, update its namespace + THsPublisherInfo& pubinfo( + const_cast< THsPublisherInfo& >( plugin->PublisherInfo() ) ); + + pubinfo.iNamespace.Copy( info.Namespace() ); + + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Plugin recycled ***" ); + + return KErrNone; + } + } + + TBool implFound( EFalse ); + + for( TInt i = 0; i < iEComPlugins.Count(); i++ ) + { + CImplementationInformation* information( iEComPlugins[i] ); + + if( information->ImplementationUid() == info.Uid() ) + { + implFound = ETrue; + break; + } + } + + if( info.Namespace() == KNullDesC8 || !implFound ) + { + // No namespace available or no ecom implementation available + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Failed to Load Plug-in: KErrNotSupported ***" ); + + return KErrNotSupported; + } + + CHsContentPublisher* plugin( PluginByInfo( info ) ); + + if( plugin ) + { + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + No need to Load Plug-in: KErrAlreadyExists ***" ); + + return KErrAlreadyExists; + } + + TInt err( KErrNone ); + + TRAP( err, DoCreatePluginL( aPublisherInfo ) ); + + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done - Load Plug-in ***" ); + + return err; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DoDestroyPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DoDestroyPlugin( + const TAiFwPublisherInfo& aPublisherInfo ) + { + __PRINTS( "*** CAiPluginFactory::DoDestroyPlugin: Start ***" ); + + const THsPublisherInfo& info( aPublisherInfo.Info() ); + + if ( IsRecyclable( info ) ) + { + // Don't destroy recyclable plugin + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done - Keeping recyclable Plug-in ***" ); + + return; + } + + if ( IsSapiOrWrt( info ) ) + { + if ( aPublisherInfo.Reason() == EAiFwPageShutdown ) + { + // Don't destroy sapi or wrt plugin when page is changed + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done - Keeping SAPI/WRT plugin ***" ); + + return; + } + } + + CHsContentPublisher* plugin( PluginByInfo( info ) ); + + if ( plugin ) + { + iPublishers.Remove( iPublishers.Find( plugin ) ); + + delete plugin; + plugin = NULL; + } + + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done ***" ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DestroyPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DestroyPlugin( const TUid& aUid ) + { + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Start ***" ); + + CHsContentPublisher* plugin( PluginByUid( aUid ) ); + + if ( plugin ) + { + iPublishers.Remove( iPublishers.Find( plugin ) ); + + __PRINT( __DBG_FORMAT( + "CAiPluginFactory::DestroyPlugin: name: %S" ), + &plugin->PublisherInfo().Name() ); + + delete plugin; + plugin = NULL; + } + + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done ***" ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DestroyAllPlugins() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DestroyAllPlugins() + { + Cancel(); + iStarter->Cancel(); + + iLoadQueue.Reset(); + iDestroyQueue.Reset(); + + for ( TInt i = 0; i < iPublishers.Count(); i++ ) + { + CHsContentPublisher* plugin( iPublishers[i] ); + + // Do shutdown state transition + iStateManager->StopPlugin( *plugin, EAiFwSystemShutdown ); + } + + FlushCommandBuffer(); + + // Finally get rid of all plugins + iPublishers.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DoCreatePluginL() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DoCreatePluginL( + const TAiFwPublisherInfo& aPublisherInfo ) + { + const THsPublisherInfo& info( aPublisherInfo.Info() ); + + __PRINT( __DBG_FORMAT( "\t[I]\t Loading plug-in uid=%x name=%S"), + info.Uid(), &(info.Name() ) ); + + iPublishers.ReserveL( iPublishers.Count() + 1 ); + + CHsContentPublisher* plugin( NULL ); + + __TIME( "CAiPluginFactory::CreatePluginL Create plug-in:", + plugin = CHsContentPublisher::NewL( info ) ); + + CleanupStack::PushL( plugin ); + + if ( IsSapiOrWrt( info ) ) + { + plugin->SetProperty( CHsContentPublisher::ECpsCmdBuffer, + static_cast< MAiCpsCommandBuffer* >( iCommandBuffer ) ); + } + + __TIME( "FW: Subscribe content observers", + SubscribePluginL( *plugin, info ) ); + + __TIME( "FW: Configure Plugin", + ConfigurePluginL( *plugin, info ) ); + + // Take plugin's ownership + iPublishers.Append( plugin ); + CleanupStack::Pop( plugin ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::SubscribePluginL() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::SubscribePluginL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ) + { + RPointerArray< CAiUiController >& + controllers( iUiControllerManager.UiControllers() ); + + for( TInt i = 0; i < controllers.Count(); i++ ) + { + MAiContentObserver& observer( + controllers[i]->GetContentObserver() ); + + if ( observer.RequiresSubscription( aPublisherInfo ) ) + { + // Subscribe observer only if it understands the plugin + aContentPublisher.SubscribeL( observer ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::ConfigurePluginL() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::ConfigurePluginL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ) + { + RAiSettingsItemArray settings; + CleanupResetAndDestroyPushL( settings ); + + RPointerArray< CAiUiController >& + controllers( iUiControllerManager.UiControllers() ); + + for( TInt i = 0; i < controllers.Count(); i++ ) + { + // Get settings for plug-in + controllers[i]->GetSettingsL( aPublisherInfo, settings ); + } + + // Configure plug-in with its settings + aContentPublisher.ConfigureL( settings ); + + CleanupStack::PopAndDestroy( &settings ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::PluginByInfo() +// Gets plugin by publisher info. Only this overload returns the exact match +// ---------------------------------------------------------------------------- +// +CHsContentPublisher* CAiPluginFactory::PluginByInfo( + const THsPublisherInfo& aPublisherInfo ) const + { + for( TInt i = 0; i < iPublishers.Count(); i++ ) + { + const THsPublisherInfo& info( iPublishers[i]->PublisherInfo() ); + + if( aPublisherInfo == info ) + { + return iPublishers[i]; + } + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::PluginByUid() +// Gets plugin by UID +// ---------------------------------------------------------------------------- +// +CHsContentPublisher* CAiPluginFactory::PluginByUid( const TUid& aUid ) const + { + for( TInt i = 0; i < iPublishers.Count(); i++ ) + { + const THsPublisherInfo& info( iPublishers[i]->PublisherInfo() ); + + if( info.Uid() == aUid ) + { + return iPublishers[i]; + } + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::PluginByName() +// Gets plugin by name +// ---------------------------------------------------------------------------- +// +CHsContentPublisher* CAiPluginFactory::PluginByName( + const TDesC& aName ) const + { + for( TInt i = 0; i < iPublishers.Count(); i++ ) + { + const THsPublisherInfo& info( iPublishers[i]->PublisherInfo() ); + + if( info.Name() == aName ) + { + return iPublishers[i]; + } + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::Publishers() +// +// ---------------------------------------------------------------------------- +// +RPointerArray< CHsContentPublisher >& CAiPluginFactory::Publishers() const + { + return iPublishers; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::SetStateManager() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::SetStateManager( CAiStateManager* aStateManager ) + { + iStateManager = aStateManager; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::FlushCommandBuffer() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::FlushCommandBuffer() + { + __PRINTS( "CAiPluginFactory::FlushCommandBuffer" ); + + if ( iCommandBuffer && iAllowFlush && !IsActive() ) + { + iCommandBuffer->Flush(); + } + + __PRINTS( "CAiPluginFactory::FlushCommandBuffer - done" ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::ProcessQueue() +// +// ---------------------------------------------------------------------------- +// +/* static */ TInt CAiPluginFactory::ProcessQueue( TAny* aAny ) + { + CAiPluginFactory* self = static_cast< CAiPluginFactory* >( aAny ); + + self->iStarter->Cancel(); + + if ( !self->IsActive() ) + { + self->After( 0 ); + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::RunL() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::RunL() + { + __PRINTS( "CAiPluginFactory::RunL" ); + + if ( iStarter->IsActive() ) + { + __PRINTS( "CAiPluginFactory::RunL - done, iStarter->IsActive()" ); + + return; + } + + iAllowFlush = EFalse; + + if ( iDestroyQueue.Count() > 0 ) + { + TAiFwPublisherInfo info( iDestroyQueue[ 0 ] ); + iDestroyQueue.Remove( 0 ); + + // Resolve plugin + CHsContentPublisher* plugin( PluginByInfo( info.Info() ) ); + + if ( plugin ) + { + // Do shutdown state transition + iStateManager->StopPlugin( *plugin, info.Reason() ); + + // Destroy plugin + DoDestroyPlugin( info ); + } + } + else if ( iLoadQueue.Count() > 0 ) + { + TAiFwPublisherInfo info( iLoadQueue[ 0 ] ); + iLoadQueue.Remove( 0 ); + + // Create plugin + TInt retval( DoCreatePlugin( info ) ); + + if ( retval == KErrNone || retval == KErrAlreadyExists ) + { + CHsContentPublisher* plugin( PluginByInfo( info.Info() ) ); + + if( plugin ) + { + // Do startup state transition + iStateManager->StartPlugin( *plugin, info.Reason() ); + } + else + { + retval = KErrNotFound; + } + } + + info.Callback( retval ); + } + + iAllowFlush = ETrue; + + After( 0 ); + + if ( iLoadQueue.Count() == 0 && iDestroyQueue.Count() == 0 ) + { + __PRINTS( "CAiPluginFactory::RunL - queues now empty" ); + + Cancel(); + + FlushCommandBuffer(); + } + + __PRINTS( "CAiPluginFactory::RunL - done" ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DoCancel() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DoCancel() + { + __PRINTS( "CAiPluginFactory::DoCancel" ); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/src/aiuicontroller_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/src/aiuicontroller_stub.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,373 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UI controller stub +* +*/ + +// System includes +#include + +// User includes +#include "aiuicontroller_stub.h" + + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::CAiUiControllerStub() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerStub::CAiUiControllerStub() + { + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerStub* CAiUiControllerStub::NewL() + { + CAiUiControllerStub* self = + new ( ELeave ) CAiUiControllerStub; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerStub* CAiUiControllerStub::NewL( TUid /*aImpUid*/ ) + { + return CAiUiControllerStub::NewL(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::~CAiUiControllerStub() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerStub::~CAiUiControllerStub() + { + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::LoadUIDefinitionL() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::LoadUIDefinitionL() + { + iUiDefinition = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::GetSettingsL() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::GetSettingsL( + const THsPublisherInfo& /*aPublisherInfo*/, + RAiSettingsItemArray& /*aSettings*/ ) + { + iSettings = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::ActivateUI() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::ActivateUI() + { + iActive = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::GetContentObserver() +// +// ---------------------------------------------------------------------------- +// +MAiContentObserver& CAiUiControllerStub::GetContentObserver() + { + return *this; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SetEventHandler() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::SetEventHandler( + MAiFwEventHandler& /*aEventHandler*/ ) + { + iEventHandler = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SetStateHandler() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::SetStateHandler( + MAiFwStateHandler& /*aStateHandler*/ ) + { + iStateHandler = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::MainInterface() +// +// ---------------------------------------------------------------------------- +// +MAiMainUiController* CAiUiControllerStub::MainInterface() + { + if ( iMain ) + { + return this; + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SecondaryInterface() +// +// ---------------------------------------------------------------------------- +// +MAiSecondaryUiController* CAiUiControllerStub::SecondaryInterface() + { + if ( !iMain ) + { + return this; + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SecondaryInterface() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::RunApplicationL() + { + iRunning = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SecondaryInterface() +// +// ---------------------------------------------------------------------------- +// +CCoeEnv& CAiUiControllerStub::CoeEnv() + { + return *CCoeEnv::Static(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SecondaryInterface() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::Exit() + { + iExit = ETrue; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::IsMenuOpen() +// +// ---------------------------------------------------------------------------- +// +TBool CAiUiControllerStub::IsMenuOpen() + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SetCoeEnv() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerStub::SetCoeEnv( CCoeEnv& /*aCoeEnv*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::StartTransaction() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::StartTransaction( TInt /*aTxId*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Commit() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::Commit( TInt /*aTxId*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::CancelTransaction() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::CancelTransaction( TInt /*aTxId*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::CanPublish() +// +// ---------------------------------------------------------------------------- +// +TBool CAiUiControllerStub::CanPublish( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, TInt /*aIndex*/ ) + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::Publish( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::Publish( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::Publish( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Publish() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::Publish( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, RFile& /*aFile*/, TInt /*aIndex*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Clean() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::Clean( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, TInt /*aIndex*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::Extension() +// +// ---------------------------------------------------------------------------- +// +TAny* CAiUiControllerStub::Extension( TUid /*aUid*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::RequiresSubscription() +// +// ---------------------------------------------------------------------------- +// +TBool CAiUiControllerStub::RequiresSubscription( + const THsPublisherInfo& /*aPublisherInfo*/ ) const + { + if ( iMain ) + { + return ETrue; + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SetProperty() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::SetProperty( CHsContentPublisher& /*aPlugin*/, + const TDesC8& /*aElementId*/, + const TDesC8& /*aPropertyName*/, + const TDesC8& /*aPropertyValue*/ ) + { + return KErrNotSupported; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerStub::SetProperty() +// +// ---------------------------------------------------------------------------- +// +TInt CAiUiControllerStub::SetProperty( CHsContentPublisher& /*aPlugin*/, + const TDesC8& /*aElementId*/, + const TDesC8& /*aPropertyName*/, + const TDesC8& /*aPropertyValue*/, + MAiContentObserver::TValueType /*aValueType*/ ) + { + return KErrNotSupported; + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/stub/src/aiuicontrollermanager_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/stub/src/aiuicontrollermanager_stub.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UI controller manager stub +* +*/ + +// System includes + +// User includes +#include "aiuicontroller_stub.h" +#include "aiuicontrollermanager_stub.h" + + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::CAiUiControllerManager() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerManager::CAiUiControllerManager() + { + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::LoadMainControllerL() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::LoadMainControllerL( CRepository& aRepository ) + { + TInt value( 0 ); + + // Main UI Controller must be configured correctly + User::LeaveIfError( aRepository.Get( KAiMainUIController, value ) ); + + CAiUiController* controller = CAiUiController::NewL( TUid::Uid( value ) ); + + iCreatedUICList.Append( value ); + CleanupStack::PushL( controller ); + + iMainUiController = controller->MainInterface(); + + // Main UI controller must be configured correctly + if( !iMainUiController ) + { + __PRINT( __DBG_FORMAT("Main UI controller interface not found from controller 0x%x"), value ); + User::Leave( KErrNotFound ); + } + + iUiControllerArray.AppendL( controller ); + CleanupStack::Pop( controller ); + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::LoadSecondaryControllersL() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::LoadSecondaryControllersL( + CRepository& aRepository ) + { + TInt value( 0 ); + + // Instantiate rest of the UI controllers. + for( TInt key = KAiFirstUIController; + key <= KAiLastUIController && aRepository.Get( key, value ) == KErrNone; + ++key ) + { + // skip empty entries + if( value == 0 ) + { + continue; + } + + if( iCreatedUICList.Find( value ) != KErrNotFound ) + { + continue; + } + + iCreatedUICList.Append( value ); + + CAiUiController* controller = + CAiUiController::NewL( TUid::Uid( value ) ); + + CleanupStack::PushL( controller ); + + iUiControllerArray.AppendL( controller ); + CleanupStack::Pop( controller ); + } + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::ConstructL() + { + CAiUiControllerStub* stub = CAiUiControllerStub::NewL(); + CleanupStack::PushL( stub ); + + iUiControllerArray.AppendL( stub ); + CleanupStack::Pop( stub ); + + stub->iMain = ETrue; + + CAiUiControllerStub* stub2 = CAiUiControllerStub::NewL(); + CleanupStack::PushL( stub2 ); + + iUiControllerArray.AppendL( stub2 ); + CleanupStack::Pop( stub2 ); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerManager* CAiUiControllerManager::NewL() + { + CAiUiControllerManager* self = + new ( ELeave ) CAiUiControllerManager; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::~CAiUiControllerManager() +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerManager::~CAiUiControllerManager() + { + iUiControllerArray.ResetAndDestroy(); + + //iCreatedUICList.Reset(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::UiControllers() +// +// ---------------------------------------------------------------------------- +// +RPointerArray< CAiUiController >& CAiUiControllerManager::UiControllers() const + { + return iUiControllerArray; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::IsMainUiController() +// +// ---------------------------------------------------------------------------- +// +/*TBool CAiUiControllerManager::IsMainUiController( + CAiUiController& aUiController ) const + { + return ( aUiController.MainInterface() == iMainUiController ); + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::RunApplicationL() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::RunApplicationL() + { + iMainUiController->RunApplicationL(); + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::ActivateUI() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::ActivateUI() + { + for( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + iUiControllerArray[i]->ActivateUI(); + } + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::LoadUIDefinition() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::LoadUIDefinition() + { + for( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + CAiUiController* uiCtl( iUiControllerArray[i] ); + + MAiSecondaryUiController* secIntr( uiCtl->SecondaryInterface() ); + + if( secIntr ) + { + secIntr->SetCoeEnv( CoeEnv() ); + } + + TRAPD( err, uiCtl->LoadUIDefinitionL() ); + + if( err != KErrNone ) + { + if( IsMainUiController( *uiCtl ) ) + { + // Main ui controller failing is fatal + _LIT(KAIFWStartupFailed, "FW startup failed."); + + User::Panic( KAIFWStartupFailed, 0 ); + } + else + { + // Secondary UI controller failed, delete it + delete uiCtl; + uiCtl = NULL; + + iUiControllerArray.Remove( i ); + } + } + } + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::CoeEnv() +// +// ---------------------------------------------------------------------------- +// +/*CCoeEnv& CAiUiControllerManager::CoeEnv() const + { + return iMainUiController->CoeEnv(); + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::MainUiController() +// +// ---------------------------------------------------------------------------- +// +/*MAiMainUiController& CAiUiControllerManager::MainUiController() const + { + return *iMainUiController; + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::DestroySecondaryUiControllers() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::DestroySecondaryUiControllers() + { + for( TInt i = iUiControllerArray.Count() - 1; i >= 0; --i ) + { + CAiUiController* uiController = iUiControllerArray[i]; + + if( !IsMainUiController( *uiController ) ) + { + delete uiController; + uiController = NULL; + + iUiControllerArray.Remove(i); + } + } + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::ExitMainController() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::ExitMainController() + { + iMainUiController->Exit(); + }*/ + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::SetStateHandler() +// +// ---------------------------------------------------------------------------- +// +/*void CAiUiControllerManager::SetStateHandler( MAiFwStateHandler& aHandler ) + { + for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + iUiControllerArray[i]->SetStateHandler( aHandler ); + } + }*/ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/bwins/ut_aicpscommandbufferu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/bwins/ut_aicpscommandbufferu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/eabi/ut_aicpscommandbufferu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/eabi/ut_aicpscommandbufferu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aicpscommandbuffer.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/group/ut_aicpscommandbuffer.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/group/ut_aicpscommandbuffer.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: project file +* +*/ + +#include +#include + + +TARGET ut_aicpscommandbuffer.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aicpscommandbuffer.cpp +SOURCE aicpsexecuteparam.cpp + +SOURCEPATH ../../stub/src + +SOURCEPATH ../src +SOURCE ut_aicpscommandbuffer.cpp +SOURCE ut_aicpscommandbuffer_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY liwservicehandler.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/inc/ut_aicpscommandbuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/inc/ut_aicpscommandbuffer.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiEcomObserver +* +*/ + + +#ifndef _UT_AICPSCOMMANDBUFFER_H +#define _UT_AICPSCOMMANDBUFFER_H + +// System includes +#include +#include + +// User includes +#include "caicpscommandbuffer.h" + +// Forward declarations +class CAiCpsCommandBuffer; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiCpsCommandBuffer ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiCpsCommandBuffer* NewL(); + + /** + * Two phase construction + */ + static UT_AiCpsCommandBuffer* NewLC(); + + /** + * Destructor + */ + ~UT_AiCpsCommandBuffer(); + +private: + // Constructors and destructors + + UT_AiCpsCommandBuffer(); + + void ConstructL(); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void GetCPsServiceInsterfaceL(); + void AddCommandAndFlushL(); + void CreateAndDelete(); +private: + // data + + CAiCpsCommandBuffer* iCommandBuffer; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // _UT_AICPSCOMMANDBUFFER_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/src/ut_aicpscommandbuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/src/ut_aicpscommandbuffer.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateProvider +* +*/ + +// System includes +#include +#include +#include +#include +#include + +// User includes +#include "ut_aicpscommandbuffer.h" + +#include "caicpscommandbuffer.h" + + +// Constants +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT( KWRTPublisher, "wrt_publisher"); +_LIT( KTemplateWidget,"ai3templatedwidget"); +_LIT( KContentIdValue, "com.accuweather.widget.touchNG" ); +_LIT8( KAction, "active" ); +_LIT( KPubData, "publisher" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsCommandBuffer* UT_AiCpsCommandBuffer::NewL() + { + UT_AiCpsCommandBuffer* self = UT_AiCpsCommandBuffer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsCommandBuffer* UT_AiCpsCommandBuffer::NewLC() + { + UT_AiCpsCommandBuffer* self = new ( ELeave ) UT_AiCpsCommandBuffer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::~UT_AiCpsCommandBuffer() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsCommandBuffer::~UT_AiCpsCommandBuffer() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::UT_AiCpsCommandBuffer() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsCommandBuffer::UT_AiCpsCommandBuffer() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsCommandBuffer::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsCommandBuffer::SetupL() + { + iCommandBuffer = CAiCpsCommandBuffer::NewL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsCommandBuffer::Teardown() + { + delete iCommandBuffer; + iCommandBuffer = NULL; + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::CreateAndDeleteL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsCommandBuffer::CreateAndDelete() + { + //nothing here + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::GetCPsServiceInsterfaceL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsCommandBuffer::GetCPsServiceInsterfaceL() + { + iCommandBuffer->GetCPSInterfaceL(); + iCommandBuffer->GetCPSInterfaceL(); + MLiwInterface* cpsInterface = iCommandBuffer->CpsInterface(); + CLiwServiceHandler* handler = iCommandBuffer->ServiceHandler(); + if ( !cpsInterface || !handler ) + { + User::Leave( KErrArgument ); + } + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsCommandBuffer::GetCPsServiceInsterfaceL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsCommandBuffer::AddCommandAndFlushL() + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); + filter->InsertL( KContentType, TLiwVariant( KTemplateWidget )); + filter->InsertL( KContentId, TLiwVariant( KContentIdValue )); + + iCommandBuffer->AddCommand( _L("1"), KPubData, filter, KAction ); + iCommandBuffer->AddCommand( _L("1"), KPubData, filter, KAction ); + iCommandBuffer->Flush(); + + // let destructor do flush + iCommandBuffer->AddCommand( _L("1"), KPubData, filter, KAction ); + iCommandBuffer->AddCommand( _L("2"), KPubData, filter, KAction ); + + CleanupStack::PopAndDestroy( filter ); + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiCpsCommandBuffer, + "Unit test suite for AiCpsCommandBuffer", + "UNIT" ) + + EUNIT_TEST( + "Create And Delete", + "AiCpsCommandBuffer", + "", + "FUNCTIONALITY", + SetupL, CreateAndDelete, Teardown ) + + EUNIT_TEST( + "Get CPS service interface", + "AiCpsCommandBuffer", + "", + "FUNCTIONALITY", + SetupL, GetCPsServiceInsterfaceL, Teardown ) + + EUNIT_TEST( + "Add command and flush", + "AddCommandL", + "", + "FUNCTIONALITY", + SetupL, AddCommandAndFlushL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/src/ut_aicpscommandbuffer_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpscommandbuffer/src/ut_aicpscommandbuffer_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aicpscommandbuffer.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiCpsCommandBuffer::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/bwins/ut_aicpsexecuteparamu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/bwins/ut_aicpsexecuteparamu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/eabi/ut_aicpsexecuteparamu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/eabi/ut_aicpsexecuteparamu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Item id, name and properties +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aicpsexecuteparam.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/group/ut_aicpsexecuteparam.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/group/ut_aicpsexecuteparam.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aicpsexecuteparam.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aicpsexecuteparam.cpp + +SOURCEPATH ../../stub/src + +SOURCEPATH ../src +SOURCE ut_aicpsexecuteparam.cpp +SOURCE ut_aicpsexecuteparam_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY liwservicehandler.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/inc/ut_aicpsexecuteparam.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/inc/ut_aicpsexecuteparam.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiEcomObserver +* +*/ + + +#ifndef _UT_AICPSEXECUTEPARAM_H +#define _UT_AICPSEXECUTEPARAM_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CAiCpsExecuteParam; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiCpsExecuteParam ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiCpsExecuteParam* NewL(); + + /** + * Two phase construction + */ + static UT_AiCpsExecuteParam* NewLC(); + + /** + * Destructor + */ + ~UT_AiCpsExecuteParam(); + +private: + // Constructors and destructors + + UT_AiCpsExecuteParam(); + + void ConstructL(); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void PluginId(); + void InParamMapL(); + +private: + // data + CAiCpsExecuteParam* iExecuteParam; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // _UT_AICPSEXECUTEPARAM_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/src/ut_aicpsexecuteparam.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/src/ut_aicpsexecuteparam.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,243 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateProvider +* +*/ + +// System includes +#include +#include +#include +#include +#include + +// User includes +#include "ut_aicpsexecuteparam.h" + +#include "aicpsexecuteparam.h" + +// Constants +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT( KWRTPublisher, "wrt_publisher"); +_LIT( KTemplateWidget,"ai3templatedwidget"); +_LIT( KContentIdValue, "com.accuweather.widget.touchNG" ); +_LIT8( KAction, "active" ); +_LIT( KAction16, "active" ); +_LIT( KPubData, "publisher" ); +_LIT8( KFilter, "filter" ); +_LIT8( KActionTrigger, "action_trigger" ); +_LIT8( KType, "type"); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsExecuteParam* UT_AiCpsExecuteParam::NewL() + { + UT_AiCpsExecuteParam* self = UT_AiCpsExecuteParam::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsExecuteParam* UT_AiCpsExecuteParam::NewLC() + { + UT_AiCpsExecuteParam* self = new ( ELeave ) UT_AiCpsExecuteParam(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::~UT_AiCpsExecuteParam() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsExecuteParam::~UT_AiCpsExecuteParam() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::UT_AiCpsExecuteParam() +// +// ---------------------------------------------------------------------------- +// +UT_AiCpsExecuteParam::UT_AiCpsExecuteParam() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsExecuteParam::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsExecuteParam::SetupL() + { + iExecuteParam = CAiCpsExecuteParam::NewL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsExecuteParam::Teardown() + { + delete iExecuteParam; + iExecuteParam = NULL; + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::PluginId() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsExecuteParam::PluginId() + { + _LIT( KPluginId, "123" ); + iExecuteParam->SetPluginIdL( KPluginId ); + EUNIT_ASSERT_EQUALS( iExecuteParam->PluginId(), KPluginId ); + } + +// ---------------------------------------------------------------------------- +// UT_AiCpsExecuteParam::InParamMapL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiCpsExecuteParam::InParamMapL() + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + iExecuteParam->SetFilterL(filter); + filter->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); + filter->InsertL( KContentType, TLiwVariant( KTemplateWidget )); + filter->InsertL( KContentId, TLiwVariant( KContentIdValue )); + + iExecuteParam->SetPluginIdL(_L("1")); + iExecuteParam->SetRegistryTypeL( KPubData ); + iExecuteParam->SetFilterL(filter); + iExecuteParam->AddActionL( KAction ); + + CLiwDefaultMap* map = iExecuteParam->InParamMapLC(); + + TLiwVariant tempVariant; + tempVariant.PushL(); + + // check map + if ( map->FindL( KType, tempVariant ) ) + { + EUNIT_ASSERT_EQUALS( tempVariant.AsDes(), KPubData ); + map->Remove( KType ); + } + if ( map->FindL( KFilter, tempVariant ) ) + { + CLiwDefaultMap* filter2 = CLiwDefaultMap::NewLC(); + if ( tempVariant.Get( *filter2 ) ) + { + if ( filter2->FindL( KPublisherId, tempVariant ) ) + { + EUNIT_ASSERT_EQUALS( tempVariant.AsDes(), KWRTPublisher ); + filter2->Remove( KPublisherId ); + } + if ( filter2->FindL( KContentType, tempVariant ) ) + { + EUNIT_ASSERT_EQUALS( tempVariant.AsDes(), KTemplateWidget ); + filter2->Remove( KContentType ); + } + if ( filter2->FindL( KContentId, tempVariant ) ) + { + EUNIT_ASSERT_EQUALS( tempVariant.AsDes(), KContentIdValue ); + filter2->Remove( KContentId ); + } + if ( filter2->FindL( KActionTrigger, tempVariant ) ) + { + CLiwDefaultList* actionsToLaunch = CLiwDefaultList::NewLC(); + if ( tempVariant.Get( *actionsToLaunch ) ) + { + if ( actionsToLaunch->AtL( 0, tempVariant ) ) + { + EUNIT_ASSERT_EQUALS( tempVariant.AsData(), KAction ); + actionsToLaunch->Remove( 0 ); + //make sure actionsToLaunch is empty + EUNIT_ASSERT_EQUALS ( actionsToLaunch->Count(), 0 ); + } + + } + CleanupStack::PopAndDestroy( actionsToLaunch ); + filter2->Remove( KActionTrigger ); + } + } + //make sure filter is empty + EUNIT_ASSERT_EQUALS ( filter2->Count(), 0 ); + CleanupStack::PopAndDestroy( filter2 ); + + map->Remove( KFilter ); + } + + //make sure map is empty + EUNIT_ASSERT_EQUALS ( map->Count(), 0 ); + + CleanupStack::Pop(&tempVariant); + tempVariant.Reset(); + CleanupStack::PopAndDestroy( 2,filter ); + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiCpsExecuteParam, + "Unit test suite for CAiCpsExecuteParam", + "UNIT" ) + + EUNIT_TEST( + "PluginId", + "CAiCpsExecuteParam", + "", + "FUNCTIONALITY", + SetupL, PluginId, Teardown ) + + EUNIT_TEST( + "InParamMap", + "CAiCpsExecuteParam", + "", + "FUNCTIONALITY", + SetupL, InParamMapL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/src/ut_aicpsexecuteparam_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aicpsexecuteparam/src/ut_aicpsexecuteparam_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aicpsexecuteparam.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiCpsExecuteParam::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/bwins/ut_aiecomobserveru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/bwins/ut_aiecomobserveru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/eabi/ut_aiecomobserveru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/eabi/ut_aiecomobserveru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aiecomobserver.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/group/ut_aiecomobserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/group/ut_aiecomobserver.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aiecomobserver.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aiecomobserver.cpp + +SOURCEPATH ../../stub/src + +SOURCEPATH ../src +SOURCE ut_aiecomobserver.cpp +SOURCE ut_aiecomobserver_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/inc/ut_aiecomobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/inc/ut_aiecomobserver.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiEcomObserver +* +*/ + + +#ifndef _UT_AIECOMOBSERVER_H +#define _UT_AIECOMOBSERVER_H + +// System includes +#include +#include + +// User includes +#include "aiecomobserver.h" + +// Forward declarations +class CActiveSchedulerWait; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiEcomObserver ) : public CEUnitTestSuiteClass, + public MAiEcomObserver + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiEcomObserver* NewL(); + + /** + * Two phase construction + */ + static UT_AiEcomObserver* NewLC(); + + /** + * Destructor + */ + ~UT_AiEcomObserver(); + +private: + // Constructors and destructors + + UT_AiEcomObserver(); + + void ConstructL(); + +private: + // from MAiEcomObserver + + /** + * @see MAiEcomObserver + */ + void NotifyEcomRegistryChanged(); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestStartObserveL(); + void TestAddObserverL(); + void TestNotifyObserverL(); + +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + + CActiveSchedulerWait* iWait; + TBool iNotificationReceived; + }; + +#endif // _UT_AIECOMOBSERVER_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/src/ut_aiecomobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/src/ut_aiecomobserver.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateProvider +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "ut_aiecomobserver.h" + +#include "aiecomobserver.h" + +// Constants + + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiEcomObserver* UT_AiEcomObserver::NewL() + { + UT_AiEcomObserver* self = UT_AiEcomObserver::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiEcomObserver* UT_AiEcomObserver::NewLC() + { + UT_AiEcomObserver* self = new ( ELeave ) UT_AiEcomObserver(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::~UT_AiEcomObserver() +// +// ---------------------------------------------------------------------------- +// +UT_AiEcomObserver::~UT_AiEcomObserver() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::UT_AiEcomObserver() +// +// ---------------------------------------------------------------------------- +// +UT_AiEcomObserver::UT_AiEcomObserver() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::SetupL() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::Teardown() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::NotifyEcomRegistryChanged() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::NotifyEcomRegistryChanged() + { + iNotificationReceived = ETrue; + + iWait->AsyncStop(); + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::TestStartObserveL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::TestStartObserveL() + { + CAiEcomObserver* observer = CAiEcomObserver::NewLC(); + + EUNIT_ASSERT_EQUALS( observer->iEComSession.Handle() != 0, ETrue ); + EUNIT_ASSERT_EQUALS( observer->IsAdded(), ETrue ); + EUNIT_ASSERT_EQUALS( observer->IsActive(), ETrue ); + EUNIT_ASSERT_EQUALS( observer->iObservers.Count(), 0 ); + + CleanupStack::PopAndDestroy( observer ); + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::TestAddObserverL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::TestAddObserverL() + { + CAiEcomObserver* observer = CAiEcomObserver::NewLC(); + + observer->AddObserverL( NULL ); + + EUNIT_ASSERT_EQUALS( observer->iObservers.Count(), 0 ); + + observer->AddObserverL( this ); + + EUNIT_ASSERT_EQUALS( observer->iObservers.Count(), 1 ); + EUNIT_ASSERT_EQUALS( observer->iObservers[0] == this, ETrue ); + + CleanupStack::PopAndDestroy( observer ); + } + +// ---------------------------------------------------------------------------- +// UT_AiEcomObserver::TestNotifyObserverL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEcomObserver::TestNotifyObserverL() + { + iNotificationReceived = EFalse; + + iWait = new ( ELeave ) CActiveSchedulerWait; + + CAiEcomObserver* observer = CAiEcomObserver::NewLC(); + + observer->AddObserverL( this ); + + EUNIT_ASSERT_EQUALS( observer->IsAdded(), ETrue ); + EUNIT_ASSERT_EQUALS( observer->IsActive(), ETrue ); + + TRequestStatus* stat( &observer->iStatus ); + + User::RequestComplete( stat, KErrNone ); + + iWait->Start(); + + delete iWait; + iWait = NULL; + + EUNIT_ASSERT_EQUALS( iNotificationReceived, ETrue ); + + // Ensure observer is active again + EUNIT_ASSERT_EQUALS( observer->IsAdded(), ETrue ); + EUNIT_ASSERT_EQUALS( observer->IsActive(), ETrue ); + + CleanupStack::PopAndDestroy( observer ); + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiEcomObserver, + "Unit test suite for CAiEcomObserver", + "UNIT" ) + + EUNIT_TEST( + "Start observe", + "CAiEcomObserver", + "", + "FUNCTIONALITY", + SetupL, TestStartObserveL, Teardown ) + + EUNIT_TEST( + "Add observer", + "CAiEcomObserver", + "", + "FUNCTIONALITY", + SetupL, TestAddObserverL, Teardown ) + + EUNIT_TEST( + "notify Observer", + "CAiEcomObserver", + "", + "FUNCTIONALITY", + SetupL, TestNotifyObserverL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/src/ut_aiecomobserver_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiecomobserver/src/ut_aiecomobserver_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aiecomobserver.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiEcomObserver::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/bwins/ut_aieventhandleru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/bwins/ut_aieventhandleru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/eabi/ut_aieventhandleru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/eabi/ut_aieventhandleru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aieventhandler.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/group/ut_aieventhandler.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/group/ut_aieventhandler.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aieventhandler.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aieventhandler.cpp +SOURCE aipluginfactory.cpp +SOURCE aistatemanager.cpp +SOURCE aicpscommandbuffer.cpp +SOURCE aicpsexecuteparam.cpp + +SOURCEPATH ../../stub/src +SOURCE aiuicontrollermanager_stub.cpp +SOURCE aiuicontroller_stub.cpp + +SOURCEPATH ../src +SOURCE ut_aieventhandler.cpp +SOURCE ut_aieventhandler_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY liwServiceHandler.lib + +// Debugging dependencies +LIBRARY flogger.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/inc/ut_aieventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/inc/ut_aieventhandler.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiEventHandler +* +*/ + + +#ifndef _UT_AIEVENTHANDLER_H +#define _UT_AIEVENTHANDLER_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CAiUiControllerManager; +class CAiPluginFactory; +class CAiEventHandler; +class CActiveSchedulerWait; +class CAiStateManager; +// Clas declaration +NONSHARABLE_CLASS( UT_AiEventHandler ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiEventHandler* NewL(); + + /** + * Two phase construction + */ + static UT_AiEventHandler* NewLC(); + + /** + * Destructor + */ + ~UT_AiEventHandler(); + +private: + // Constructors and destructors + + UT_AiEventHandler(); + + void ConstructL(); + + +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestHandlePluginEventL(); + void TestHasMenuItemL(); + void TestRefreshContentL(); + void TestSuspendContentL(); + + static void CallBack( TAny* aPtr, TInt aResult ); +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + + CAiUiControllerManager* iUiMgr; + + CAiPluginFactory* iFactory; + + CAiEventHandler* iHandler; + + CAiStateManager* iStateManager; + + CActiveSchedulerWait* iWait; + + TInt iResult; + }; + +#endif // _UT_AIEVENTHANDLER_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/src/ut_aieventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/src/ut_aieventhandler.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,390 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiEventHandler +* +*/ + +// System includes +#include +#include +#include +#include +#include + +// User includes +#include +#include "ut_aieventhandler.h" +#include "aiuicontrollermanager_stub.h" + +#include "aipluginfactory.h" +#include "aieventhandler.h" +#include "aifwpublisherinfo.h" +#include "aistatemanager.h" + +// Constants +_LIT( KProfile, "Profile" ); +_LIT( KDevStat, "DeviceStatus" ); +_LIT( KUnknown, "Unknown" ); + +const TInt KProfileUid( 0x10275101 ); +const TInt KDeviceStatusUid( 0x102750F8 ); +const TInt KUnknownUid( 0xBABE2BED ); + +_LIT8( KNs1, "namespace1" ); +_LIT8( KNs2, "namespace2" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiEventHandler* UT_AiEventHandler::NewL() + { + UT_AiEventHandler* self = UT_AiEventHandler::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiEventHandler* UT_AiEventHandler::NewLC() + { + UT_AiEventHandler* self = new ( ELeave ) UT_AiEventHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::~UT_AiEventHandler() +// +// ---------------------------------------------------------------------------- +// +UT_AiEventHandler::~UT_AiEventHandler() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::UT_AiEventHandler() +// +// ---------------------------------------------------------------------------- +// +UT_AiEventHandler::UT_AiEventHandler() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEventHandler::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEventHandler::SetupL() + { + iUiMgr = CAiUiControllerManager::NewL(); + + iFactory = CAiPluginFactory::NewL( *iUiMgr ); + iFactory->ConstructL(); + + iStateManager = CAiStateManager::NewL( *iFactory ); + + iHandler = CAiEventHandler::NewL( *iFactory ); + + iWait = new ( ELeave ) CActiveSchedulerWait; + + iResult = KErrNone; + } + +// ---------------------------------------------------------------------------- +// UT_AiEventHandler::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEventHandler::Teardown() + { + delete iHandler; + iHandler = NULL; + + delete iFactory; + iFactory = NULL; + + delete iUiMgr; + iUiMgr = NULL; + + delete iStateManager; + iStateManager = NULL; + + if ( iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + delete iWait; + iWait = NULL; + } + +//------------------------------------------------------------------------------ +// UT_AiEventHandler::TestHandlePluginEventL() +// +//------------------------------------------------------------------------------ +// +void UT_AiEventHandler::TestHandlePluginEventL() + { + THsPublisherInfo profile( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo devstat( + TUid::Uid( KDeviceStatusUid ), KDevStat, KNs2 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + _LIT( KProfileEvent, "Profile/SwitchProfileByIndex" ); + _LIT( KDeviceStatusEvent, "DeviceStatus/DummyEvent" ); + _LIT( KUnknownEvent, "Unknown/DummyEvent" ); + _LIT( KIvalidEvent, "ååäaäåp39469568sdfsdfs" ); + _LIT( KInvalidEvent2, "--\\\afsd////ååäaäåp39469568sdfsdfs" ); + + TAiFwPublisherInfo profileInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profileInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile ) != NULL, ETrue ); + + TAiFwPublisherInfo devstatInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( devstatInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + iHandler->HandlePluginEvent( KProfileEvent ); + iHandler->HandlePluginEvent( KDeviceStatusEvent ); + iHandler->HandlePluginEvent( KUnknownEvent ); + iHandler->HandlePluginEvent( KIvalidEvent ); + iHandler->HandlePluginEvent( KInvalidEvent2 ); + + iHandler->HandlePluginEventL( profile, KProfileEvent ); + iHandler->HandlePluginEventL( devstat, KDeviceStatusEvent ); + iHandler->HandlePluginEventL( unknown, KUnknownEvent ); + + profileInfo = TAiFwPublisherInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profileInfo ); + devstatInfo = TAiFwPublisherInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( devstatInfo ); + } + +//------------------------------------------------------------------------------ +// UT_AiEventHandler::TestHasMenuItemL() +// +//------------------------------------------------------------------------------ +// +void UT_AiEventHandler::TestHasMenuItemL() + { + THsPublisherInfo profile( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo devstat( + TUid::Uid( KDeviceStatusUid ), KDevStat, KNs2 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + _LIT( KMenuitem, "Some_menuitem" ); + + TAiFwPublisherInfo profileInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profileInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile ) != NULL, ETrue ); + + TAiFwPublisherInfo devstatInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( devstatInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + iHandler->HasMenuItemL( profile, KMenuitem ); + iHandler->HasMenuItemL( devstat, KMenuitem ); + iHandler->HasMenuItemL( unknown, KMenuitem ); + + profileInfo = TAiFwPublisherInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profileInfo ); + + devstatInfo = TAiFwPublisherInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( devstatInfo ); + } + +//------------------------------------------------------------------------------ +// UT_AiEventHandler::TestRefreshContentL() +// +//------------------------------------------------------------------------------ +// +void UT_AiEventHandler::TestRefreshContentL() + { + THsPublisherInfo profile( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo devstat( + TUid::Uid( KDeviceStatusUid ), KDevStat, KNs2 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + _LIT( KProfileContent, "Profile/ActiveProfileName" ); + _LIT( KDeviceStatusContent, "DeviceStatus/NetworkIdentity" ); + _LIT( KUnknownContent, "Unknown/DummyContentId" ); + + _LIT( KNetworkIdentity, "NetworkIdentity" ); + + TAiFwPublisherInfo profileInfo( profile, TAiFwCallback( CallBack, this ) , EAiFwPluginStartup ); + iFactory->LoadPlugin( profileInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile ) != NULL, ETrue ); + + TAiFwPublisherInfo devstatInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( devstatInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + iHandler->RefreshContent( KProfileContent ); + iHandler->RefreshContent( KDeviceStatusContent ); + iHandler->RefreshContent( KUnknownContent ); + + iHandler->RefreshContent( profile, KProfileContent ); + iHandler->RefreshContent( devstat, KDeviceStatusContent ); + iHandler->RefreshContent( unknown, KUnknownContent ); + + iHandler->RefreshContent( devstat, KNetworkIdentity ); + + profileInfo = TAiFwPublisherInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profileInfo ); + + devstatInfo = TAiFwPublisherInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( devstatInfo ); + } + +//------------------------------------------------------------------------------ +// UT_AiEventHandler::TestSuspendContentL() +// +//------------------------------------------------------------------------------ +// +void UT_AiEventHandler::TestSuspendContentL() + { + THsPublisherInfo profile( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo devstat( + TUid::Uid( KDeviceStatusUid ), KDevStat, KNs2 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + _LIT( KProfileContent, "ActiveProfileName" ); + _LIT( KDeviceStatusContent, "NetworkIdentity" ); + _LIT( KUnknownContent, "DummyContentId" ); + + TAiFwPublisherInfo profileInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profileInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile ) != NULL, ETrue ); + + TAiFwPublisherInfo devstatInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( devstatInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + iHandler->SuspendContent( profile, KProfileContent ); + iHandler->SuspendContent( devstat, KDeviceStatusContent ); + iHandler->SuspendContent( unknown, KUnknownContent ); + + profileInfo = TAiFwPublisherInfo( profile, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profileInfo ); + + devstatInfo = TAiFwPublisherInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( devstatInfo ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::CallBack() +// +// ---------------------------------------------------------------------------- +// +void UT_AiEventHandler::CallBack( TAny* aPtr, TInt aResult ) + { + UT_AiEventHandler* self = static_cast< UT_AiEventHandler* >( aPtr ); + self->iResult = aResult; + self->iWait->AsyncStop(); + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiEventHandler, + "Unit test suite for CAiEventHandler", + "UNIT" ) + + EUNIT_TEST( + "HandlePluginEvent", + "CAiEventHandler", + "", + "FUNCTIONALITY", + SetupL, TestHandlePluginEventL, Teardown ) + + EUNIT_TEST( + "HasMenuItem", + "CAiEventHandler", + "", + "FUNCTIONALITY", + SetupL, TestHasMenuItemL, Teardown ) + + EUNIT_TEST( + "RefreshContent", + "CAiEventHandler", + "", + "FUNCTIONALITY", + SetupL, TestRefreshContentL, Teardown ) + + EUNIT_TEST( + "SuspendContent", + "CAiEventHandler", + "", + "FUNCTIONALITY", + SetupL, TestSuspendContentL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/src/ut_aieventhandler_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aieventhandler/src/ut_aieventhandler_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aieventhandler.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiEventHandler::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/bwins/ut_aipluginfactoryu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/bwins/ut_aipluginfactoryu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/eabi/ut_aipluginfactoryu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/eabi/ut_aipluginfactoryu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aipluginfactory.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/group/ut_aipluginfactory.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/group/ut_aipluginfactory.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aipluginfactory.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aipluginfactory.cpp +SOURCE aistatemanager.cpp +SOURCE aicpscommandbuffer.cpp +SOURCE aicpsexecuteparam.cpp + +SOURCEPATH ../../stub/src +SOURCE aiuicontrollermanager_stub.cpp +SOURCE aiuicontroller_stub.cpp + + +SOURCEPATH ../src +SOURCE ut_aipluginfactory.cpp +SOURCE ut_aipluginfactory_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY liwServiceHandler.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/inc/ut_aipluginfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/inc/ut_aipluginfactory.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiPluginFactory +* +*/ + + +#ifndef _UT_AIPLUGINFACTORY_H +#define _UT_AIPLUGINFACTORY_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CAiUiControllerManager; +class CAiPluginFactory; +class CAiStateManager; +class CActiveSchedulerWait; +class CPeriodic; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiPluginFactory ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiPluginFactory* NewL(); + + /** + * Two phase construction + */ + static UT_AiPluginFactory* NewLC(); + + /** + * Destructor + */ + ~UT_AiPluginFactory(); + +private: + // Constructors and destructors + + UT_AiPluginFactory(); + + void ConstructL(); + + static void CallBack( TAny* aPtr, TInt aResult ); + + static TInt TimerCallBack( TAny* aPtr ); +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestCreateDestroyPluginL(); + void TestPluginByInfoL(); + void TestPluginByUidL(); + void TestPluginByNameL(); + void TestGetPublishersL(); + void TestUpgradePublishersL(); + void TestCreateDestroyAllL(); + +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + + CAiUiControllerManager* iUiMgr; + + CAiPluginFactory* iFactory; + + CAiStateManager* iStateManager; + + CActiveSchedulerWait* iWait; + + TInt iResult; + + CPeriodic* iPeriodic; + }; + +#endif // _UT_AIPLUGINFACTORY_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/src/ut_aipluginfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/src/ut_aipluginfactory.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,603 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiPluginFactory +* +*/ + +// System includes +#include +#include +#include +#include +#include + +// User includes +#include +#include "ut_aipluginfactory.h" +#include "aiuicontrollermanager_stub.h" + +#include "aipluginfactory.h" +#include "aifwpublisherinfo.h" +#include "aistatemanager.h" + +// Constants +_LIT( KProfile, "Profile" ); +_LIT( KDevstat, "DeviceStatus"); +_LIT( KUnknown, "Unknown" ); +_LIT( KOrganizer, "Organizer" ); + +const TInt KProfileUid( 0x10275101 ); +const TInt KDevstatUid( 0x102750F8 ); +const TInt KUnknownUid( 0xBABE2BED ); +const TInt KOrganizerUid( 0x102750FE ); +const TInt KDestroyDelay( 600000 ); +_LIT8( KNs1, "namespace1" ); +_LIT8( KNs2, "namespace2" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiPluginFactory* UT_AiPluginFactory::NewL() + { + UT_AiPluginFactory* self = UT_AiPluginFactory::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiPluginFactory* UT_AiPluginFactory::NewLC() + { + UT_AiPluginFactory* self = new ( ELeave ) UT_AiPluginFactory(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::~UT_AiPluginFactory() +// +// ---------------------------------------------------------------------------- +// +UT_AiPluginFactory::~UT_AiPluginFactory() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::UT_AiPluginFactory() +// +// ---------------------------------------------------------------------------- +// +UT_AiPluginFactory::UT_AiPluginFactory() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::SetupL() + { + iUiMgr = CAiUiControllerManager::NewL(); + + iFactory = CAiPluginFactory::NewL( *iUiMgr ); + iFactory->ConstructL(); + + iStateManager = CAiStateManager::NewL( *iFactory ); + + iWait = new ( ELeave ) CActiveSchedulerWait; + + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + iResult = KErrNone; + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::Teardown() + { + delete iFactory; + iFactory = NULL; + + delete iUiMgr; + iUiMgr = NULL; + + delete iStateManager; + iStateManager = NULL; + + if ( iPeriodic->IsActive() ) + { + iPeriodic->Cancel(); + } + delete iPeriodic; + iPeriodic = NULL; + + if ( iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + delete iWait; + iWait = NULL; + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestCreateDestroyPluginL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestCreateDestroyPluginL() + { + THsPublisherInfo data( + TUid::Uid( KOrganizerUid ), KOrganizer, KNs1 ); + + THsPublisherInfo profile( + TUid::Uid( KProfileUid ), KProfile, KNs2 ); + + THsPublisherInfo devstat( + TUid::Uid( KDevstatUid ), KDevstat, KNs2 ); + + THsPublisherInfo missing( + TUid::Uid( KProfileUid ), KProfile, KNullDesC8 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + // create 2 same without waiting first to finnish. Second should return + // KErrAlreadyExists + TAiFwPublisherInfo info( data, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iFactory->LoadPlugin( info ); + iFactory->LoadPlugin( info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrAlreadyExists ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); + + // wait for destroy to finnish + iFactory->DestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 0 ); + + // create 2 same and wait first to finnish. Second should return + // KErrAlreadyExists + iFactory->LoadPlugin( info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); + + iFactory->LoadPlugin( info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrAlreadyExists ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); + + // Test missing namespace + TAiFwPublisherInfo missingInfo( missing, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iFactory->LoadPlugin( missingInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( missing ) == NULL, ETrue ); + + // Test unknown + TAiFwPublisherInfo unknownInfo( unknown, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iFactory->LoadPlugin( unknownInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( unknown ) == NULL, ETrue ); + + //profile + TAiFwPublisherInfo profileInfo( profile, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iFactory->LoadPlugin( profileInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile ) != NULL, ETrue ); + + // Create devstat + TAiFwPublisherInfo devstatInfo( devstat, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iFactory->LoadPlugin( devstatInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + // Test that Devstat is recycled by creating exactly same plugin again + iFactory->LoadPlugin( devstatInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + // wait for destroy to finnish + iFactory->DestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) == NULL, ETrue ); + + // Test profile recycle, it won't be deleted + iFactory->DestroyPlugin( profileInfo ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile ) != NULL, ETrue ); + + // Test devstat recycle, it won't be deleted + iFactory->DestroyPlugin( devstatInfo ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( devstat ) != NULL, ETrue ); + + // Try destroying unknown + iFactory->DestroyPlugin( unknownInfo ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( unknown ) == NULL, ETrue ); + + iFactory->Publishers().ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestCreateDestroyPluginL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestCreateDestroyAllL() + { + THsPublisherInfo data( + TUid::Uid( KOrganizerUid ), KOrganizer, KNs1 ); + + TAiFwPublisherInfo info( data, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iFactory->LoadPlugin( info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); + + //destroy using uid + iFactory->DestroyPlugin( info.Info().Uid() ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) == NULL, ETrue ); + + iFactory->LoadPlugin( info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) != NULL, ETrue ); + + iFactory->DestroyAllPlugins(); + iPeriodic->Start( KDestroyDelay*2, KDestroyDelay*2, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( data ) == NULL, ETrue ); + } +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestPluginByInfoL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestPluginByInfoL() + { + THsPublisherInfo profile1( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo profile2( + TUid::Uid( KProfileUid ), KProfile, KNs2 ); + + THsPublisherInfo missing( + TUid::Uid( KProfileUid ), KProfile, KNullDesC8 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + TAiFwPublisherInfo profile1Info( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profile1Info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + TAiFwPublisherInfo profile2Info( profile2, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profile2Info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + TAiFwPublisherInfo missingInfo( missing, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( missingInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ) + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( missing ) == NULL, ETrue ); + + TAiFwPublisherInfo unknownInfo( unknown, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( unknownInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ) + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( unknown ) == NULL, ETrue ); + + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile1 ) == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile2 ) != NULL, ETrue ); + + // Because profile2 is recycled, it won't be deleted + profile2Info = TAiFwPublisherInfo( profile2, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profile2Info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByInfo( profile2 ) != NULL, ETrue ); + + iFactory->Publishers().ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestPluginByUidL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestPluginByUidL() + { + THsPublisherInfo profile1( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + TAiFwPublisherInfo profile1Info( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profile1Info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + TAiFwPublisherInfo unknownInfo( unknown, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( unknownInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ); + + EUNIT_ASSERT_EQUALS( iFactory->PluginByUid( unknown.Uid() ) == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByUid( profile1.Uid() ) != NULL, ETrue ); + + // Because profile1 is recycled, it won't be deleted + profile1Info = TAiFwPublisherInfo( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profile1Info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByUid( profile1.Uid() ) != NULL, ETrue ); + + iFactory->Publishers().ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestPluginByNameL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestPluginByNameL() + { + THsPublisherInfo profile1( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + TAiFwPublisherInfo profile1Info( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profile1Info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + TAiFwPublisherInfo unknownInfo( unknown, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( unknownInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ); + + EUNIT_ASSERT_EQUALS( iFactory->PluginByName( unknown.Name() ) == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iFactory->PluginByName( profile1.Name() ) != NULL, ETrue ); + + // Because profile1 is recycled, it won't be deleted + profile1Info = TAiFwPublisherInfo( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( profile1Info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->PluginByName( profile1.Name() ) != NULL, ETrue ); + + iFactory->Publishers().ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestGetPublishersL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestGetPublishersL() + { + THsPublisherInfo profile1( + TUid::Uid( KProfileUid ), KProfile, KNs1 ); + + THsPublisherInfo profile2( + TUid::Uid( KProfileUid ), KProfile, KNs2 ); + + THsPublisherInfo unknown( + TUid::Uid( KUnknownUid ), KUnknown, KNs1 ); + + THsPublisherInfo data( + TUid::Uid( KOrganizerUid ), KOrganizer, KNs1 ); + + + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 0 ); + + TAiFwPublisherInfo profile1Info( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profile1Info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + + TAiFwPublisherInfo dataInfo( data, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( dataInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 2 ); + + TAiFwPublisherInfo profile2Info( profile2, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( profile2Info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 2 ); + + TAiFwPublisherInfo unknownInfo( unknown, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iFactory->LoadPlugin( unknownInfo ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 2 ); + + profile1Info = TAiFwPublisherInfo( profile1, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + iFactory->DestroyPlugin( profile1Info ); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 2 ); + + profile2Info = TAiFwPublisherInfo( profile2, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + iFactory->DestroyPlugin( profile2Info ); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 2 ); + + dataInfo = TAiFwPublisherInfo( data, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iFactory->DestroyPlugin( dataInfo ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + + iFactory->Publishers().ResetAndDestroy(); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 0 ); + } + +// ---------------------------------------------------------------------------- +// UT_AiPluginFactory::TestUpgradePublishersL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::TestUpgradePublishersL() + { + RArray< THsPublisherInfo > array; + CleanupClosePushL( array ); + + CleanupStack::PopAndDestroy( &array ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::CallBack() +// +// ---------------------------------------------------------------------------- +// +void UT_AiPluginFactory::CallBack( TAny* aPtr, TInt aResult ) + { + UT_AiPluginFactory* self = static_cast< UT_AiPluginFactory* >( aPtr ); + self->iResult = aResult; + self->iWait->AsyncStop(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::TimerCallBack +// +// ---------------------------------------------------------------------------- +// +TInt UT_AiPluginFactory::TimerCallBack( TAny* aPtr ) + { + UT_AiPluginFactory* self = static_cast< UT_AiPluginFactory* >( aPtr ); + + if ( self->iPeriodic->IsActive() ) + { + self->iPeriodic->Cancel(); + } + + self->iWait->AsyncStop(); + return KErrNone; + } + + +//----------------------------------------------------------------------------- +// Test case table +// +//----------------------------------------------------------------------------- +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiPluginFactory, + "Unit test suite for CAiPluginFactory", + "UNIT" ) + + EUNIT_TEST( + "Create/Destroy Plugin", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestCreateDestroyPluginL, Teardown ) + + EUNIT_TEST( + "Create/Destroy All", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestCreateDestroyAllL, Teardown ) + + EUNIT_TEST( + "PluginByInfo", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestPluginByInfoL, Teardown ) + + EUNIT_TEST( + "PluginByUid", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestPluginByUidL, Teardown ) + + EUNIT_TEST( + "PluginByName", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestPluginByNameL, Teardown ) + + EUNIT_TEST( + "Get Publishers", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestGetPublishersL, Teardown ) + + EUNIT_TEST( + "Upgrade Publishers", + "CAiPluginFactory", + "", + "FUNCTIONALITY", + SetupL, TestUpgradePublishersL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/src/ut_aipluginfactory_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aipluginfactory/src/ut_aipluginfactory_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aipluginfactory.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiPluginFactory::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/bwins/ut_aistatemanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/bwins/ut_aistatemanageru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/eabi/ut_aistatemanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/eabi/ut_aistatemanageru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aistatemanager.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/group/ut_aistatemanager.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/group/ut_aistatemanager.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aistatemanager.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aistatemanager.cpp +SOURCE aicpscommandbuffer.cpp +SOURCE aicpsexecuteparam.cpp + +SOURCEPATH ../../stub/src +SOURCE aiuicontrollermanager_stub.cpp +SOURCE aiuicontroller_stub.cpp +SOURCE aipluginfactory_stub.cpp + +SOURCEPATH ../src +SOURCE ut_aistatemanager.cpp +SOURCE ut_aistatemanager_dllmain.cpp + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY commonengine.lib +LIBRARY liwServiceHandler.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/inc/ut_aistatemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/inc/ut_aistatemanager.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateManager +* +*/ + + +#ifndef _UT_AISTATEMANAGER_H +#define _UT_AISTATEMANAGER_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CAiUiControllerManager; +class CAiPluginFactory; +class CAiStateManager; +class CActiveSchedulerWait; +class CPeriodic; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiStateManager ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiStateManager* NewL(); + + /** + * Two phase construction + */ + static UT_AiStateManager* NewLC(); + + /** + * Destructor + */ + ~UT_AiStateManager(); + +private: + // Constructors and destructors + + UT_AiStateManager(); + + void ConstructL(); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestStateChangeL(); + void TestLoadAndDestroyPluginL(); + void TestUpgradePluginL(); + void NotifyReleasePluginsL(); + + static void CallBack( TAny* aPtr, TInt aResult ); + static TInt TimerCallBack( TAny* aPtr ); + +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + + CAiUiControllerManager* iUiMgr; + CAiPluginFactory* iFactory; + CAiStateManager* iMgr; + CAiStateManager* iStateManager; + CActiveSchedulerWait* iWait; + TInt iResult; + CPeriodic* iPeriodic; + }; + +#endif // _UT_AISTATEMANAGER_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/src/ut_aistatemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/src/ut_aistatemanager.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,463 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateManager +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include + +// User includes +#include "ut_aistatemanager.h" + +#include "aipluginfactory_stub.h" +#include "aiuicontroller_stub.h" +#include "aiuicontrollermanager_stub.h" + +#include "aistatemanager.h" +#include "aifwpublisherinfo.h" + +// Constants +_LIT( KProfile, "Profile" ); +_LIT( KDummy, "dummy" ); + +const TInt KUid( 0x10275101 ); +const TInt KNone( 0xBABE2BDED ); +const TInt KDestroyDelay( 600000 ); + +_LIT8( KNs, "namespace" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiStateManager::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateManager* UT_AiStateManager::NewL() + { + UT_AiStateManager* self = UT_AiStateManager::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateManager* UT_AiStateManager::NewLC() + { + UT_AiStateManager* self = new ( ELeave ) UT_AiStateManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::~UT_AiStateManager() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateManager::~UT_AiStateManager() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::UT_AiStateManager() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateManager::UT_AiStateManager() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::SetupL() + { + iUiMgr = CAiUiControllerManager::NewL(); + iFactory = CAiPluginFactory::NewL( *iUiMgr ); + iFactory->ConstructL(); + iStateManager = CAiStateManager::NewL( *iFactory ); + iMgr = CAiStateManager::NewL( *iFactory ); + iWait = new ( ELeave ) CActiveSchedulerWait; + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::Teardown() + { + delete iMgr; + iMgr = NULL; + + delete iFactory; + iFactory = NULL; + + delete iUiMgr; + iUiMgr = NULL; + + delete iStateManager; + iStateManager = NULL; + + if ( iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + delete iWait; + iWait = NULL; + + if ( iPeriodic->IsActive() ) + { + iPeriodic->Cancel(); + } + delete iPeriodic; + iPeriodic = NULL; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::TestLoadAndDestroyPluginL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::TestLoadAndDestroyPluginL() + { + THsPublisherInfo hsInfo( TUid::Uid( KUid ), KProfile, KNs ); + + TAiFwPublisherInfo info( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iMgr->iFactory.Publishers().Count(), 1 ); + + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemShutdown ); + iMgr->NotifyDestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + + TAiFwPublisherInfo info2( hsInfo, TAiFwCallback( CallBack, this ), EAiFwPageStartup ); + iMgr->NotifyLoadPlugin( info2 ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + + info2 = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwPageShutdown ); + iMgr->NotifyDestroyPlugin( info2 ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + + TAiFwPublisherInfo info3( hsInfo, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iMgr->NotifyLoadPlugin( info3 ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNone ); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + + info3 = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iMgr->NotifyDestroyPlugin( info3 ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + + THsPublisherInfo unknown( TUid::Uid( KNone ), KDummy, KNs ); + TAiFwPublisherInfo info4( unknown, TAiFwCallback( CallBack, this ), EAiFwPluginStartup ); + iMgr->NotifyLoadPlugin( info4 ); + iWait->Start(); + EUNIT_ASSERT_EQUALS( iResult, KErrNotSupported ); + + info4 = TAiFwPublisherInfo( unknown, TAiFwCallback( CallBack, this ), EAiFwPluginShutdown ); + iMgr->NotifyDestroyPlugin( info4 ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + + //iMgr->DestroyPlugins(); + EUNIT_ASSERT_EQUALS( iFactory->Publishers().Count(), 1 ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::TestStateChangeL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::TestStateChangeL() + { + THsPublisherInfo hsInfo( TUid::Uid( KUid ), KProfile, KNs ); + TAiFwPublisherInfo info( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::ESuspended ); + + TBitFlags32 clear; + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.iFlags, clear.iFlags ); + + EUNIT_ASSERT_EQUALS( iMgr->iHalt, EFalse ); + + iMgr->NotifyStateChange( EAiFwUiStartup ); + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsClear( CAiStateManager::EShutdown ), ETrue ); + + iMgr->NotifyStateChange( EAiFwForeground ); + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsSet( CAiStateManager::EIsForeground ), ETrue ); + + iMgr->NotifyStateChange( EAiFwBacklightOn ); + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsSet( CAiStateManager::EIsLightsOn ), ETrue ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemShutdown ); + iMgr->NotifyDestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + + iMgr->NotifyStateChange( EAiFwOnline ); + + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemShutdown ); + iMgr->NotifyDestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + + iMgr->NotifyStateChange( EAiFwBacklightOff ); + iMgr->NotifyStateChange( EAiFwBacklightOn ); + iMgr->NotifyStateChange( EAiFwBacklightOff ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::ESuspended ); + + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemShutdown ); + iMgr->NotifyDestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + + iMgr->NotifyStateChange( EAiFwBacklightOn ); + iMgr->NotifyStateChange( EAiFwForeground ); + + iMgr->NotifyStateChange( EAiFwBacklightOff ); + iMgr->NotifyStateChange( EAiFwBacklightOn ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + + iMgr->NotifyStateChange( EAiFwBacklightOff ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::ESuspended ); + + iMgr->NotifyStateChange( EAiFwBackground ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::ESuspended ); + + iMgr->NotifyStateChange( EAiFwBacklightOn ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::ESuspended ); + + iMgr->NotifyStateChange( EAiFwForeground ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + + iMgr->NotifyStateChange( EAiFwOnline ); + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsSet( CAiStateManager::EIsOnline ), ETrue ); + + iMgr->NotifyStateChange( EAiFwOffline ); + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsClear( CAiStateManager::EIsOnline ), ETrue ); + + iMgr->NotifyStateChange( EAiFwOnline ); + + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsSet( CAiStateManager::EIsOnline ), ETrue ); + + iMgr->NotifyStateChange( EAiFwGeneralThemeChange ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + + iMgr->NotifyStateChange( EAiFwBackupRestoreStart ); + + EUNIT_ASSERT_EQUALS( iMgr->iHalt, ETrue ); + + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + + iMgr->NotifyStateChange( EAiFwBackupRestoreEnd ); + + EUNIT_ASSERT_EQUALS( iMgr->iHalt, EFalse ); + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + + iMgr->NotifyStateChange( (TAiFwState) 0xFFFF ); + iMgr->NotifyStateChange( (TAiFwState) 0xFFFF ); + + EUNIT_ASSERT_EQUALS( iMgr->iHalt, EFalse ); + EUNIT_ASSERT_EQUALS( iMgr->iCurrentState, CAiStateManager::EAlive ); + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsSet( CAiStateManager::EIsOnline ), ETrue ); + + iMgr->NotifyStateChange( EAiFwUiShutdown ); + EUNIT_ASSERT_EQUALS( iMgr->iFlags.IsSet( CAiStateManager::EShutdown ), ETrue ); + + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemShutdown ); + iMgr->NotifyDestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::TestUpgradePluginL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::TestUpgradePluginL() + { + THsPublisherInfo hsInfo( TUid::Uid( KUid ), KProfile, KNs ); + TAiFwPublisherInfo info( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + + iMgr->NotifyReloadPlugins(); + //iWait->Start(); + + info = TAiFwPublisherInfo( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemShutdown ); + iMgr->NotifyDestroyPlugin( info ); + iPeriodic->Start( KDestroyDelay, KDestroyDelay, TCallBack( TimerCallBack, this ) ); + iWait->Start(); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::NotifyReleasePlugins +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::NotifyReleasePluginsL() + { + THsPublisherInfo hsInfo( TUid::Uid( KUid ), KProfile, KNs ); + TAiFwPublisherInfo info( hsInfo, TAiFwCallback( CallBack, this ), EAiFwSystemStartup ); + + iMgr->NotifyLoadPlugin( info ); + iWait->Start(); + + RArray aUidList; + aUidList.Append( hsInfo.Uid() ); + iMgr->NotifyReleasePlugins( aUidList ); + CHsContentPublisher* plugin = iMgr->iFactory.PluginByUid( hsInfo.Uid() ); + if ( plugin ) + { + User::Leave( KErrArgument); + } + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::CallBack() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateManager::CallBack( TAny* aPtr, TInt aResult ) + { + UT_AiStateManager* self = static_cast< UT_AiStateManager* >( aPtr ); + self->iResult = aResult; + self->iWait->AsyncStop(); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateManager::TimerCallBack +// +// ---------------------------------------------------------------------------- +// +TInt UT_AiStateManager::TimerCallBack( TAny* aPtr ) + { + UT_AiStateManager* self = static_cast< UT_AiStateManager* >( aPtr ); + + if ( self->iPeriodic->IsActive() ) + { + self->iPeriodic->Cancel(); + } + + self->iWait->AsyncStop(); + return KErrNone; + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiStateManager, + "Unit test suite for CAiStateManager", + "UNIT" ) + + EUNIT_TEST( + "Load/Destroy Publisher", + "CAiStatemManager", + "", + "FUNCTIONALITY", + SetupL, TestLoadAndDestroyPluginL, Teardown ) + +EUNIT_TEST( + "Notify Release Plugins", + "CAiStatemManager", + "", + "FUNCTIONALITY", + SetupL, NotifyReleasePluginsL, Teardown ) + + + EUNIT_TEST( + "State change", + "CAiStatemManager", + "", + "FUNCTIONALITY", + SetupL, TestStateChangeL, Teardown ) + + EUNIT_TEST( + "Upgrade Publisher", + "CAiStatemManager", + "", + "FUNCTIONALITY", + SetupL, TestUpgradePluginL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/src/ut_aistatemanager_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistatemanager/src/ut_aistatemanager_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aistatemanager.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiStateManager::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/bwins/ut_aistateprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/bwins/ut_aistateprovideru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/eabi/ut_aistateprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/eabi/ut_aistateprovideru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aistateprovider.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/group/ut_aistateprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/group/ut_aistateprovider.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aistateprovider.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aistateprovider.cpp +SOURCE aiecomobserver.cpp + +SOURCEPATH ../../stub/src + +SOURCEPATH ../src +SOURCE ut_aistateprovider.cpp +SOURCE ut_aistateprovider_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY hwrmlightclient.lib +LIBRARY aknskinsrv.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY swiutils.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/inc/ut_aistateprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/inc/ut_aistateprovider.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateProvider +* +*/ + + +#ifndef _UT_AISTATEPROVIDER_H +#define _UT_AISTATEPROVIDER_H + +// System includes +#include +#include + +// User includes +#include +#include "aistateobserver.h" + +// Forward declarations +class CAiStateProvider; +class THsPublisherInfo; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiStateProvider ) : public CEUnitTestSuiteClass, + public MAiStateObserver + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiStateProvider* NewL(); + + /** + * Two phase construction + */ + static UT_AiStateProvider* NewLC(); + + /** + * Destructor + */ + ~UT_AiStateProvider(); + +private: + // Constructors and destructors + + UT_AiStateProvider(); + + void ConstructL(); + +private: + // from MAiStateObserver + + /** + * @see MAiStateObserver + */ + void NotifyStateChange( TAiFwState aState ); + + /** + * @see MAiStateObserver + */ + void NotifyLoadPlugin( const TAiFwPublisherInfo& aInfo ); + + /** + * @see MAiStateObserver + */ + void NotifyDestroyPlugin( const TAiFwPublisherInfo& aInfo ); + + /** + * @see MAiStateObserver + */ + //void NotifyUpdatePlugins(); + + /** + * Notifies to reload previously released plugins + * + * @since S60 5.2 + */ + void NotifyReloadPlugins(); + + /** + * Notifies that defined ECom plugins should be released to enable + * plugin upgrade + * + * @since S60 5.2 + */ + void NotifyReleasePlugins( const RArray& aUidList ); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestStartStopL(); + void TestFgBgStateL(); + void TestLightStateL(); + void TestSkinChangeL(); + void TestEcomRegistryChangeL(); + void TestLoadDestroyPluginL(); + void TestChangePluginStateL(); + void TestBackupRestoreStateChangeL(); + void SwiUidListEventL(); + +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + + CAiStateProvider* iProvider; + + TAiFwState iExpectedState; + TBool iIgnoreNotifyStateChange; + TBool iPluginsUpdated; + + }; + +#endif // _UT_AISTATEPROVIDER_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/src/ut_aistateprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/src/ut_aistateprovider.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,488 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateProvider +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include +#include "ut_aistateprovider.h" + +#include "aistateprovider.h" +#include "aifwpublisherinfo.h" + +// Constants +const TInt KUid( 0xBABE2BED ); +_LIT( KTestPublisher, "TestPublisher" ); +_LIT8( KNs, "TestNamespace" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateProvider* UT_AiStateProvider::NewL() + { + UT_AiStateProvider* self = UT_AiStateProvider::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateProvider* UT_AiStateProvider::NewLC() + { + UT_AiStateProvider* self = new ( ELeave ) UT_AiStateProvider(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::~UT_AiStateProvider() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateProvider::~UT_AiStateProvider() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::UT_AiStateProvider() +// +// ---------------------------------------------------------------------------- +// +UT_AiStateProvider::UT_AiStateProvider() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NotifyStateChange() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::NotifyStateChange( TAiFwState aState ) + { + if ( iIgnoreNotifyStateChange ) + { + return; + } + + EUNIT_ASSERT_EQUALS( aState, iExpectedState ); + + if ( iExpectedState == EAiFwUiStartup ) + { + // Need to ignore until state provider is fully constructed + iIgnoreNotifyStateChange = ETrue; + } + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NotifyLoadPlugin() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::NotifyLoadPlugin( const TAiFwPublisherInfo& aInfo ) + { + //TODO: ok? + THsPublisherInfo info( TUid::Uid( KUid ), KTestPublisher, KNs ); + + EUNIT_ASSERT_EQUALS( aInfo.Info(), info ); + + EUNIT_ASSERT_EQUALS( aInfo.Reason(), EAiFwSystemStartup ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NotifyDestroyPlugin() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::NotifyDestroyPlugin( const TAiFwPublisherInfo& aInfo ) + { + //TODO: ok? + THsPublisherInfo info( TUid::Uid( KUid ), KTestPublisher, KNs ); + + EUNIT_ASSERT_EQUALS( aInfo.Info(), info ); + + EUNIT_ASSERT_EQUALS( aInfo.Reason(), EAiFwSystemShutdown ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NotifyUpdatePlugins() +// +// ---------------------------------------------------------------------------- +// +/*void UT_AiStateProvider::NotifyUpdatePlugins() + { + iPluginsUpdated = ETrue; + }*/ + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NotifyReloadPlugins() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::NotifyReloadPlugins() + { + iPluginsUpdated = ETrue; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::NotifyReleasePlugins() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::NotifyReleasePlugins( const RArray& ) + { + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::SetupL() + { + CCoeEnv* env( CCoeEnv::Static() ); + + iExpectedState = EAiFwUiStartup; + + iProvider = CAiStateProvider::NewL( *this ); + iProvider->StartL( *env ); + + iIgnoreNotifyStateChange = EFalse; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::Teardown() + { + iExpectedState = EAiFwUiShutdown; + + iProvider->Stop(); + + delete iProvider; + iProvider = NULL; + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestStartStopL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestStartStopL() + { + CCoeEnv* env( CCoeEnv::Static() ); + + EUNIT_ASSERT_EQUALS( iProvider->iStarted, ETrue ); + + iExpectedState = EAiFwUiShutdown; + + iProvider->Stop(); + + EUNIT_ASSERT_EQUALS( iProvider->iStarted, EFalse ); + EUNIT_ASSERT_EQUALS( iProvider->iCoeEnv == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iEcomObserver == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iBackupRestoreObserver == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iLightObserver == NULL, ETrue ); + + iExpectedState = EAiFwUiStartup; + + iProvider->StartL( *env ); + + EUNIT_ASSERT_EQUALS( iProvider->iStarted, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iCoeEnv != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iEcomObserver != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iBackupRestoreObserver != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iLightObserver != NULL, ETrue ); + + iIgnoreNotifyStateChange = EFalse; + iExpectedState = (TAiFwState)0; + // Should not get any notification because already started + iProvider->StartL( *env ); + + EUNIT_ASSERT_EQUALS( iProvider->iStarted, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iCoeEnv != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iEcomObserver != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iBackupRestoreObserver != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iLightObserver != NULL, ETrue ); + + iExpectedState = EAiFwUiShutdown; + + iProvider->Stop(); + + EUNIT_ASSERT_EQUALS( iProvider->iStarted, EFalse ); + EUNIT_ASSERT_EQUALS( iProvider->iCoeEnv == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iEcomObserver == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iBackupRestoreObserver == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iLightObserver == NULL, ETrue ); + + iExpectedState = (TAiFwState)0; + // Should not get any notification because already stopped + iProvider->Stop(); + + EUNIT_ASSERT_EQUALS( iProvider->iStarted, EFalse ); + EUNIT_ASSERT_EQUALS( iProvider->iCoeEnv == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iEcomObserver == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iBackupRestoreObserver == NULL, ETrue ); + EUNIT_ASSERT_EQUALS( iProvider->iLightObserver == NULL, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestFgBgStateL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestFgBgStateL() + { + TWsEvent event; + + iExpectedState = EAiFwForeground; + + event.SetType( KAknFullOrPartialForegroundGained ); + + iProvider->MonitorWsMessage( event ); + + iExpectedState = EAiFwBackground; + + event.SetType( KAknFullOrPartialForegroundLost ); + + iProvider->MonitorWsMessage( event ); + + event.SetType( 0 ); + + iProvider->MonitorWsMessage( event ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestLightStateL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestLightStateL() + { + iExpectedState = EAiFwBacklightOn; + + iProvider->LightStatusChanged( + CHWRMLight::EPrimaryDisplay, CHWRMLight::ELightOn ); + + iExpectedState = EAiFwBacklightOff; + + iProvider->LightStatusChanged( + CHWRMLight::EPrimaryDisplay, CHWRMLight::ELightOff ); + + iProvider->LightStatusChanged( + CHWRMLight::EPrimaryDisplay, CHWRMLight::ELightStatusUnknown ); + + iProvider->LightStatusChanged( + CHWRMLight::ENoTarget, CHWRMLight::ELightStatusUnknown ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestSkinChangeL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestSkinChangeL() + { + iProvider->SkinContentChanged(); + iProvider->SkinPackageChanged( ( TAknsSkinStatusPackageChangeReason) 0 ); + + iExpectedState = EAiFwGeneralThemeChange; + + iProvider->SkinConfigurationChanged( + EAknsSkinStatusConfigurationDeployed ); + + iProvider->SkinConfigurationChanged( + EAknsSkinStatusConfigurationMerged ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestEcomRegistryChangeL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestEcomRegistryChangeL() + { + iPluginsUpdated = EFalse; + + iProvider->NotifyEcomRegistryChanged(); + + EUNIT_ASSERT_EQUALS( iPluginsUpdated, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestLoadDestroyPluginL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestLoadDestroyPluginL() + { + //TODO: ok? + THsPublisherInfo hsInfo( TUid::Uid( KUid ), KTestPublisher, KNs ); + TAiFwPublisherInfo info( hsInfo, TAiFwCallback(), EAiFwSystemStartup ); + + iProvider->LoadPlugin( info ); + + iProvider->DestroyPlugin( info/*, EAiFwSystemShutdown*/ ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestChangePluginStateL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestChangePluginStateL() + { + iExpectedState = EAiFwOffline; + + iProvider->ChangePluginState( EAiFwOffline ); + + iExpectedState = EAiFwOnline; + + iProvider->ChangePluginState( EAiFwOnline ); + + iProvider->ChangePluginState( EAiFwBacklightOn ); + iProvider->ChangePluginState( EAiFwBackupRestoreStart ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::TestBackupRestoreStateChangeL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::TestBackupRestoreStateChangeL() + { + iIgnoreNotifyStateChange = ETrue; + + EUNIT_ASSERT_EQUALS( + CAiStateProvider::BackupRestoreEvent( iProvider ), KErrNone ); + } + +// ---------------------------------------------------------------------------- +// UT_AiStateProvider::SwiUidListEventL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiStateProvider::SwiUidListEventL() + { + TInt ret = iProvider->SwiUidListEvent( iProvider ); + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiStateProvider, + "Unit test suite for CAiStateProvider", + "UNIT" ) + + EUNIT_TEST( + "Start/Stop provider", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestStartStopL, Teardown ) + + EUNIT_TEST( + "Fg/Bg state change", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestFgBgStateL, Teardown ) + + EUNIT_TEST( + "Light state change", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestLightStateL, Teardown ) + + EUNIT_TEST( + "Skin change", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestSkinChangeL, Teardown ) + + EUNIT_TEST( + "Ecom registry change", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestEcomRegistryChangeL, Teardown ) + + EUNIT_TEST( + "Load/Destroy plugin", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestLoadDestroyPluginL, Teardown ) + + EUNIT_TEST( + "Change plugin state", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestChangePluginStateL, Teardown ) + + EUNIT_TEST( + "Backup/Restore state", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, TestBackupRestoreStateChangeL, Teardown ) + + EUNIT_TEST( + "Swi Uid List Event", + "CAiStateProvider", + "", + "FUNCTIONALITY", + SetupL, SwiUidListEventL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/src/ut_aistateprovider_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aistateprovider/src/ut_aistateprovider_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aistateprovider.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiStateProvider::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/bwins/ut_aiuicontrollermanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/bwins/ut_aiuicontrollermanageru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/eabi/ut_aiuicontrollermanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/eabi/ut_aiuicontrollermanageru.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_aiuicontrollermanager.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/group/ut_aiuicontrollermanager.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/group/ut_aiuicontrollermanager.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_aiuicontrollermanager.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../../../../inc/framework +USERINCLUDE ../../../../../inc/common +USERINCLUDE ../../stub/inc +USERINCLUDE ../inc + +SOURCEPATH ../../../../../src/framework +SOURCE aiuicontrollermanager.cpp + +SOURCEPATH ../../stub/src +SOURCE aiuicontroller_stub.cpp +SOURCE aifw_stub.cpp + +SOURCEPATH ../src +SOURCE ut_aiuicontrollermanager.cpp +SOURCE ut_aiuicontrollermanager_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY centralrepository.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/inc/ut_aiuicontrollermanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/inc/ut_aiuicontrollermanager.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiUiControllerManager +* +*/ + + +#ifndef _UT_AIUICONTROLLERMANAGER_H +#define _UT_AIUICONTROLLERMANAGER_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CAiUiControllerManager; +class CAiFw; + +// Clas declaration +NONSHARABLE_CLASS( UT_AiUiControllerManager ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_AiUiControllerManager* NewL(); + + /** + * Two phase construction + */ + static UT_AiUiControllerManager* NewLC(); + + /** + * Destructor + */ + ~UT_AiUiControllerManager(); + +private: + // Constructors and destructors + + UT_AiUiControllerManager(); + + void ConstructL(); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestGetUiControllersL(); + void TestActivateUIL(); + void TestGetMainUiControllerL(); + void TestIsMainUiControllerL(); + void TestRunApplicationL(); + void TestLoadUIDefinitionL(); + void TestGetCoeEnvL(); + void TestDestroySecondaryUiControllersL(); + void TestExitMainControllerL(); + void TestSetStateHandlerL(); + +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + + CAiFw* iAiFw; + CAiUiControllerManager* iUiMgr; + }; + +#endif // _UT_AIUICONTROLLERMANAGER_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/src/ut_aiuicontrollermanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/src/ut_aiuicontrollermanager.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,513 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for CAiStateProvider +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "aifw_stub.h" +#include "aiuicontroller_stub.h" + +#include "ut_aiuicontrollermanager.h" + +#include "aiuicontrollermanager.h" + +// Constants + + +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiUiControllerStub +// +// ---------------------------------------------------------------------------- +// +CAiUiControllerStub* AsCAiUiControllerStub( CAiUiController* aController ) + { + return static_cast< CAiUiControllerStub* >( aController ); + } + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_AiUiControllerManager* UT_AiUiControllerManager::NewL() + { + UT_AiUiControllerManager* self = UT_AiUiControllerManager::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_AiUiControllerManager* UT_AiUiControllerManager::NewLC() + { + UT_AiUiControllerManager* self = new ( ELeave ) UT_AiUiControllerManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::~UT_AiUiControllerManager() +// +// ---------------------------------------------------------------------------- +// +UT_AiUiControllerManager::~UT_AiUiControllerManager() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::UT_AiUiControllerManager() +// +// ---------------------------------------------------------------------------- +// +UT_AiUiControllerManager::UT_AiUiControllerManager() + { + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::SetupL() + { + iAiFw = CAiFw::NewL(); + + iUiMgr = CAiUiControllerManager::NewL( iAiFw ); + + // Get rid of real UI controllers + iUiMgr->UiControllers().ResetAndDestroy(); + + CAiUiControllerStub* stub1 = CAiUiControllerStub::NewL(); + iUiMgr->UiControllers().Append( stub1 ); + + CAiUiControllerStub* stub2 = CAiUiControllerStub::NewL(); + iUiMgr->UiControllers().Append( stub2 ); + + stub1->iMain = ETrue; + iUiMgr->iMainUiController = stub1; + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::Teardown() + { + delete iUiMgr; + iUiMgr = NULL; + + delete iAiFw; + iAiFw = NULL; + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestGetUiControllersL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestGetUiControllersL() + { + EUNIT_ASSERT_EQUALS( iUiMgr->UiControllers().Count() == 2, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestActivateUIL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestActivateUIL() + { + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iActive, EFalse ); + } + + iUiMgr->ActivateUI(); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iActive, ETrue ); + } + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestGetMainUiControllerL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestGetMainUiControllerL() + { + MAiMainUiController* main( &iUiMgr->MainUiController() ); + + CAiUiControllerStub* stub( NULL ); + + TInt count( 0 ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* temp = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( temp->iMain ) + { + stub = temp; + count++; + } + } + + EUNIT_ASSERT_EQUALS( count, 1 ); + EUNIT_ASSERT_EQUALS( stub == main, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestIsMainUiControllerL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestIsMainUiControllerL() + { + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( stub->iMain ) + { + EUNIT_ASSERT_EQUALS( iUiMgr->IsMainUiController( *stub ), ETrue ); + } + else + { + EUNIT_ASSERT_EQUALS( iUiMgr->IsMainUiController( *stub ), EFalse ); + } + } + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestRunApplicationL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestRunApplicationL() + { + iUiMgr->RunApplicationL(); + + TInt count( 0 ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( stub->iRunning ) + { + count++; + } + } + + EUNIT_ASSERT_EQUALS( count, 1 ); + + CAiUiControllerStub* main = + static_cast< CAiUiControllerStub* >( &iUiMgr->MainUiController() ); + + CAiUiControllerStub* running( NULL ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( stub->iRunning ) + { + running = stub; + break; + } + } + + EUNIT_ASSERT_EQUALS( running != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( main != NULL, ETrue ); + EUNIT_ASSERT_EQUALS( running == main, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestLoadUIDefinitionL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestLoadUIDefinitionL() + { + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iUiDefinition, EFalse ); + } + + iUiMgr->LoadUIDefinition(); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iUiDefinition, ETrue ); + } + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestGetCoeEnvL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestGetCoeEnvL() + { + CCoeEnv* env( &iUiMgr->CoeEnv() ); + + EUNIT_ASSERT_EQUALS( env != NULL, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestDestroySecondaryUiControllersL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestDestroySecondaryUiControllersL() + { + TInt count( 0 ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( !stub->iMain ) + { + count++; + } + } + + EUNIT_ASSERT_EQUALS( count > 0, ETrue ); + + iUiMgr->DestroySecondaryUiControllers(); + + count = 0; + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( !stub->iMain ) + { + count++; + } + } + + EUNIT_ASSERT_EQUALS( count == 0, ETrue ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iMain, ETrue ); + } + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestExitMainControllerL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestExitMainControllerL() + { + TInt count( 0 ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( stub->iMain ) + { + count++; + + EUNIT_ASSERT_EQUALS( stub->iExit, EFalse ); + } + } + + EUNIT_ASSERT_EQUALS( count > 0, ETrue ); + + TInt count2( 0 ); + + iUiMgr->ExitMainController(); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + if ( stub->iMain ) + { + count2++; + EUNIT_ASSERT_EQUALS( stub->iExit, ETrue ); + } + } + + EUNIT_ASSERT_EQUALS( count == count2, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_AiUiControllerManager::TestSetStateHandlerL() +// +// ---------------------------------------------------------------------------- +// +void UT_AiUiControllerManager::TestSetStateHandlerL() + { + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iStateHandler, EFalse ); + } + + MAiFwStateHandler* handler = reinterpret_cast< MAiFwStateHandler* >( this ); + + iUiMgr->SetStateHandler( *handler ); + + for ( TInt i = 0; i < iUiMgr->UiControllers().Count(); i++ ) + { + CAiUiControllerStub* stub = + AsCAiUiControllerStub( iUiMgr->UiControllers()[i] ); + + EUNIT_ASSERT_EQUALS( stub->iStateHandler, ETrue ); + } + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_AiUiControllerManager, + "Unit test suite for CAiUiControllerManager", + "UNIT" ) + + EUNIT_TEST( + "GetUiControllers", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestGetUiControllersL, Teardown ) + + EUNIT_TEST( + "ActivateUi", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestActivateUIL, Teardown ) + + EUNIT_TEST( + "GetMainUiController", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestGetMainUiControllerL, Teardown ) + + EUNIT_TEST( + "IsMainUiController", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestIsMainUiControllerL, Teardown ) + + EUNIT_TEST( + "RunApplication", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestRunApplicationL, Teardown ) + + EUNIT_TEST( + "LoadUiDefinition", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestLoadUIDefinitionL, Teardown ) + + EUNIT_TEST( + "GetCoeEnv", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestGetCoeEnvL, Teardown ) + + EUNIT_TEST( + "DestroySecondaryUiControllers", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestDestroySecondaryUiControllersL, Teardown ) + + EUNIT_TEST( + "ExitMainController", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestExitMainControllerL, Teardown ) + + EUNIT_TEST( + "SetStateHandler", + "CAiUiControllerManager", + "", + "FUNCTIONALITY", + SetupL, TestSetStateHandlerL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/src/ut_aiuicontrollermanager_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_aiuicontrollermanager/src/ut_aiuicontrollermanager_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_aiuicontrollermanager.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_AiUiControllerManager::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/bwins/ut_hspublisherinfou.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/bwins/ut_hspublisherinfou.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/eabi/ut_hspublisherinfou.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/eabi/ut_hspublisherinfou.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ut_hspublisherinfo.mmp diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/group/ut_hspublisherinfo.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/group/ut_hspublisherinfo.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + + +TARGET ut_hspublisherinfo.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIFW_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + +SOURCEPATH ../src +SOURCE ut_hspublisherinfo.cpp +SOURCE ut_hspublisherinfo_dllmain.cpp + +LIBRARY aiutils.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/inc/ut_hspublisherinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/inc/ut_hspublisherinfo.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for THsPublisherInfo +* +*/ + + +#ifndef _UT_HSPUBLISHERINFO_H +#define _UT_HSPUBLISHERINFO_H + +// System includes +#include +#include + +// User includes + +// Forward declarations + +// Clas declaration +NONSHARABLE_CLASS( UT_HsPublisherInfo ) : public CEUnitTestSuiteClass + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_HsPublisherInfo* NewL(); + + /** + * Two phase construction + */ + static UT_HsPublisherInfo* NewLC(); + + /** + * Destructor + */ + ~UT_HsPublisherInfo(); + +private: + // Constructors and destructors + + UT_HsPublisherInfo(); + + void ConstructL(); + +private: + // New methods + + void SetupL(); + void Teardown(); + + void TestConstructionL(); + void TestAssigmentOperatorL(); + void TestEqualsOperatorL(); + void TestGetUidL(); + void TestGetNameL(); + void TestGetNamespaceL(); + +private: + // data + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // _UT_HSPUBLISHERINFO_H + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/src/ut_hspublisherinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/src/ut_hspublisherinfo.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,269 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: EUnit unit test class for THsPublisherInfo +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include + +#include "ut_hspublisherinfo.h" + +// Constants +_LIT( KName, "testname" ); +_LIT8( KNamespace, "testnamespace" ); + +const TInt KUid( 0xBABE2BED ); + + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======= +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::NewL() +// +// ---------------------------------------------------------------------------- +// +UT_HsPublisherInfo* UT_HsPublisherInfo::NewL() + { + UT_HsPublisherInfo* self = UT_HsPublisherInfo::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::NewLC() +// +// ---------------------------------------------------------------------------- +// +UT_HsPublisherInfo* UT_HsPublisherInfo::NewLC() + { + UT_HsPublisherInfo* self = new ( ELeave ) UT_HsPublisherInfo(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::~UT_HsPublisherInfo() +// +// ---------------------------------------------------------------------------- +// +UT_HsPublisherInfo::~UT_HsPublisherInfo() + { + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::UT_HsPublisherInfo() +// +// ---------------------------------------------------------------------------- +// +UT_HsPublisherInfo::UT_HsPublisherInfo() + { + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::SetupL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::SetupL() + { + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::Teardown() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::Teardown() + { + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::TestConstructionL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::TestConstructionL() + { + TUid uid( TUid::Uid( KUid ) ); + + THsPublisherInfo info; + + EUNIT_ASSERT_EQUALS( info.iUid == TUid::KNullUid, ETrue ); + EUNIT_ASSERT_EQUALS( info.iName == KNullDesC, ETrue ); + EUNIT_ASSERT_EQUALS( info.iNamespace == KNullDesC8, ETrue ); + + THsPublisherInfo info2( uid, KName, KNamespace ); + + EUNIT_ASSERT_EQUALS( info2.iUid == uid, ETrue ); + EUNIT_ASSERT_EQUALS( info2.iName == KName, ETrue ); + EUNIT_ASSERT_EQUALS( info2.iNamespace == KNamespace, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::TestAssigmentOperatorL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::TestAssigmentOperatorL() + { + TUid uid( TUid::Uid( KUid ) ); + + THsPublisherInfo info; + + THsPublisherInfo info2( uid, KName, KNamespace ); + + info = info2; + + EUNIT_ASSERT_EQUALS( info.iUid == uid, ETrue ); + EUNIT_ASSERT_EQUALS( info.iName == KName, ETrue ); + EUNIT_ASSERT_EQUALS( info.iNamespace == KNamespace, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::TestEqualsOperatorL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::TestEqualsOperatorL() + { + TUid uid( TUid::Uid( KUid ) ); + + THsPublisherInfo info( uid, KName, KNamespace ); + THsPublisherInfo info2 = info; + + EUNIT_ASSERT_EQUALS( info == info2, ETrue ); + + THsPublisherInfo info3; + + EUNIT_ASSERT_EQUALS( !( info == info3 ), ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::TestGetUidL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::TestGetUidL() + { + TUid uid( TUid::Uid( KUid ) ); + + THsPublisherInfo info( uid, KName, KNamespace ); + + EUNIT_ASSERT_EQUALS( info.Uid() == uid, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::TestGetNameL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::TestGetNameL() + { + TUid uid( TUid::Uid( KUid ) ); + + THsPublisherInfo info( uid, KName, KNamespace ); + + EUNIT_ASSERT_EQUALS( info.Name() == KName, ETrue ); + } + +// ---------------------------------------------------------------------------- +// UT_HsPublisherInfo::TestGetNamespaceL() +// +// ---------------------------------------------------------------------------- +// +void UT_HsPublisherInfo::TestGetNamespaceL() + { + TUid uid( TUid::Uid( KUid ) ); + + THsPublisherInfo info( uid, KName, KNamespace ); + + EUNIT_ASSERT_EQUALS( info.Namespace() == KNamespace, ETrue ); + } + +//------------------------------------------------------------------------------ +// Test case table +// +//------------------------------------------------------------------------------ +// +EUNIT_BEGIN_TEST_TABLE( + UT_HsPublisherInfo, + "Unit test suite for THsPublisherInfo", + "UNIT" ) + + EUNIT_TEST( + "Construction", + "THsPublisherInfo", + "", + "FUNCTIONALITY", + SetupL, TestConstructionL, Teardown ) + + EUNIT_TEST( + "AssigmentOperator", + "THsPublisherInfo", + "", + "FUNCTIONALITY", + SetupL, TestAssigmentOperatorL, Teardown ) + + EUNIT_TEST( + "EqualsOperator", + "THsPublisherInfo", + "", + "FUNCTIONALITY", + SetupL, TestEqualsOperatorL, Teardown ) + + EUNIT_TEST( + "GetUid", + "THsPublisherInfo", + "", + "FUNCTIONALITY", + SetupL, TestGetUidL, Teardown ) + + EUNIT_TEST( + "GetName", + "THsPublisherInfo", + "", + "FUNCTIONALITY", + SetupL, TestGetNameL, Teardown ) + + EUNIT_TEST( + "GetNamespace", + "THsPublisherInfo", + "", + "FUNCTIONALITY", + SetupL, TestGetNamespaceL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/src/ut_hspublisherinfo_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/framework/ut_aifw/ut_hspublisherinfo/src/ut_hspublisherinfo_dllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "ut_hspublisherinfo.h" + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_HsPublisherInfo::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: homescreensrv main bld.inf file for module tests +* +*/ + +// Utility lib +#include "../utility/group/bld.inf" + +// Idle integration +#include "../idleint/group/bld.inf" + +// AI Framework +#include "../framework/group/bld.inf" diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/bwins/UT_idleintu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/bwins/UT_idleintu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,11 @@ +EXPORTS + ?NewL@CAiWsPluginManager@@SAPAV1@AAVCCoeEnv@@@Z @ 1 NONAME ; class CAiWsPluginManager * CAiWsPluginManager::NewL(class CCoeEnv &) + ?CreatePSPropertyObserverL@AiUtility@@YAPAVMAiPSPropertyObserver@@VTCallBack@@VTUid@@H@Z @ 2 NONAME ; class MAiPSPropertyObserver * AiUtility::CreatePSPropertyObserverL(class TCallBack, class TUid, int) + ?CreatePluginSettingsL@AiUtility@@YAPAVMAiPluginSettings@@XZ @ 3 NONAME ; class MAiPluginSettings * AiUtility::CreatePluginSettingsL(void) + ?CreateContentItemArrayIteratorL@AiUtility@@YAPAVMAiContentItemIterator@@PBUTAiContentItem@@H@Z @ 4 NONAME ; class MAiContentItemIterator * AiUtility::CreateContentItemArrayIteratorL(struct TAiContentItem const *, int) + ?NewL@CAiUiIdleIntegration@@SAPAV1@AAVCEikonEnv@@ABUTAiIdleKeySoundConfig@@PAVMAiFwEventHandler@@@Z @ 5 NONAME ; class CAiUiIdleIntegration * CAiUiIdleIntegration::NewL(class CEikonEnv &, struct TAiIdleKeySoundConfig const &, class MAiFwEventHandler *) + ?NewLC@CAiIdleAppRegister@@SAPAV1@XZ @ 6 NONAME ; class CAiIdleAppRegister * CAiIdleAppRegister::NewLC(void) + ?CreateStrParserL@AiUtility@@YAPAVMAiStrParser@@XZ @ 7 NONAME ; class MAiStrParser * AiUtility::CreateStrParserL(void) + ?CreatePluginToolL@AiUtility@@YAPAVMAiPluginTool@@XZ @ 8 NONAME ; class MAiPluginTool * AiUtility::CreatePluginToolL(void) + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 9 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/eabi/UT_idleintu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/eabi/UT_idleintu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,11 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _ZN18CAiIdleAppRegister5NewLCEv @ 2 NONAME + _ZN18CAiWsPluginManager4NewLER7CCoeEnv @ 3 NONAME + _ZN20CAiUiIdleIntegration4NewLER9CEikonEnvRK21TAiIdleKeySoundConfigP17MAiFwEventHandler @ 4 NONAME + _ZN9AiUtility16CreateStrParserLEv @ 5 NONAME + _ZN9AiUtility17CreatePluginToolLEv @ 6 NONAME + _ZN9AiUtility21CreatePluginSettingsLEv @ 7 NONAME + _ZN9AiUtility25CreatePSPropertyObserverLE9TCallBack4TUidi @ 8 NONAME + _ZN9AiUtility31CreateContentItemArrayIteratorLEPK14TAiContentItemi @ 9 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/group/UT_IdleInt.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/group/UT_IdleInt.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + + +TARGET UT_idleint.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 +VENDORID VID_DEFAULT + +CAPABILITY EUNIT_CAPS +MACRO _AIUIIDLEINT_UNIT_TEST + +MW_LAYER_SYSTEMINCLUDE +APP_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../UT_IdleInt +USERINCLUDE ../stubs +SYSTEMINCLUDE ../stubs1 +USERINCLUDE ../../../group +USERINCLUDE ../../../inc/common +USERINCLUDE ../../../inc/idleint +USERINCLUDE ../../../inc/utility +USERINCLUDE ../../../inc/framework +USERINCLUDE ../../../src/idleint + +SOURCEPATH ../UT_IdleInt +SOURCE UT_idleint.cpp +SOURCE UT_idleintdllmain.cpp +SOURCE testshellforidleint.cpp +SOURCE testshellforstate.cpp + +SOURCEPATH ../stubs +SOURCE caipspropertyobserver.cpp +SOURCE aiutility.cpp + +SOURCEPATH ../../../src/common +SOURCE aifwpanic.cpp + +SOURCEPATH ../../../src/idleint +SOURCE aiwspluginmanager.cpp +SOURCE aiidleappregister.cpp + +LIBRARY eunit.lib +LIBRARY eunitutil.lib +LIBRARY euser.lib +LIBRARY apgrfx.lib +LIBRARY ws32.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY avkon.lib +LIBRARY aknnotify.lib + +LIBRARY aiutils.lib + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +UT_idleint.mmp + +PRJ_TESTEXPORTS + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/stubs/aiutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/stubs/aiutility.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "aiutility.h" +#include "caipspropertyobserver.h" +#include "caistrparser.h" +#include "caicontentitemarrayiterator.h" +#include "aipluginsettingsimpl.h" +#include "caiplugintool.h" +#include "UT_IdleInt.h" + +//#include +#include + + +EXPORT_C MAiPSPropertyObserver* AiUtility::CreatePSPropertyObserverL( + TCallBack aCallBack, + TUid aCategory, + TInt aKey ) + { + CPSPropertyObserver* observerStub = UT_IdleInt::PSPropertyObserver( aCategory, aKey ); + observerStub->SetCallBack( aCallBack ); + return observerStub; + //return CPSPropertyObserver::NewL( aCallBack, aCategory, aKey ); + } + +EXPORT_C MAiStrParser* AiUtility::CreateStrParserL() + { + return NULL; + } + +EXPORT_C MAiContentItemIterator* AiUtility::CreateContentItemArrayIteratorL( + const TAiContentItem* /*aArray*/, + TInt /*aCount*/ ) + { + return NULL; + } + +EXPORT_C MAiPluginSettings* AiUtility::CreatePluginSettingsL() + { + return NULL; + } + +EXPORT_C MAiPluginTool* AiUtility::CreatePluginToolL() + { + return NULL; + } + + + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/stubs/aiutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/stubs/aiutility.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef AIUTILITY_H +#define AIUTILITY_H + +#include +#include + +class MAiPSPropertyObserver; +class MAiStrParser; +class MAiContentItemIterator; +class MAiPluginSettings; +class MAiPluginTool; + +/** +* Active Idle Utility Library. +* +* @since S60 3.2 +*/ +namespace AiUtility + { + + /** + * Creates a Publish & Subscribe keys observer. + * + * @param aCallBack callback method to call when the key value changes. + * @param aCategory key category. + * @param aKey key to observe in category. + * @return pointer to a new publish and subscribe keys observer. + */ + IMPORT_C MAiPSPropertyObserver* CreatePSPropertyObserverL( + TCallBack aCallBack, + TUid aCategory, + TInt aKey ); + + /** + * Creates a string parser. + * + * @return pointer to a new string parser. + */ + IMPORT_C MAiStrParser* CreateStrParserL(); + + /** + * Creates a new iterator instance from a TAiContentItem array. + * + * @since S60 3.2 + * @param aArray content item array. + * @param aCount number of content items in aArray. + * @return a new iterator object for aArray. + */ + IMPORT_C MAiContentItemIterator* CreateContentItemArrayIteratorL( + const TAiContentItem* aArray, + TInt aCount ); + + /** + * Helper factory function for creating a MAiContentItemIterator out + * of a const C array of TAiContentItem objects. This function infers the item + * count of the array automatically from the array argument passed to it. + * + * @param aArray const C array of TAiContentItem objects. + * @return MAiContentItemIterator instance for iterating aArray. Client + * takes ownership of the returned object. + */ + template + inline MAiContentItemIterator* CreateContentItemArrayIteratorL + ( const TAiContentItem (&aArray)[N] ) + { + return AiUtility::CreateContentItemArrayIteratorL(aArray, N); + } + + /** + * Creates the plugin settings. + * + * @since S60 3.2 + * @return pointer to plugin settings. + */ + IMPORT_C MAiPluginSettings* CreatePluginSettingsL(); + + /** + * Creates the plugin tool. + * + * @since S60 3.2 + * @return pointer to plugin tool. + */ + IMPORT_C MAiPluginTool* CreatePluginToolL(); + + } + +#endif // AIUTILITY_H + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/stubs/aknsoundsystem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/stubs/aknsoundsystem.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is an interface for controlling keysounds. +* +*/ + + +#if !defined(__AKNSOUNDSYSTEM_H__) +#define __AKNSOUNDSYSTEM_H__ + +// INCLUDES +#include +#include +#include + + +// CLASS DECLARATION +class CAknSoundPlayer; +class CAknKeySoundStack; + +/** +* This is an interface for controlling keysounds from Avkon. +* Provides support for handling key sounds. +* @since Series 60 0.9 +*/ +NONSHARABLE_CLASS(CAknKeySoundSystem) : public CBase + { +public: + /** + * Base class default constructor. + * @param aUid Application UID. + * @return A pointer to a new @c CAknKeySoundSystem object. + */ + static CAknKeySoundSystem* NewL(TInt /*aUid*/) + { + return new(ELeave) CAknKeySoundSystem(); + }; + + /** + * Destructor. + */ + ~CAknKeySoundSystem() + { + }; + + /** + * Function reads resource data from resource file and push the context + * to the server session. The most common Avkon resources in this case are + * @c R_AVKON_DEFAULT_SOUND_LIST, @c R_AVKON_DEFAULT_SKEY_LIST and + * @c R_AVKON_SILENT_SKEY_LIST. + * If a leave occurs the framework generates a Symbian Leave code. + * @param aResourceId Avkon resource ID. + */ + void PushContextL(TInt/* aResourceId*/) + { + }; + + /** + * Pop the context from the server session object. + */ + void PopContext() + { + }; + + /** + * This function plays key event sounds. + * @param aKeyEvent The scan code of the key that caused the event. + */ + void PlaySound(const TKeyEvent& /*aKeyEvent*/) + { + }; + + /** + * This function plays sounds by sound ID. + * @param aSid Sound ID. These SID numbers are specified in Avkon + * enum @c TAvkonSystemSID. + */ + void PlaySound(TInt /*aSid*/) + { + }; + + /** + * Function reads resource data from resource file. And adds the + * application sound info list to the server session. + * If the leave occurs the framework generates a Symbian Leave code. + * @param aResourceId Avkon resource ID. + */ + void AddAppSoundInfoListL(TInt /*aResourceId*/) + { + }; + + /** + * This function brings the sounds back to foreground. This function should + * be called from @c HandleForegroundEventL(). @c HandleForegroundEventL() is + * implemented in @c CAknAppUi and it is reimplemented in @c CAknViewAppUi. + */ + void BringToForeground() + { + }; + + /** + * Stops playing the sound with given ID. + * @param aSid Sound ID. Application defined SID's should be less than 1000. + */ + void StopSound(TInt /*aSid*/) + { + }; + + /** + * Locks context. + */ + void LockContext() + { + }; + + /** + * Releases context. + */ + void ReleaseContext() + { + }; + + /** + * Reads sound information from certain given sound ID. + * @since Series 60 2.0 + * @param aSid ID for sound which's information is requested. + * @param aInfo Sound information will be put in this structure. + * @return TInt Returns @c KErrNone if succesfull otherwise returns + * @c KErrNotFound if requested sound ID is not found. + */ + TInt RequestSoundInfoL(TInt /*aSid*/, CAknSoundInfo& /*aInfo*/) + { + return KErrNone; + }; + + /** + * Returns top context id from the session. + * + * @since 3.1 + * @return The resource id of the context that is at the top of the soundstack. + */ + TInt TopContext() + { + return KErrNone; + }; + +public://private: + CAknKeySoundSystem() + { + }; + void ConstructL(TInt /*aUid*/) + { + }; +private: + //CAknSoundPlayer* iSoundPlayer; + //TInt iSpare; + }; + +#endif // __AKNSOUNDSYSTEM_H__ diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/stubs/caipspropertyobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/stubs/caipspropertyobserver.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Publish and subscribe parameter observer implementation. +* +*/ + + +#include + +//#include +#include + +#include "caipspropertyobserver.h" + + + +//const TInt KNotifyTimeShort( 100000 ); +//const TInt KNotifyTimeLong( 10000000 ); +// --------------------------------------------------------------------------- +// void ConstructL( TCallBack aCallBack, TUid aCategory, TInt aKey ) +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::ConstructL() + { + + //User::LeaveIfError( iProperty.Attach( iCategory, iKey ) ); + User::LeaveIfError( iTimer.CreateLocal() ); + CActiveScheduler::Add( this ); + + //iProperty.Subscribe( iStatus ); + //SetActive(); + } + +// --------------------------------------------------------------------------- +// CPSPropertyObserver() +// --------------------------------------------------------------------------- +// +CPSPropertyObserver::CPSPropertyObserver( TUid aCategory, + TInt aKey ) + : + CActive( CActive::EPriorityStandard ), + iCategory( aCategory ), + iKey( aKey ), + iCounter( 0 ) + { + } + +// --------------------------------------------------------------------------- +// CPSPropertyObserver* NewL( TCallBack aCallBack, TUid aCategory, TInt aKey ) +// --------------------------------------------------------------------------- +// +CPSPropertyObserver* CPSPropertyObserver::NewL( TUid aCategory, + TInt aKey ) + { + CPSPropertyObserver* self = new ( ELeave ) CPSPropertyObserver( aCategory, + aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// ~CPSPropertyObserver() +// --------------------------------------------------------------------------- +// +CPSPropertyObserver::~CPSPropertyObserver() + { + //Deque(); + //iProperty.Close(); + iTimer.Close(); + } + +// --------------------------------------------------------------------------- +// void Release() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::Release() + { + iTimer.Close(); + delete this; + } + +// --------------------------------------------------------------------------- +// void RunL() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::RunL() + { + iTimer.Close(); + iOtherObserver->DoEvent(); + //iCallBack.CallBack(); + } + +// --------------------------------------------------------------------------- +// void DoCancel() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::DoCancel() + { + iTimer.Cancel(); + } + +// --------------------------------------------------------------------------- +// TInt Get() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::SetCallBack( TCallBack aCallBack ) + { + iCallBack = aCallBack; + } + +void CPSPropertyObserver::DoEvent() + { + iCallBack.CallBack(); + } + +void CPSPropertyObserver::SetOtherObserver( CPSPropertyObserver* aOther ) + { + iOtherObserver = aOther; + } + +TInt CPSPropertyObserver::Get() + { + TInt value = 0; + + // iProperty.Get( iCategory, iKey, value ); + + return value; + } + +// --------------------------------------------------------------------------- +// TInt Get( TInt& aValue ) +// --------------------------------------------------------------------------- +// +TInt CPSPropertyObserver::Get( TInt& aValue ) + { + //TInt error = iProperty.Get( iCategory, iKey, aValue ); + TInt error = KErrNone; + + aValue = ESwStateCriticalPhaseOK; + + return error; + } + +// --------------------------------------------------------------------------- +// TInt Get( TDes8& aString ) +// --------------------------------------------------------------------------- +// +TInt CPSPropertyObserver::Get( TDes8& aString ) + { + _LIT8( txt, "TEST"); + aString.Copy( txt ); + //TInt error = iProperty.Get( iCategory, iKey, aString ); + TInt error = KErrNone; + return error; + } + +// --------------------------------------------------------------------------- +// TInt Get( TDes16& aString ) +// --------------------------------------------------------------------------- +// +TInt CPSPropertyObserver::Get( TDes16& /*aString*/ ) + { + //TInt error = iProperty.Get( iCategory, iKey, aString ); + return KErrNone; + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/stubs/caipspropertyobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/stubs/caipspropertyobserver.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef C_CPSPROPERTYOBSERVER_H +#define C_CPSPROPERTYOBSERVER_H + +#include +#include + +#include "aipspropertyobserver.h" + +/** + * Publish and subscribe key observer + * + * @lib aiutils.lib + * @since S60 3.2 + */ + +NONSHARABLE_CLASS(CPSPropertyObserver) : public CActive, public MAiPSPropertyObserver + { + +public: + + /** + * Two-phased constructor. + */ + static CPSPropertyObserver* NewL ( TUid aCategory, TInt aKey ); + + /** + * Destructor. + */ + ~CPSPropertyObserver(); + + /** + * Release the observer + */ + void Release(); + + +// from base class CActive +protected: + + void RunL(); + void DoCancel(); + + +// New methods for test purposes +public: + + void HandlePhoneEvent(); + void HandleSystemEvent(); + void SetCallBack( TCallBack aCallBack ); + void DoEvent(); + void SetOtherObserver( CPSPropertyObserver* aOther ); + +// from base class MAiPSPropertyObserver + + TInt Get(); + + TInt Get( TInt& aValue ); + + TInt Get( TDes8& aString ); + + TInt Get( TDes16& aString ); + +private: + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CPSPropertyObserver( TUid aCategory, + TInt aKey ); + +private: + + /** + * Callback member + */ + TCallBack iCallBack; + + /** + * PS category id + */ + TUid iCategory; + + /** + * PS key + */ + TInt iKey; + + /** + * Property member + */ + RProperty iProperty; + + RTimer iTimer; + TInt iCounter; + + CPSPropertyObserver* iOtherObserver; + + }; + +#endif // C_CPSPROPERTYOBSERVER_H + +// End of File. diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/stubs1/e32property.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/stubs1/e32property.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,180 @@ +/* +* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __E32PROPERTY_H__ +#define __E32PROPERTY_H__ + +#include + +/** +@publishedAll +@released + +Property category UID value reserved for System services. +*/ +static const TInt32 KUidSystemCategoryValue=0x101f75b6; + + +/** +@publishedAll +@released + +Property category UID reserved for System services +*/ +static const TUid KUidSystemCategory={KUidSystemCategoryValue}; + + +/** +@publishedAll +@released + +The lowest value for Property categories at which additional +security restrictions are applied when defining properties. + +Properties with category values above this threshold may only be defined +if the category matches the defining process's Secure ID. + +Below this threashold, properties may be defined either by processes with +a matching Secure ID, or by processes with the WriteDeviceData capability. +*/ +static const TInt32 KUidSecurityThresholdCategoryValue=0x10273357; + + +/** +@publishedAll +@released + +User side interface to Publish & Subscribe. + +The class defines a handle to a property, a single data value representing +an item of state information. Threads can publish (change) a property value +through this handle. Threads can also subscribe +(request notification of changes) to a property value through this handle; +they can also retrieve the current property value. +*/ +class RProperty : public RHandleBase + { +public: + /** + The largest supported property value, in bytes, for byte-array (binary) + types and text types. + */ + enum { KMaxPropertySize = 512 }; + /** + The largest supported property value, in bytes, for large byte-array (binary) + types and large text types. + */ + enum { KMaxLargePropertySize = 65535 }; + + + /** + Property type attribute. + */ + enum TType + { + /** + Integral property type. + */ + EInt, + + + /** + Byte-array (binary data) property type. + This type provides real-time guarantees but is limited to a maximum size + of 512 bytes. + + @see KMaxPropertySize + */ + EByteArray, + + + /** + Text property type. + This is just a programmer friendly view of a byte-array property, and + is implemented in the same way as EByteArray. + */ + EText = EByteArray, + + + /** + Large byte-array (binary data) property type. + This type provides no real-time guarantees but supports properties + of up to 65536 bytes. + + @see KMaxLargePropertySize + */ + ELargeByteArray, + + + /** + Large text property type. + This is just a programmer friendly view of a byte-array property, and + is implemented in the same way as EByteArray. + */ + ELargeText = ELargeByteArray, + + + /** + Upper limit for TType values. + It is the maximal legal TType value plus 1. + */ + ETypeLimit, + + + /** + Bitmask for TType values coded within TInt attributes. + */ + ETypeMask = 0xff + }; + + +public: + IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0); + IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); + IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); + IMPORT_C static TInt Delete(TUid aCategory, TUint aKey); + IMPORT_C static TInt Delete(TUint aKey); + IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TInt& aValue); + IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue); +#ifndef __KERNEL_MODE__ + IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue); +#endif + IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue); + IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue); +#ifndef __KERNEL_MODE__ + IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue); +#endif + + IMPORT_C TInt Attach(TUid aCategory, TUint aKey, TOwnerType aType = EOwnerProcess); + + IMPORT_C void Subscribe(TRequestStatus& aRequest); + IMPORT_C void Cancel(); + + IMPORT_C TInt Get(TInt& aValue); + IMPORT_C TInt Get(TDes8& aValue); +#ifndef __KERNEL_MODE__ + IMPORT_C TInt Get(TDes16& aValue); +#endif + IMPORT_C TInt Set(TInt aValue); + IMPORT_C TInt Set(const TDesC8& aValue); +#ifndef __KERNEL_MODE__ + IMPORT_C TInt Set(const TDesC16& aValue); +#endif + }; + +#endif diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/CAOUserAfter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/CAOUserAfter.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,89 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __CAOUSERAFTER_H__ +#define __CAOUSERAFTER_H__ + +// INCLUDES +#include +#include +#include + + +/** + * Active object version of User::After() + */ +class CAOUserAfter : public CTimer + { + private: + CActiveSchedulerWait iWait; + TInt iLength; + + + public: //new functions + + /** + * Constructs the waiting timer, executes + * it and when timer expires, deletes self. + * @param aLength The lenghth of wait in micro + * seconds. + */ + static void AfterLD( TInt aLenght ) + { + CAOUserAfter* wait= new ( ELeave ) CAOUserAfter( aLenght ); + CleanupStack::PushL( wait ); + wait->ConstructL(); + CleanupStack::Pop(); + + RDebug::Print( _L("CAOUserAfter - Starting time consuming...") ); + wait->StartWaitD(); + RDebug::Print( _L("CAOUserAfter - completed.") ); + } + + private: + CAOUserAfter( TInt aLenght ) + : CTimer( CActive::EPriorityStandard ), + iLength( aLenght ) + { + } + + void ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + + virtual ~CAOUserAfter() + { + } + + void StartWaitD() + { + After( iLength ); + iWait.Start(); + } + + void RunL() + { + iWait.AsyncStop(); + Cancel(); + delete this; + } + }; + +#endif // __CAOUSERAFTER_H__ +// End of File + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/UT_idleint.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/UT_idleint.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,473 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// User includes +#include "UT_IdleInt.h" +#include "caouserafter.h" +#include "aifweventhandler.h" + +//#include +#include +#include +#include +#include +#define private public + +// Tested classes +//#include "aifwphoneidlesynchronizer.h" +#include "aiuiidleintegration.h" +//#include "aifwphoneidlesynchronizerimpl.h" +#include "aistate.h" +#include "aiuiidleintegrationimpl.h" +#include "aiwspluginmanager.h" +#include "aiidleappregister.h" +#include "caipspropertyobserver.h" + +class CNullEventHandler : + public CBase, + public MAiFwEventHandler + { +public: + // from MAiFwEventHandler + void AppEnvReadyL() + { + }; + void HandleUiReadyEventL(CAiUiController& /*aUiController*/) + { + }; + + void HandlePluginEvent(const TDesC& /*aParam*/) + { + }; + + TBool HasMenuItem(const TDesC& /*aPluginName*/, const TDesC& /*aMenuItem*/) + { + return ETrue; + }; + + void HandleUiLayoutChangeL(CAiUiController& /*aUiController*/) + { + }; + + void HandleUiThemeChangeStartL(CAiUiController& /*aUiController*/) + { + }; + + void HandleUiShutdown(CAiUiController& /*aUiController*/) + { + }; + + void HandleAllPluginsLoaded() + { + }; + + TBool RefreshContent(const TDesC& /*aContentCid*/) + { + return ETrue; + }; + + TBool RefreshContent( const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aContentCid*/ ) + { + return ETrue; + }; + + TBool SuspendContent( const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aContentCid*/ ) + { + return ETrue; + }; + + /* + void DestroyingPlugin( CAiContentPublisher& aPlugin ) + { + }; + */ + + void CriticalStartupPhaseOver( TInt /*aStageInteger*/ ) + { + }; + }; + +// CONSTRUCTION +UT_IdleInt* UT_IdleInt::NewL() + { + UT_IdleInt* self = UT_IdleInt::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_IdleInt* UT_IdleInt::NewLC() + { + UT_IdleInt* self = new( ELeave ) UT_IdleInt(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_IdleInt::~UT_IdleInt() + { + } + +// Default constructor +UT_IdleInt::UT_IdleInt() + { + iPhoneStatusOwned = ETrue; + iSystemStatusOwned = ETrue; + iUiStartupStatusOwned = ETrue; + } + +// Second phase construct +void UT_IdleInt::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +CPSPropertyObserver* UT_IdleInt::PSPropertyObserver( TUid aCategory, TInt aKey ) + { + UT_IdleInt* self = reinterpret_cast(Dll::Tls()); + + if( aCategory == KPSUidCtsyCallInformation && aKey == KCTsyCallState ) + { + self->iPhoneStatusOwned = EFalse; + return self->iPhoneStatusObserver; + } + else if( aCategory == KPSUidTelInformation && aKey == KTelPhoneUid ) + { + self->iPhoneStatusOwned = EFalse; + return self->iPhoneStatusObserver; + } + else if( aCategory == KPSUidStartup && aKey == KPSGlobalSystemState ) + { + self->iSystemStatusOwned = EFalse; + return self->iSystemStatusObserver; + } + else if( aCategory == KPSUidStartup && aKey == KPSStartupUiPhase ) + { + self->iUiStartupStatusOwned = EFalse; + return self->iUiStartupStatusObserver; + } + else + { + return NULL; + } + } + +void UT_IdleInt::KeySetTo( TInt aValue ) + { + UT_IdleInt* self = reinterpret_cast(Dll::Tls()); + self->iIdleStatus = aValue; + } + +void UT_IdleInt::SetupL( ) + { + iPhoneStatusObserver = CPSPropertyObserver::NewL(KPSUidAiInformation, + KActiveIdleUid); + iSystemStatusObserver = CPSPropertyObserver::NewL(KPSUidStartup, + KPSGlobalSystemState); + iUiStartupStatusObserver = CPSPropertyObserver::NewL(KPSUidStartup, + KPSStartupUiPhase); + + iPhoneStatusObserver->SetOtherObserver( iSystemStatusObserver ); + iSystemStatusObserver->SetOtherObserver( iPhoneStatusObserver ); + iUiStartupStatusObserver->SetOtherObserver( iSystemStatusObserver ); + + + Dll::SetTls( this ); + TAiIdleKeySoundConfig config; + config.iKeySounds = &iSoundSystemStub; + iIdleInt = CAiUiIdleIntegrationImpl::NewL( *CEikonEnv::Static(), config, this ); + iState = CActiveIdleState::NewL(); + } + +void UT_IdleInt::Teardown( ) + { + delete iState; + delete iIdleInt; + if( iPhoneStatusOwned ) + delete iPhoneStatusObserver; + if( iSystemStatusOwned ) + delete iSystemStatusObserver; + if( iUiStartupStatusOwned ) + delete iUiStartupStatusObserver; + } + +void UT_IdleInt::TestStartUpL() + { + iIdleInt->ActivateUI(); + iSystemStatusObserver->DoEvent(); + TWsEvent event; + event.SetType( KAknFullOrPartialForegroundGained ); + iIdleInt->HandleWsEventL( event, NULL ); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update +// EUNIT_ASSERT( iIdleStatus != 0 ); // assert we have foreground + // means that status updated correctly + + event.SetType( KAknFullOrPartialForegroundGained ); + iIdleInt->HandleWsEventL( event, NULL ); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update +// EUNIT_ASSERT( iIdleStatus != 0 ); // assert we have foreground + // means that status updated correctly + + event.SetType( KAknFullOrPartialForegroundLost ); + iIdleInt->HandleWsEventL( event, NULL ); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update +// EUNIT_ASSERT( iIdleStatus == 0 ); // assert we dont have foreground + // means that status updated correctly + + event.SetType( KAknFullOrPartialForegroundLost ); + iIdleInt->HandleWsEventL( event, NULL ); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update +// EUNIT_ASSERT( iIdleStatus == 0 ); // assert we dont have foreground + // means that status updated correctly + + iAiWsPluginManagerImpl = CAiWsPluginManager::NewL( *CCoeEnv::Static() ); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update + + iAiIdleAppRegister = CAiIdleAppRegister::NewLC(); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update + + iAiIdleAppRegister->RegisterL(); + CAOUserAfter::AfterLD( 1000*1000 ); // wait a second for ps to update + + if (iAiIdleAppRegister) + { + delete iAiIdleAppRegister; + iAiIdleAppRegister = NULL; + } + + if (iAiWsPluginManagerImpl) + { + delete iAiWsPluginManagerImpl; + iAiWsPluginManagerImpl = NULL; + } + + + } + +void UT_IdleInt::TestIdleIntEventControlNullAndOthersL() + { + TWsEvent event; + iIdleInt->HandleWsEventL( event, NULL ); + + event.SetType( EEventWindowGroupsChanged ); + iIdleInt->HandleWsEventL( event, NULL ); + + event.SetType( EEventFocusGroupChanged ); + iIdleInt->HandleWsEventL( event, NULL ); + + event.SetType( EEventFocusGained ); + iIdleInt->HandleWsEventL( event, NULL ); + } +// TEST TABLE + +void UT_IdleInt::TestStateChangesL() + { + iState->SetIsIdleForeground( ETrue ); + CAOUserAfter::AfterLD( 1 * 500000 ); + iState->SetIsIdleForeground( EFalse ); + CAOUserAfter::AfterLD( 1 * 500000 ); + iState->SetIsIdleForeground( ETrue ); + CAOUserAfter::AfterLD( 1 * 500000 ); + iState->SetIsIdleForeground( EFalse ); + iState->SetIsIdleForeground( ETrue ); + iState->SetIsIdleForeground( EFalse ); + iState->SetIsIdleForeground( ETrue ); + iState->SetIsIdleForeground( EFalse ); + } + +void UT_IdleInt::AppEnvReadyL() + { + } + +void UT_IdleInt::HandleUiReadyEventL( CAiUiController& /*aUiController*/ ) + { + } + +void UT_IdleInt::HandlePluginEvent( const TDesC& /*aParam*/ ) + { + } + +TBool UT_IdleInt::HasMenuItem(const TDesC& /*aPluginName*/, const TDesC& /*aMenuItem*/) + { + return ETrue; + } + +void UT_IdleInt::HandleUiLayoutChangeL( CAiUiController& /*aUiController*/ ) + { + } + +void UT_IdleInt::HandleUiThemeChangeStartL( CAiUiController& /*aUiController*/ ) + { + } + +void UT_IdleInt::HandleUiShutdown( CAiUiController& /*aUiController*/ ) + { + } + +void UT_IdleInt::HandleAllPluginsLoaded() + { + } + +void UT_IdleInt::HandleEnterEditMode() + { + } + +void UT_IdleInt::HandleExitEditMode() + { + } + +void UT_IdleInt::HandleUIChangeEventL() + { + } + +void UT_IdleInt::HandleActivateUI() + { + } + +void UT_IdleInt::HandleLoadPluginL( const THsPublisherInfo& /*aPublisherInfo*/ ) + { + } + +void UT_IdleInt::HandleDestroyPluginL( const THsPublisherInfo& /*aPublisherInfo*/ ) + { + } + +void UT_IdleInt::HandlePluginEventL( const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aParam*/ ) + { + } + +TBool UT_IdleInt::HasMenuItemL( const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aMenuItem*/ ) + { + } + +TBool UT_IdleInt::IsPluginsOnline() + { + return ETrue; + } + +void UT_IdleInt::SetPluginsOnlineStatus(TBool /*aStatus*/) + { + } + +TBool UT_IdleInt::IsRoaming() + { + return ETrue; + } + +void UT_IdleInt::ShowRoamingNotificationL() + { + } + +TBool UT_IdleInt::RefreshContent( const TDesC& /*aContentCid*/ ) + { + return ETrue; + } + +TBool UT_IdleInt::RefreshContent( const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aContentCid*/ ) +{ + return ETrue; +} + +TBool UT_IdleInt::SuspendContent( const THsPublisherInfo& /*aPublisherInfo*/, const TDesC& /*aContentCid*/ ) +{ + return ETrue; +}; +/* +void UT_IdleInt::DestroyingPlugin( CAiContentPublisher& aPlugin ) + { + } +*/ +void UT_IdleInt::CriticalStartupPhaseOver( TInt /*aStageInteger*/ ) + { + } + +TBool UT_IdleInt::QueryIsMenuOpen() + { + return ETrue; + } + +/* +void UT_IdleInt::ProcessStateChange( TAifwStates aState ) + { + } +*/ +/* +void UT_IdleInt::HandlePluginsOnlineStatus( + const RAiPublisherInfoArray& aPlugins,TBool aStatus ) + { + } +*/ +void UT_IdleInt::SetPluginsVisibility( TBool /*aStatus*/ ) + { + } + +void UT_IdleInt::ProcessOnlineState( TBool /*aOnline*/ ) + { + } + + +EUNIT_BEGIN_TEST_TABLE( + UT_IdleInt, + "Unit test suite for class Active Idle Framework", + "CAiFw" ) + +EUNIT_TEST( + "Test IdleInt event control NULL", + "CAiUiIdleIntegrationImpl", + "", + "FUNCTIONALITY", + SetupL, TestIdleIntEventControlNullAndOthersL, Teardown) + +EUNIT_TEST( + "Test State changes", + "CActiveIdleState", + "", + "FUNCTIONALITY", + SetupL, TestStateChangesL, Teardown) + + /* +EUNIT_TEST( + "Test Start Up", + "CAiFwPhoneIdleSynchronizerImpl", + "", + "FUNCTIONALITY", + SetupL, TestStartUpL, Teardown) +*/ + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/UT_idleint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/UT_idleint.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __UT_IDLEINT_H__ +#define __UT_IDLEINT_H__ + +// System includes +#include +#include + +// User includes +#include +#include "AknSoundSystem.h" +#include "aifweventhandler.h" +#include "aifwdefs.h" + +// Forward declarations +class CAiUiIdleIntegrationImpl; +class CAiWsPluginManager; +class CAiIdleAppRegister; +class CActiveIdleState; +class CPSPropertyObserver; +class MAiPSPropertyObserver; + +// Class declaration +NONSHARABLE_CLASS( UT_IdleInt ) : public CEUnitTestSuiteClass, + public MAiFwEventHandler + { +public: + // Constructors and destructors + + /** + * Two phase construction + */ + static UT_IdleInt* NewL(); + + static UT_IdleInt* NewLC(); + + /** + * Destructor + */ + ~UT_IdleInt(); + +private: + // Constructors and destructors + + UT_IdleInt(); + + void ConstructL(); + +private: + // From MAiFwEventHandler + + void AppEnvReadyL(); + + void HandleUiReadyEventL( CAiUiController& aUiController ); + + void HandlePluginEvent( const TDesC& aParam ); + + TBool HasMenuItem( const TDesC& aPluginName, const TDesC& aMenuItem ); + + void HandleUiLayoutChangeL( CAiUiController& aUiController ); + + void HandleUiThemeChangeStartL( CAiUiController& aUiController ); + + void HandleUiShutdown( CAiUiController& aUiController ); + + void HandleAllPluginsLoaded(); + + void HandleEnterEditMode(); + + void HandleExitEditMode(); + + void HandleUIChangeEventL(); + + void HandleActivateUI(); + + void HandleLoadPluginL( const THsPublisherInfo& aPublisherInfo ); + + void HandleDestroyPluginL( const THsPublisherInfo& aPublisherInfo ); + + void HandlePluginEventL( const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ); + + TBool HasMenuItemL( const THsPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + + /** + * Checks the internet using plugins status + */ + TBool IsPluginsOnline(); + + /** + * Sets the internet using plugins status + */ + void SetPluginsOnlineStatus(TBool aStatus); + + /** + * Used for quering if network is in roaming mode + */ + TBool IsRoaming(); + + /** + * Displays roaming-notification + */ + void ShowRoamingNotificationL(); + + TBool RefreshContent( const TDesC& aContentCid ); + + TBool RefreshContent( const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid ); + + TBool SuspendContent( const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid ); + + // void DestroyingPlugin( /*CAiContentPublisher*/CHsContentPublisher& aPlugin ); + + void CriticalStartupPhaseOver( TInt aStageInteger ); + + TBool QueryIsMenuOpen(); + + // void ProcessStateChange( TAifwStates aState ); + + void StoreUserOnlineSelection (TBool /*aStatus*/){}; + + /* + void HandlePluginsOnlineStatus( + const RAiPublisherInfoArray& aPlugins,TBool aStatus ); + */ + + void SetPluginsVisibility( TBool aStatus ); + + void ProcessOnlineState( TBool aOnline ); + +public: // New methods + + static CPSPropertyObserver* PSPropertyObserver( TUid aCategory, + TInt aKey); + + static void KeySetTo( TInt aValue ); + +private: // New methods + + void SetupL(); + + void Teardown(); + + void TestIdleIntEventControlNullAndOthersL(); + + void TestStateChangesL(); + + void TestStartUpL(); + +private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CAiUiIdleIntegrationImpl* iIdleInt; + + CAiWsPluginManager* iAiWsPluginManagerImpl; + + CAiIdleAppRegister* iAiIdleAppRegister; + + CActiveIdleState * iState; + + CAknKeySoundSystem iSoundSystemStub; + + public: + /** + * Observer for phone state Publish&Subscribe key. + */ + CPSPropertyObserver* iPhoneStatusObserver; + + /** + * Observer for system state Publish&Subscribe key. + */ + CPSPropertyObserver* iSystemStatusObserver; + + /** + * Observer for UI startup state Publish&Subscribe key. + */ + CPSPropertyObserver* iUiStartupStatusObserver; + + TInt iIdleStatus; + + TBool iPhoneStatusOwned; + + TBool iSystemStatusOwned; + + TBool iUiStartupStatusOwned; + + }; + +#endif // __UT_IDLEINT_H__ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/UT_idleintdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/UT_idleintdllmain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// System includes +#include + +// User includes +#include "UT_IdleInt.h" + + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return UT_IdleInt::NewL(); + } + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/testshellforidleint.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/testshellforidleint.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,19 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#define RD_BOOT_CUSTOMIZABLE_AI +#include "aiuiidleintegration.cpp" diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/testshellforstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/testshellforstate.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,20 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#define RD_BOOT_CUSTOMIZABLE_AI + +#include "aistate.cpp" diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/testshellforsyncronizer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/testshellforsyncronizer.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,20 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#define RD_BOOT_CUSTOMIZABLE_AI + +#include "aifwphoneidlesynchronizer.cpp" diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/idleint/ut_idleint/testshellforwsmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/idleint/ut_idleint/testshellforwsmanager.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,20 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#define RD_BOOT_CUSTOMIZABLE_AI + +#include "aiwspluginmanager.cpp" diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/bwins/MT_AiUtilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/bwins/MT_AiUtilsu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/eabi/MT_AiUtilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/eabi/MT_AiUtilsu.def Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/group/MT_AiUtils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/group/MT_AiUtils.mmp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// MT_AiUtils.mmp +#include +#include +#include + +TARGET MT_AiUtils.dll +TARGETTYPE dll +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x017000F3 + +CAPABILITY EUNIT_CAPS + +SOURCEPATH ../MT_AiUtils +SOURCE MT_AiUtilsDllMain.cpp +SOURCE MT_AiContentItemArrayIterator.cpp +SOURCE MT_AiPSPropertyObserver.cpp +SOURCE MT_ContentPriorityMap.cpp +SOURCE MT_AiStrParser.cpp + +USERINCLUDE ../MT_AiUtils + +SYSTEMINCLUDE ../../../inc/utility +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib charconv.lib EUnit.lib + +// Module under test +LIBRARY aiutils.lib + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: aiutils.dll unit test build file. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +mt_aiutils.mmp + +PRJ_TESTEXPORTS + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/CAOUserAfter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/CAOUserAfter.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __CAOUSERAFTER_H__ +#define __CAOUSERAFTER_H__ + +// INCLUDES +#include +#include +#include + + +/** + * Active object version of User::After() + */ +class CAOUserAfter : public CTimer + { + private: + CActiveSchedulerWait iWait; + TInt iLength; + + + public: //new functions + + /** + * Constructs the waiting timer, executes + * it and when timer expires, deletes self. + * @param aLength The lenghth of wait in micro + * seconds. + */ + static void AfterLD( TInt aLenght ) + { + CAOUserAfter* wait= new ( ELeave ) CAOUserAfter( aLenght ); + CleanupStack::PushL( wait ); + wait->ConstructL(); + CleanupStack::Pop(); + + RDebug::Print( _L("CAOUserAfter - Starting time consuming...") ); + wait->StartWaitD(); + RDebug::Print( _L("CAOUserAfter - completed.") ); + } + + private: + CAOUserAfter( TInt aLenght ) + : CTimer( CActive::EPriorityStandard ), + iLength( aLenght ) + { + } + + void ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + + virtual ~CAOUserAfter() + { + } + + void StartWaitD() + { + After( iLength ); + iWait.Start(); + } + + void RunL() + { + iWait.AsyncStop(); + Cancel(); + delete this; + } + }; + +#endif // __CAOUSERAFTER_H__ +// End of File + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiContentItemArrayIterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiContentItemArrayIterator.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS UNDER TEST +#include +#include + +#include "MT_AiContentItemArrayIterator.h" +#include + +const TInt KNonExistentItemId = -1; +_LIT(KNonExistentItemCid, "NonExistentCid"); + + + +// CONSTRUCTION +MT_AiContentItemArrayIterator* MT_AiContentItemArrayIterator::NewL() + { + MT_AiContentItemArrayIterator* self = MT_AiContentItemArrayIterator::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +MT_AiContentItemArrayIterator* MT_AiContentItemArrayIterator::NewLC() + { + MT_AiContentItemArrayIterator* self = new( ELeave ) MT_AiContentItemArrayIterator(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +MT_AiContentItemArrayIterator::~MT_AiContentItemArrayIterator() + { +#if _BullseyeCoverage + cov_write(); +#endif + } + +// Default constructor +MT_AiContentItemArrayIterator::MT_AiContentItemArrayIterator() + { + } + +// Second phase construct +void MT_AiContentItemArrayIterator::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void MT_AiContentItemArrayIterator::SetupL( ) + { + } + +void MT_AiContentItemArrayIterator::Teardown( ) + { + } + +void MT_AiContentItemArrayIterator::TestEmptyL( ) + { + MAiContentItemIterator* iter = NULL; + // Test that Release(NULL) does not crash + Release(iter); + + // Test that the iterator works correctly with an empty (NULL) array + iter = AiUtility::CreateContentItemArrayIteratorL(NULL, 0); + CleanupReleasePushL(iter); + + // Make two passes through the iterator to test also Reset + for (TInt round = 1; round <= 2; ++round) + { + EUNIT_ASSERT( !iter->HasNext() ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iter->NextL(), KErrOverflow ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iter->ItemL(0), KErrNotFound ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iter->ItemL(KNullDesC), KErrNotFound ); + iter->Reset(); + } + + CleanupStack::PopAndDestroy(iter); + + // Array with negative count should work as an empty array + iter = AiUtility::CreateContentItemArrayIteratorL(NULL, -1); + CleanupReleasePushL(iter); + + // Make two passes through the iterator to test also Reset + for (TInt round = 1; round <= 2; ++round) + { + EUNIT_ASSERT( !iter->HasNext() ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iter->NextL(), KErrOverflow ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iter->ItemL(0), KErrNotFound ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iter->ItemL(KNullDesC), KErrNotFound ); + iter->Reset(); + } + + CleanupStack::PopAndDestroy(iter); + } + +TBool operator==(const TAiContentItem& aLhs, const TAiContentItem& aRhs) + { + // Use pointer comparison as CAiContentItemArrayIterator iterates through + // the original items + return (&aLhs == &aRhs); + } + +void DoTestOneL + ( const TAiContentItem& aRefItem, MAiContentItemIterator& aIter ) + { + // Make two passes through the iterator to test also Reset + for (TInt pass = 1; pass <= 2; ++pass) + { + EUNIT_ASSERT( aIter.HasNext() ); + EUNIT_ASSERT_EQUALS( aRefItem, aIter.NextL() ); + EUNIT_ASSERT( !aIter.HasNext() ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.NextL(), KErrOverflow ); + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemId), KErrNotFound ); + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemCid), KErrNotFound ); + + EUNIT_ASSERT_EQUALS( aRefItem, aIter.ItemL(aRefItem.id) ); + EUNIT_ASSERT_EQUALS( aRefItem, aIter.ItemL(ContentCid(aRefItem)) ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemId), KErrNotFound ); + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemCid), KErrNotFound ); + + aIter.Reset(); + } + } + +void MT_AiContentItemArrayIterator::TestOneL( ) + { + const TInt KTestId = 42; + static const wchar_t KTestCid[] = L"testcid"; + static const char KTestType[] = "testtype"; + static const TAiContentItem KOneItem[] = { { KTestId, KTestCid, KTestType } }; + + // Test iterator created with NewL + MAiContentItemIterator* iter = + AiUtility::CreateContentItemArrayIteratorL(KOneItem, 1); + CleanupReleasePushL(iter); + DoTestOneL( KOneItem[0], *iter ); + CleanupStack::PopAndDestroy(iter); + + // Test iterator created with create template helper + iter = AiUtility::CreateContentItemArrayIteratorL(KOneItem); + CleanupReleasePushL(iter); + DoTestOneL( KOneItem[0], *iter ); + CleanupStack::PopAndDestroy(iter); + } + +void DoTestManyL + ( const TAiContentItem& aRefItem, MAiContentItemIterator& aIter, TInt aCount ) + { + // Make two passes through the iterator to test also Reset + for (TInt pass = 1; pass <= 2; ++pass) + { + TBool refItemIndex = -1; + for ( TInt count = 0; count < aCount; ++count ) + { + EUNIT_ASSERT( aIter.HasNext() ); + if (aIter.NextL() == aRefItem) + { + refItemIndex = count; + } + } + EUNIT_ASSERT( refItemIndex >= 0 ); + EUNIT_ASSERT( !aIter.HasNext() ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.NextL(), KErrOverflow ); + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemId), KErrNotFound ); + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemCid), KErrNotFound ); + + EUNIT_ASSERT_EQUALS( aRefItem, aIter.ItemL(aRefItem.id) ); + EUNIT_ASSERT_EQUALS( aRefItem, aIter.ItemL(ContentCid(aRefItem)) ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemId), KErrNotFound ); + EUNIT_ASSERT_SPECIFIC_LEAVE( aIter.ItemL(KNonExistentItemCid), KErrNotFound ); + + aIter.Reset(); + } + } + +void MT_AiContentItemArrayIterator::TestManyL( ) + { + const TInt KTestId1 = 42; + static const wchar_t KTestCid1[] = L"testcid1"; + static const char KTestType1[] = "testtype1"; + const TInt KTestId2 = 53; + static const wchar_t KTestCid2[] = L"testcid2"; + static const char KTestType2[] = "testtype2"; + static const TAiContentItem KTwoItems[] = + { + { KTestId1, KTestCid1, KTestType1 }, + { KTestId2, KTestCid2, KTestType2 } + }; + + // Test iterator created with NewL + MAiContentItemIterator* iter = + AiUtility::CreateContentItemArrayIteratorL(KTwoItems, 2); + CleanupReleasePushL(iter); + DoTestManyL( KTwoItems[0], *iter, 2 ); + DoTestManyL( KTwoItems[1], *iter, 2 ); + CleanupStack::PopAndDestroy(iter); + + // Test iterator created with template helper + iter = AiUtility::CreateContentItemArrayIteratorL(KTwoItems); + CleanupReleasePushL(iter); + DoTestManyL( KTwoItems[0], *iter, 2 ); + DoTestManyL( KTwoItems[1], *iter, 2 ); + CleanupStack::PopAndDestroy(iter); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + MT_AiContentItemArrayIterator, + "Unit test suite for MAiContentItemIterator implementation returned from AiUtility::CreateContentItemArrayIteratorL", + "CAiContentItemArrayIterator" ) + +EUNIT_TEST( + "Test empty (NULL) array", + "MAiContentItemIterator", + "All", + "FUNCTIONALITY", + SetupL, TestEmptyL, Teardown) + +EUNIT_TEST( + "Test array with one item", + "MAiContentItemIterator", + "All", + "FUNCTIONALITY", + SetupL, TestOneL, Teardown) + +EUNIT_TEST( + "Test array with multiple items", + "MAiContentItemIteratore", + "All", + "FUNCTIONALITY", + SetupL, TestManyL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiContentItemArrayIterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiContentItemArrayIterator.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MT_AiContentItemArrayIterator_H__ +#define __MT_AiContentItemArrayIterator_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS + + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( MT_AiContentItemArrayIterator ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_AiContentItemArrayIterator* NewL(); + static MT_AiContentItemArrayIterator* NewLC(); + /** + * Destructor + */ + ~MT_AiContentItemArrayIterator(); + + private: // Constructors and destructors + + MT_AiContentItemArrayIterator(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void TestEmptyL(); + void TestOneL(); + void TestManyL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __MT_AiContentItemArrayIterator_H__ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiPSPropertyObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiPSPropertyObserver.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS UNDER TEST +#include "caouserafter.h" +#include +#include "caipspropertyobserver.h" + +#include "MT_AiPSPropertyObserver.h" +#include + +const TInt KRandTestUid( 0x017000F5 ); +const TInt KRandTestKey( 0x000000FF ); + +void ChangeKeyValueL( TInt aValue ) + { + RProperty::Define( TUid::Uid( KRandTestUid ), + KRandTestKey, + RProperty::EInt ); + + User::LeaveIfError( + RProperty::Set( TUid::Uid( KRandTestUid ), + KRandTestKey, + aValue ) ); + + } + + +// CONSTRUCTION +MT_AiPSPropertyObserver* MT_AiPSPropertyObserver::NewL() + { + MT_AiPSPropertyObserver* self = MT_AiPSPropertyObserver::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +MT_AiPSPropertyObserver* MT_AiPSPropertyObserver::NewLC() + { + MT_AiPSPropertyObserver* self = new( ELeave ) MT_AiPSPropertyObserver(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +MT_AiPSPropertyObserver::~MT_AiPSPropertyObserver() + { +#if _BullseyeCoverage + cov_write(); +#endif + } + +// Default constructor +MT_AiPSPropertyObserver::MT_AiPSPropertyObserver() + { + } + +// Second phase construct +void MT_AiPSPropertyObserver::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + + ChangeKeyValueL( 5 ); + CAOUserAfter::AfterLD( 2 * 1000000 ); + } + +// METHODS + +TInt MT_AiPSPropertyObserver::HandleSystemStateChangedL(TAny* aPtr) + { + MT_AiPSPropertyObserver* self = + static_cast( aPtr ); + TInt value = 0; + + self->iPSObserver->Get(value); + + if ( value == 10 ) + { + self->iStateOk = ETrue; + } + + return KErrNone; + } + +void MT_AiPSPropertyObserver::SetupL( ) + { + iPSObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleSystemStateChangedL, this ), + TUid::Uid( KRandTestUid ), + KRandTestKey ); + } + +void MT_AiPSPropertyObserver::Teardown( ) + { + Release( iPSObserver ); + } + +void MT_AiPSPropertyObserver::TestBasicFunctionalityL( ) + { + MAiPSPropertyObserver* obs = NULL; + // Test that Release(NULL) does not crash + Release(obs); + + // test + ChangeKeyValueL( 10 ); + CAOUserAfter::AfterLD( 2 * 1000000 ); + if( iStateOk ) + { + EUNIT_ASSERT( ETrue ); + return; + } + EUNIT_ASSERT( EFalse ); + } + +void MT_AiPSPropertyObserver::TestGettersL( ) + { + TInt err = KErrNone; + TBuf16<100> buf16; + TBuf8<100> buf8; + TInt value = 0; + err = iPSObserver->Get(buf16); + + EUNIT_ASSERT( err != KErrNone ); + + err = KErrNone; + err = iPSObserver->Get(buf8); + + EUNIT_ASSERT( err != KErrNone ); + + err = iPSObserver->Get(value); + + EUNIT_ASSERT( err == KErrNone ); + EUNIT_ASSERT( value == 5 || value == 10 ); + } + +void MT_AiPSPropertyObserver::TestDoCancelL( ) + { + iStateOk = EFalse; + ChangeKeyValueL( 10 ); + Release(iPSObserver); + iPSObserver = NULL; + CAOUserAfter::AfterLD( 2 * 1000000 ); + if( !iStateOk ) // make sure that the change was cancelled + { + EUNIT_ASSERT( ETrue ); + return; + } + EUNIT_ASSERT( EFalse ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + MT_AiPSPropertyObserver, + "Unit test suite for MAiContentItemIterator implementation returned from AiUtility::CreateContentItemArrayIteratorL", + "CAiContentItemArrayIterator" ) + +EUNIT_TEST( + "Test one", + "MAiContentItemIterator", + "All", + "FUNCTIONALITY", + SetupL, TestBasicFunctionalityL, Teardown) + +EUNIT_TEST( + "Test one", + "MAiContentItemIterator", + "All", + "FUNCTIONALITY", + SetupL, TestGettersL, Teardown) + +EUNIT_TEST( + "Test one", + "MAiContentItemIterator", + "All", + "FUNCTIONALITY", + SetupL, TestDoCancelL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiPSPropertyObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiPSPropertyObserver.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MT_AiPSPropertyObserver_H__ +#define __MT_AiPSPropertyObserver_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +class MAiPSPropertyObserver; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( MT_AiPSPropertyObserver ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_AiPSPropertyObserver* NewL(); + static MT_AiPSPropertyObserver* NewLC(); + /** + * Destructor + */ + ~MT_AiPSPropertyObserver(); + + private: // Constructors and destructors + + MT_AiPSPropertyObserver(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void TestBasicFunctionalityL(); + + void TestGettersL(); + + void TestDoCancelL(); + + static TInt HandleSystemStateChangedL(TAny* aPtr); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + MAiPSPropertyObserver* iPSObserver; + + TBool iStateOk; + + + }; + +#endif // __MT_AiPSPropertyObserver_H__ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiStrParser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiStrParser.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,352 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_AiStrParser.h" + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include + +// CONSTANTS +namespace + { + _LIT( KUnicode, "Text with unicode characters ä and \x20AC" ); + _LIT8( KUtf8, "Text" ); + } + +_LIT16( KHexPrefix16, "0x" ); + +TInt ParseInt + ( TInt32& aValue, const TDesC16& aStringValue ) + { + const TInt pos = aStringValue.FindF( KHexPrefix16 ); + if (pos != KErrNotFound) + { + TLex16 lex( aStringValue.Mid( pos + KHexPrefix16().Length() ) ); + // Hex parsing needs unsigned int + TUint32 value = 0; + const TInt parseResult = lex.Val( value, EHex ); + if ( parseResult == KErrNone ) + { + aValue = value; + } + return parseResult; + } + else + { + TLex16 lex( aStringValue ); + return lex.Val(aValue); + } + } + + +// CONSTRUCTION +MT_AiStrParser* MT_AiStrParser::NewL() + { + MT_AiStrParser* self = MT_AiStrParser::NewLC(); + CleanupStack::Pop(); + + return self; + } + +MT_AiStrParser* MT_AiStrParser::NewLC() + { + MT_AiStrParser* self = new( ELeave ) MT_AiStrParser(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +MT_AiStrParser::~MT_AiStrParser() + { + } + +// Default constructor +MT_AiStrParser::MT_AiStrParser() + { + } + +// Second phase construct +void MT_AiStrParser::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + +void MT_AiStrParser::SetupL() + { + iStrParser = AiUtility::CreateStrParserL(); + } + +void MT_AiStrParser::SetupUtf8BufferL() + { + iStrParser = AiUtility::CreateStrParserL(); + iUtf8Buffer = HBufC8::NewL(0); + } + +void MT_AiStrParser::SetupUnicodeBufferL() + { + iStrParser = AiUtility::CreateStrParserL(); + iUtf8Buffer = HBufC8::NewL(0); + } + +void MT_AiStrParser::SetupHexIntL() + { + iStrParser = AiUtility::CreateStrParserL(); + _LIT8( KTestValue, "0xbad" ); + iUtf8Buffer = KTestValue().AllocL(); + iTestValue = 0xbad; + iTestResult = KErrNone; + } + +void MT_AiStrParser::SetupHexIntUnicodeL() + { + iStrParser = AiUtility::CreateStrParserL(); + _LIT( KTestValue, "0xbad" ); + iUnicodeBuffer = KTestValue().AllocL(); + iTestValue = 0xbad; + iTestResult = KErrNone; + } + +void MT_AiStrParser::SetupIntL() + { + iStrParser = AiUtility::CreateStrParserL(); + _LIT8( KTestValue, "42" ); + iUtf8Buffer = KTestValue().AllocL(); + iTestValue = 42; + iTestResult = KErrNone; + } + +void MT_AiStrParser::SetupIntUnicodeL() + { + iStrParser = AiUtility::CreateStrParserL(); + _LIT( KTestValue, "42" ); + iUnicodeBuffer = KTestValue().AllocL(); + iTestValue = 42; + iTestResult = KErrNone; + } + +void MT_AiStrParser::SetupNoIntL() + { + SetupUtf8BufferL(); + iTestResult = KErrGeneral; + } + +void MT_AiStrParser::SetupNoIntUnicodeL() + { + iStrParser = AiUtility::CreateStrParserL(); + iUnicodeBuffer = HBufC::NewL(0); + iTestResult = KErrGeneral; + } + +void MT_AiStrParser::Teardown( ) + { + delete iUnicodeBuffer; + iUnicodeBuffer = NULL; + + delete iUtf8Buffer; + iUtf8Buffer = NULL; + + Release( iStrParser ); + } + +void MT_AiStrParser::TestCopyUnicodeToUnicodeL() + { + iUnicodeBuffer = iStrParser->CopyToBufferL(iUnicodeBuffer, KUnicode ); + + EUNIT_ASSERT( *iUnicodeBuffer == KUnicode ); + } + +void MT_AiStrParser::TestCopyUnicodeToUtf8L() + { + iUtf8Buffer = iStrParser->CopyToBufferL( iUtf8Buffer, KUnicode ); + + HBufC8* reference = CnvUtfConverter::ConvertFromUnicodeToUtf8L( KUnicode ); + + EUNIT_ASSERT_EQUALS( *iUtf8Buffer, *reference ); + + delete reference; + } + +void MT_AiStrParser::TestCopyUtf8ToUnicodeL() + { + iUnicodeBuffer = iStrParser->CopyToBufferL( iUnicodeBuffer, KUtf8 ); + + HBufC* reference = CnvUtfConverter::ConvertToUnicodeFromUtf8L( KUtf8 ); + + EUNIT_ASSERT_EQUALS( *iUnicodeBuffer, *reference ); + + delete reference; + } + +void MT_AiStrParser::TestCopyUtf8ToUtf8L() + { + iUtf8Buffer = iStrParser->CopyToBufferL( iUtf8Buffer, KUtf8 ); + + EUNIT_ASSERT_EQUALS( *iUtf8Buffer, KUtf8 ); + } + +void MT_AiStrParser::TestParseInt() + { + TInt32 value(0); + + TInt result = iStrParser->ParseInt( value, *iUtf8Buffer ); + + EUNIT_ASSERT_EQUALS( result, iTestResult ); + + if ( result == KErrNone ) + { + EUNIT_ASSERT_EQUALS( value, iTestValue ); + } + } + +void MT_AiStrParser::TestParseIntUnicode() + { + TInt32 value(0); + + TInt result = ParseInt( value, *iUnicodeBuffer ); + + EUNIT_ASSERT_EQUALS( result, iTestResult ); + + if ( result == KErrNone ) + { + EUNIT_ASSERT_EQUALS( value, iTestValue ); + } + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + MT_AiStrParser, + "Unit test suite for class XmlUiController utility functions", + "UNIT" ) + +EUNIT_TEST( + "Copy unicode to unicode, no buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC16*, const TDesC16& )", + "FUNCTIONALITY", + SetupL, TestCopyUnicodeToUnicodeL, Teardown) + +EUNIT_TEST( + "Copy unicode to unicode, reallocate buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC16*, const TDesC16& )", + "FUNCTIONALITY", + SetupUnicodeBufferL, TestCopyUnicodeToUnicodeL, Teardown) + +EUNIT_TEST( + "Copy UTF8 to unicode, no buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC16*, const TDesC8& )", + "FUNCTIONALITY", + SetupL, TestCopyUtf8ToUnicodeL, Teardown) + + +EUNIT_TEST( + "Copy UTF8 to unicode, reallocate buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC16*, const TDesC8& )", + "FUNCTIONALITY", + SetupUnicodeBufferL, TestCopyUtf8ToUnicodeL, Teardown) + +EUNIT_TEST( + "Copy unicode to UTF8, no buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC8*, const TDesC16& )", + "FUNCTIONALITY", + SetupL, TestCopyUnicodeToUtf8L, Teardown) + +EUNIT_TEST( + "Copy unicode to UTF8, reallocate buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC8*, const TDesC16& )", + "FUNCTIONALITY", + SetupUtf8BufferL, TestCopyUnicodeToUtf8L, Teardown) + +EUNIT_TEST( + "Copy UTF8 to UTF8, no buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC8*, const TDesC8& )", + "FUNCTIONALITY", + SetupL, TestCopyUtf8ToUtf8L, Teardown) + +EUNIT_TEST( + "Copy UTF8 to UTF8, reallocate buffer", + "AiXmlUiController", + "CopyToBufferL( HBufC8*, const TDesC8& )", + "FUNCTIONALITY", + SetupUtf8BufferL, TestCopyUtf8ToUtf8L, Teardown) + +EUNIT_TEST( + "Parse hex integer", + "AiXmlUiController", + "ParseInt", + "FUNCTIONALITY", + SetupHexIntL, TestParseInt, Teardown) + +EUNIT_TEST( + "Parse decimal integer", + "AiXmlUiController", + "ParseInt", + "FUNCTIONALITY", + SetupIntL, TestParseInt, Teardown) + +EUNIT_TEST( + "Parse invalid buffer", + "AiXmlUiController", + "ParseInt", + "ERROR HANDLING", + SetupNoIntL, TestParseInt, Teardown) + +EUNIT_TEST( + "Parse UNICODE hex integer", + "AiXmlUiController", + "ParseInt", + "FUNCTIONALITY", + SetupHexIntUnicodeL, TestParseIntUnicode, Teardown) + +EUNIT_TEST( + "Parse UNICODE decimal integer", + "AiXmlUiController", + "ParseInt", + "FUNCTIONALITY", + SetupIntUnicodeL, TestParseIntUnicode, Teardown) + +EUNIT_TEST( + "Parse UNICODE invalid buffer", + "AiXmlUiController", + "ParseInt", + "ERROR HANDLING", + SetupNoIntUnicodeL, TestParseIntUnicode, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiStrParser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiStrParser.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef MT_AiStrParser_H +#define MT_AiStrParser_H + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +class MAiStrParser; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( MT_AiStrParser ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_AiStrParser* NewL(); + static MT_AiStrParser* NewLC(); + /** + * Destructor + */ + ~MT_AiStrParser(); + + private: // Constructors and destructors + + MT_AiStrParser(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void SetupUtf8BufferL(); + + void SetupUnicodeBufferL(); + + void SetupHexIntL(); + + void SetupIntL(); + + void SetupNoIntL(); + + void SetupHexIntUnicodeL(); + + void SetupIntUnicodeL(); + + void SetupNoIntUnicodeL(); + + void Teardown(); + + void TestCopyUnicodeToUnicodeL(); + + void TestCopyUnicodeToUtf8L(); + + void TestCopyUtf8ToUnicodeL(); + + void TestCopyUtf8ToUtf8L(); + + void TestParseInt(); + + void TestParseIntUnicode(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + HBufC* iUnicodeBuffer; + + HBufC8* iUtf8Buffer; + + TInt iTestResult; + + TInt32 iTestValue; + + MAiStrParser* iStrParser; + }; + +#endif // __UT_ActiveTransactionStack_H__ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_AiUtilsDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_AiUtilsDllMain.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_AiContentItemArrayIterator.h" +#include "MT_AiPSPropertyObserver.h" +#include "MT_ContentPriorityMap.h" +#include "MT_AiStrParser.h" + +// EXTERNAL INCLUDES +#include + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + _LIT(KMainSuiteName, "MT_AiUtils"); + CEUnitTestSuite* mainSuite = CEUnitTestSuite::NewLC(KMainSuiteName); + + MEUnitTest* subSuite = MT_AiContentItemArrayIterator::NewLC(); + mainSuite->AddL(subSuite); + CleanupStack::Pop(); // subSuite + + subSuite = MT_AiPSPropertyObserver::NewLC(); + mainSuite->AddL(subSuite); + CleanupStack::Pop(); // subSuite + + subSuite = MT_ContentPriorityMap::NewLC(); + mainSuite->AddL(subSuite); + CleanupStack::Pop(); // subSuite + + subSuite = MT_AiStrParser::NewLC(); + mainSuite->AddL(subSuite); + CleanupStack::Pop(); // subSuite + + CleanupStack::Pop(mainSuite); + return mainSuite; + } + + + +// END OF FILE + + + + + + diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_ContentPriorityMap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_ContentPriorityMap.cpp Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS UNDER TEST +#include "contentprioritymap.h" + +#include "MT_ContentPriorityMap.h" +#include + +using namespace AiUtility; + +namespace + { + _LIT8( KTestId, "TestElementId" ); + + const TInt KDefaultPriority( 0 ); + + const TInt KHighPriority( 1 ); + } + + +// CONSTRUCTION +MT_ContentPriorityMap* MT_ContentPriorityMap::NewL() + { + MT_ContentPriorityMap* self = MT_ContentPriorityMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +MT_ContentPriorityMap* MT_ContentPriorityMap::NewLC() + { + MT_ContentPriorityMap* self = new( ELeave ) MT_ContentPriorityMap(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +MT_ContentPriorityMap::~MT_ContentPriorityMap() + { +#if _BullseyeCoverage + cov_write(); +#endif + } + +// Default constructor +MT_ContentPriorityMap::MT_ContentPriorityMap() + { + } + +// Second phase construct +void MT_ContentPriorityMap::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void MT_ContentPriorityMap::SetupL( ) + { + iContentPriorityMap = CContentPriorityMap::NewL(); + } + +void MT_ContentPriorityMap::Teardown( ) + { + delete iContentPriorityMap; + iContentPriorityMap = NULL; + } + +void MT_ContentPriorityMap::TestEmptyMapL( ) + { + // Test that map is empty + EUNIT_ASSERT_EQUALS( iContentPriorityMap->CurrentPriority( KTestId ), + KErrNotFound ); + + // Test initial value setting + EUNIT_ASSERT_EQUALS( iContentPriorityMap->SetCurrentPriority( KTestId, KDefaultPriority ), + KErrNone ); + + // Test current priority + EUNIT_ASSERT_EQUALS( iContentPriorityMap->CurrentPriority( KTestId ), + KDefaultPriority ); + + } + +void MT_ContentPriorityMap::TestClearL( ) + { + // Clear empty map (for coverage ) + iContentPriorityMap->ClearPriority( KTestId ); // + + // Set default priority + EUNIT_ASSERT_EQUALS( iContentPriorityMap->SetCurrentPriority( KTestId, KDefaultPriority ), + KErrNone ); + + // Clear priority + iContentPriorityMap->ClearPriority( KTestId ); + + // Test that priority is cleared + EUNIT_ASSERT_EQUALS( iContentPriorityMap->CurrentPriority( KTestId ), + KErrNotFound ); + } + +void MT_ContentPriorityMap::TestUpdateL( ) + { + // Set default priority + EUNIT_ASSERT_EQUALS( iContentPriorityMap->SetCurrentPriority( KTestId, KDefaultPriority ), + KErrNone ); + + // Update priority + EUNIT_ASSERT_EQUALS( iContentPriorityMap->SetCurrentPriority( KTestId, KHighPriority ), + KErrNone ); + + // Test updated priority + EUNIT_ASSERT_EQUALS( iContentPriorityMap->CurrentPriority( KTestId ), + KHighPriority ); + } + +void MT_ContentPriorityMap::TestOverrideL() + { + // Test empty map + EUNIT_ASSERT( iContentPriorityMap->OverrideContent( KTestId, KDefaultPriority ) ); + + // Set default + EUNIT_ASSERT_EQUALS( iContentPriorityMap->SetCurrentPriority( KTestId, KDefaultPriority ), + KErrNone ); + + // Test again with default priority + EUNIT_ASSERT( iContentPriorityMap->OverrideContent( KTestId, KDefaultPriority ) ); + + // Test high priority + EUNIT_ASSERT( iContentPriorityMap->OverrideContent( KTestId, KHighPriority ) ); + + // Set high priority + EUNIT_ASSERT_EQUALS( iContentPriorityMap->SetCurrentPriority( KTestId, KHighPriority ), + KErrNone ); + + // Test default priority + EUNIT_ASSERT( !iContentPriorityMap->OverrideContent( KTestId, KDefaultPriority ) ); + + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + MT_ContentPriorityMap, + "Unit test suite for AiUtility::CContentPriorityMap", + "AiUtility::CContentPriorityMap" ) + +EUNIT_TEST( + "Test empty map", + "AiUtility::CContentPriorityMap", + "CurrentPriority, SetCurrentPriority", + "FUNCTIONALITY", + SetupL, TestEmptyMapL, Teardown) + +EUNIT_TEST( + "Test clear functionality", + "AiUtility::CContentPriorityMap", + "All", + "FUNCTIONALITY", + SetupL, TestClearL, Teardown) + +EUNIT_TEST( + "Test update functionality", + "AiUtility::CContentPriorityMap", + "All", + "FUNCTIONALITY", + SetupL, TestUpdateL, Teardown) + +EUNIT_TEST( + "Test override functionality", + "AiUtility::CContentPriorityMap", + "OverrideContent, SetCurrentPriority", + "FUNCTIONALITY", + SetupL, TestOverrideL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 9e077f9a342c -r 2c7f27287390 idlefw/tsrc/utility/mt_aiutils/MT_ContentPriorityMap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/tsrc/utility/mt_aiutils/MT_ContentPriorityMap.h Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MT_ContentPriorityMap_H__ +#define __MT_ContentPriorityMap_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +namespace AiUtility + { +class CContentPriorityMap; + } + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( MT_ContentPriorityMap ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_ContentPriorityMap* NewL(); + static MT_ContentPriorityMap* NewLC(); + /** + * Destructor + */ + ~MT_ContentPriorityMap(); + + private: // Constructors and destructors + + MT_ContentPriorityMap(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void TestEmptyMapL(); + + void TestClearL(); + + void TestUpdateL(); + + void TestOverrideL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + AiUtility::CContentPriorityMap* iContentPriorityMap; + + }; + +#endif // __MT_ContentPriorityMap_H__ + +// End of file diff -r 9e077f9a342c -r 2c7f27287390 layers.sysdef.xml --- a/layers.sysdef.xml Mon Jun 21 16:00:38 2010 +0300 +++ b/layers.sysdef.xml Thu Jul 15 18:59:18 2010 +0300 @@ -11,7 +11,6 @@ - @@ -25,7 +24,6 @@ - diff -r 9e077f9a342c -r 2c7f27287390 tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/group/bld.inf Thu Jul 15 18:59:18 2010 +0300 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: homescreensrv main bld.inf file for module tests +* +*/ + + +#include "../../idlefw/tsrc/group/bld.inf"