homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp
branchRCL_3
changeset 14 15e4dd19031c
parent 12 502e5d91ad42
child 19 edd621764147
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
    45 #include "mt_hsps_getplugins_3.h"
    45 #include "mt_hsps_getplugins_3.h"
    46 #include "mt_hsps_getplugins_4.h"
    46 #include "mt_hsps_getplugins_4.h"
    47 #include "mt_hsps_getplugins_5.h"
    47 #include "mt_hsps_getplugins_5.h"
    48 #include "mt_hsps_getplugins_6.h"
    48 #include "mt_hsps_getplugins_6.h"
    49 #include "mt_hsps_getplugins_7.h"
    49 #include "mt_hsps_getplugins_7.h"
       
    50 #include "mt_hsps_getplugins_8.h"
    50 // get plugin list
    51 // get plugin list
    51 #include "mt_hsps_getpluginlist_1.h"
    52 #include "mt_hsps_getpluginlist_1.h"
    52 #include "mt_hsps_getpluginlist_2.h"
    53 #include "mt_hsps_getpluginlist_2.h"
    53 #include "mt_hsps_getpluginlist_3.h"
    54 #include "mt_hsps_getpluginlist_3.h"
    54 #include "mt_hsps_getpluginlist_4.h"
    55 #include "mt_hsps_getpluginlist_4.h"
   127 // Resource files copied by minimal configuration.
   128 // Resource files copied by minimal configuration.
   128 _LIT( KMinimalResourceFile1, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\main.xml"  );
   129 _LIT( KMinimalResourceFile1, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\main.xml"  );
   129 _LIT( KMinimalResourceFile2, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\viewnavigationrules.xml"  );
   130 _LIT( KMinimalResourceFile2, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\viewnavigationrules.xml"  );
   130 _LIT( KMinimalResourceFile3, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\resource.file"  );
   131 _LIT( KMinimalResourceFile3, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\resource.file"  );
   131 _LIT( KMinimalResourceFile4, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg"  );
   132 _LIT( KMinimalResourceFile4, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg"  );
       
   133 _LIT( KFinnishMifLogo, "c:\\private\\20000fb1\\2456\\270513751\\536916274\\1.0\\sources\\dummy.mif"  );
   132 
   134 
   133 // ======== LOCAL FUNCTIONS ====================================================
   135 // ======== LOCAL FUNCTIONS ====================================================
   134 
   136 
   135 // ======== MEMBER FUNCTIONS ===================================================
   137 // ======== MEMBER FUNCTIONS ===================================================
   136 
   138 
   814     RunTestStepSyncL(
   816     RunTestStepSyncL(
   815         ( TUint8* )getplugins_7_ts_1_method,
   817         ( TUint8* )getplugins_7_ts_1_method,
   816         ( TUint8* )getplugins_7_ts_1_input,
   818         ( TUint8* )getplugins_7_ts_1_input,
   817         ( TUint8* )getplugins_7_ts_1_output );
   819         ( TUint8* )getplugins_7_ts_1_output );
   818     EUNIT_PRINT( _L8( "Test step passed" ) );    
   820     EUNIT_PRINT( _L8( "Test step passed" ) );    
   819     }
   821     }    
   820 
   822     
       
   823 //------------------------------------------------------------------------------
       
   824 // Test case: GetPlugins(8)
       
   825 //------------------------------------------------------------------------------
       
   826 void MT_CHSPSConfigurationIf::GetPlugins_8_L()
       
   827     {
       
   828     // Pre conditions
       
   829     // Set active configuration to Minimal configuration
       
   830     EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) );
       
   831     SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator );
       
   832     // Attach to HSPS 
       
   833     EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) );
       
   834     AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid );
       
   835     
       
   836     // Test step 1: fetch widget plugins and copy logos files 
       
   837     EUNIT_PRINT( _L8( "Test step 1" ) );
       
   838     RunTestStepSyncL(
       
   839         ( TUint8* )getplugins_8_ts_1_method,
       
   840         ( TUint8* )getplugins_8_ts_1_input,
       
   841         ( TUint8* )getplugins_8_ts_1_output );
       
   842             
       
   843     EUNIT_PRINT( _L8( "post condition check for resource file copy" ) );
       
   844     ResetResources();
       
   845     // Check that the logo file was copied
       
   846     AddResourceL( KFinnishMifLogo, 4608 );
       
   847     CheckResourcesL();             
       
   848     EUNIT_PRINT( _L8( "post condition check for resource copy passed" ) );        
       
   849     
       
   850     EUNIT_PRINT( _L8( "Test step passed" ) );    
       
   851     }        
       
   852     
   821 //------------------------------------------------------------------------------
   853 //------------------------------------------------------------------------------
   822 // Test case: GetPluginList(1)
   854 // Test case: GetPluginList(1)
   823 //------------------------------------------------------------------------------
   855 //------------------------------------------------------------------------------
   824 void MT_CHSPSConfigurationIf::GetPluginList_1_L()
   856 void MT_CHSPSConfigurationIf::GetPluginList_1_L()
   825     {
   857     {
  2649         _L( "c:\\data\\mt_hsps\\installed_widget\\plugin_0998_101FB657_2000B133_1.0.dat" ),
  2681         _L( "c:\\data\\mt_hsps\\installed_widget\\plugin_0998_101FB657_2000B133_1.0.dat" ),
  2650         _L( "c:\\private\\200159c0\\import\\" ),
  2682         _L( "c:\\private\\200159c0\\import\\" ),
  2651         CFileMan::EOverWrite ) );
  2683         CFileMan::EOverWrite ) );
  2652             
  2684             
  2653     // Wait until configuration is installed
  2685     // Wait until configuration is installed
  2654     User::After( 5000000 );
  2686     User::After( 8000000 );
  2655     
  2687     
  2656     // Make sure "InstalledWidget" is installed
  2688     // Make sure "InstalledWidget" is installed
  2657     if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) )
  2689     if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) )
  2658         {
  2690         {
       
  2691         // Installation failed - remove imports to be able to re-run the test again
       
  2692         // The ChspsThemeServer::HandleConfigurationImportsL does handle newly
       
  2693         // added files only
       
  2694         User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) );
       
  2695         fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ),
       
  2696             0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp.
       
  2697         User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) );     
       
  2698         
       
  2699         // Leave - the test was not successfull
  2659         User::Leave( KErrGeneral );
  2700         User::Leave( KErrGeneral );
  2660         }
  2701         }
  2661     
  2702     
  2662     EUNIT_PRINT( _L8( "Test step passed" ) );
  2703     EUNIT_PRINT( _L8( "Test step passed" ) );
  2663         
  2704         
  2671                           KEntryAttReadOnly,
  2712                           KEntryAttReadOnly,
  2672                           TTime( 0 ) ); // TTime(0) = preserve original time stamp.
  2713                           TTime( 0 ) ); // TTime(0) = preserve original time stamp.
  2673     User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) );     
  2714     User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) );     
  2674     // Removing of *.dat file causes configuration uninstallation
  2715     // Removing of *.dat file causes configuration uninstallation
  2675     // Wait until configuration is uninstalled
  2716     // Wait until configuration is uninstalled
  2676     User::After( 5000000 );
  2717     User::After( 8000000 );
  2677 
  2718 
  2678     // Make sure "InstalledWidget" is uninstalled
  2719     // Make sure "InstalledWidget" is uninstalled
  2679     if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) )
  2720     if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) )
  2680         {
  2721         {
  2681         User::Leave( KErrGeneral );
  2722         User::Leave( KErrGeneral );
  3170         "GetPlugins",
  3211         "GetPlugins",
  3171         "FUNCTIONALITY",
  3212         "FUNCTIONALITY",
  3172         SetupL, GetPlugins_7_L, Teardown )
  3213         SetupL, GetPlugins_7_L, Teardown )
  3173 
  3214 
  3174     EUNIT_TEST(
  3215     EUNIT_TEST(
       
  3216         "GetPlugins(8)",
       
  3217         "IConfiguration",
       
  3218         "GetPlugins",
       
  3219         "FUNCTIONALITY",
       
  3220         SetupL, GetPlugins_8_L, Teardown )
       
  3221         
       
  3222     EUNIT_TEST(
  3175         "GetPluginList(1)",
  3223         "GetPluginList(1)",
  3176         "IConfiguration",
  3224         "IConfiguration",
  3177         "GetPluginList",
  3225         "GetPluginList",
  3178         "FUNCTIONALITY",
  3226         "FUNCTIONALITY",
  3179         SetupL, GetPluginList_1_L, Teardown )
  3227         SetupL, GetPluginList_1_L, Teardown )