videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
equal deleted inserted replaced
34:bbb98528c666 35:3738fe97f027
   224         ENTRY( "CreateAlbum", CVCXMyVideosCollectionPluginTest::CreateAlbumL ),
   224         ENTRY( "CreateAlbum", CVCXMyVideosCollectionPluginTest::CreateAlbumL ),
   225         ENTRY( "DeleteAlbums", CVCXMyVideosCollectionPluginTest::DeleteAlbumsL ),
   225         ENTRY( "DeleteAlbums", CVCXMyVideosCollectionPluginTest::DeleteAlbumsL ),
   226         ENTRY( "DeleteAllAlbums", CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL ),
   226         ENTRY( "DeleteAllAlbums", CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL ),
   227         ENTRY( "AddMediasToAlbum", CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL ),
   227         ENTRY( "AddMediasToAlbum", CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL ),
   228         ENTRY( "RemoveMediasFromAlbum", CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL ),
   228         ENTRY( "RemoveMediasFromAlbum", CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL ),
   229         ENTRY( "CheckAlbumCount", CVCXMyVideosCollectionPluginTest::CheckAlbumCount ),
   229         ENTRY( "RenameAlbum", CVCXMyVideosCollectionPluginTest::RenameAlbumL ),
       
   230         ENTRY( "CheckAlbumExists", CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL ),
   230         
   231         
   231         ENTRY( "CreateVideoFile", CVCXMyVideosCollectionPluginTest::CreateVideoFileL ),
   232         ENTRY( "CreateVideoFile", CVCXMyVideosCollectionPluginTest::CreateVideoFileL ),
   232         ENTRY( "CreateVideoFileNoWait", CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ),
   233         ENTRY( "CreateVideoFileNoWait", CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ),
   233         ENTRY( "EnsureDriveForVideos", CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL ),
   234         ENTRY( "EnsureDriveForVideos", CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL ),
   234         ENTRY( "EmptySideloadFolders", CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL ),
   235         ENTRY( "EmptySideloadFolders", CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL ),
  1401 
  1402 
  1402     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaDetailL <----------");
  1403     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaDetailL <----------");
  1403     return err;
  1404     return err;
  1404     }
  1405     }
  1405 
  1406 
  1406 
       
  1407 // -----------------------------------------------------------------------------
  1407 // -----------------------------------------------------------------------------
  1408 // CVcxMyVideosApiTest::CheckAlbumCountL
  1408 // CVcxMyVideosApiTest::CheckAlbumCountL
  1409 // -----------------------------------------------------------------------------
  1409 // -----------------------------------------------------------------------------
  1410 //
  1410 //
  1411 TInt CVCXMyVideosCollectionPluginTest::CheckAlbumCountL( CStifItemParser& aItem )
  1411 TInt CVCXMyVideosCollectionPluginTest::CheckAlbumCountL( CStifItemParser& aItem )
  1412     {
  1412     {
  1413 
       
  1414     VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckAlbumCountL ---------->");
  1413     VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckAlbumCountL ---------->");
  1415     // Print to UI
  1414     // Print to UI
  1416     _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
  1415     _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
  1417     _LIT( KWhere, "In CheckAlbumCountL" );
  1416     _LIT( KWhere, "In CheckAlbumCountL" );
  1418     TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
  1417     TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
  2618 
  2617 
  2619     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL <----------");
  2618     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL <----------");
  2620     return err;
  2619     return err;
  2621     }
  2620     }
  2622 
  2621 
  2623 
       
  2624 // -----------------------------------------------------------------------------
  2622 // -----------------------------------------------------------------------------
  2625 // CVcxMyVideosApiTest::AddMediasToAlbumL
  2623 // CVcxMyVideosApiTest::AddMediasToAlbumL
  2626 // -----------------------------------------------------------------------------
  2624 // -----------------------------------------------------------------------------
  2627 //
  2625 //
  2628 TInt CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL( CStifItemParser& aItem )
  2626 TInt CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL( CStifItemParser& aItem )
  2702     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL <----------");
  2700     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL <----------");
  2703     return err;
  2701     return err;
  2704     }
  2702     }
  2705 
  2703 
  2706 // -----------------------------------------------------------------------------
  2704 // -----------------------------------------------------------------------------
  2707 // CVcxMyVideosApiTest::CheckAlbumCount
  2705 // CVcxMyVideosApiTest::RenameAlbumL
  2708 // -----------------------------------------------------------------------------
  2706 // -----------------------------------------------------------------------------
  2709 //
  2707 //
  2710 TInt CVCXMyVideosCollectionPluginTest::CheckAlbumCount( CStifItemParser& aItem )
  2708 TInt CVCXMyVideosCollectionPluginTest::RenameAlbumL( CStifItemParser& aItem )
  2711     {
  2709     {
  2712     VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateAlbumL ---------->");
  2710     VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RenameAlbumL ---------->");
  2713     // Print to UI
  2711     // Print to UI
  2714     _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
  2712     _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
  2715     _LIT( KWhere, "In CheckAlbumCount" );
  2713     _LIT( KWhere, "In RenameAlbumL" );
  2716     TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
  2714     TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
  2717     // Print to log file
  2715     // Print to log file
  2718     iLog->Log( KWhere );
  2716     iLog->Log( KWhere );
       
  2717 
       
  2718     WaitForRefreshL( EFalse ); // Wait for possible refresh to finish.
  2719     
  2719     
  2720     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
  2720     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
  2721 
  2721 
  2722     TInt err( KErrNotReady );
  2722     int err( KErrNotReady );
  2723     
       
  2724     int expectedCount;
       
  2725     User::LeaveIfError( aItem.GetNextInt( expectedCount ) );
       
  2726     
  2723     
  2727     if( iTester )
  2724     if( iTester )
  2728         {
  2725         {
  2729         if( !iTester->CheckAlbumCount( expectedCount ) )
  2726         TPtrC albumName;
  2730             {
  2727         User::LeaveIfError( aItem.GetNextString( albumName ) );
  2731             err = KErrCorrupt;
  2728         
  2732             }
  2729         TPtrC newAlbumName;
  2733         }
  2730         User::LeaveIfError( aItem.GetNextString( newAlbumName ) );
  2734 
  2731 
  2735     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckAlbumCount <----------");
  2732         if( newAlbumName.Compare( KStifScript2KString ) == KErrNone )
       
  2733             {
       
  2734             TRAP( err, iTester->RenameAlbumL( albumName, KAbout2050CharsString ) );
       
  2735             }
       
  2736         else if( newAlbumName.Compare( KStifScriptEmptyString ) == KErrNone )
       
  2737             {
       
  2738             TRAP( err, iTester->RenameAlbumL( albumName, KVcxTestEmptyString ) );
       
  2739             }
       
  2740         else
       
  2741             {
       
  2742             TRAP( err, iTester->RenameAlbumL( albumName, newAlbumName ) );    
       
  2743             }
       
  2744         }
       
  2745   
       
  2746     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RenameAlbumL <----------");
       
  2747     return err;
       
  2748     }
       
  2749 
       
  2750 // -----------------------------------------------------------------------------
       
  2751 // CVcxMyVideosApiTest::CheckAlbumExistsL
       
  2752 // -----------------------------------------------------------------------------
       
  2753 //
       
  2754 TInt CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL( CStifItemParser& aItem )
       
  2755     {
       
  2756     VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL ---------->");
       
  2757     // Print to UI
       
  2758     _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" );
       
  2759     _LIT( KWhere, "In CheckAlbumExistsL" );
       
  2760     TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere );
       
  2761     // Print to log file
       
  2762     iLog->Log( KWhere );
       
  2763 
       
  2764     WaitForRefreshL( EFalse ); // Wait for possible refresh to finish.
       
  2765     
       
  2766     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
  2767 
       
  2768     int err( KErrNotReady );
       
  2769     
       
  2770     if( iTester )
       
  2771         {
       
  2772         TPtrC albumName;
       
  2773         User::LeaveIfError( aItem.GetNextString( albumName ) );
       
  2774         
       
  2775         TRAP( err, iTester->GetAlbumIdL(albumName) );
       
  2776         }
       
  2777   
       
  2778     VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL <----------");
  2736     return err;
  2779     return err;
  2737     }
  2780     }
  2738 
  2781 
  2739 // -----------------------------------------------------------------------------
  2782 // -----------------------------------------------------------------------------
  2740 // CVcxMyVideosApiTest::CreateVideoFileL
  2783 // CVcxMyVideosApiTest::CreateVideoFileL