contentmgmt/referencedrmagent/tcaf/source/RecognizerStep.cpp
changeset 15 da2ae96f639b
child 53 030c4fbc13d7
child 108 ca9a0fc2f082
equal deleted inserted replaced
10:afc583cfa176 15:da2ae96f639b
       
     1 /*
       
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * cafstep.cpp
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <test/testexecutelog.h>
       
    21 #include <apgcli.h>
       
    22 #include <apmstd.h>
       
    23 #include "cafserver.h"
       
    24 #include "resolver.h"
       
    25 #include "RecognizerStep.h"
       
    26 #include "CafApaRecognizer.h"
       
    27 
       
    28 using namespace ContentAccess;
       
    29 
       
    30 const TInt KCafTestMaxDataTypeLength = 255;
       
    31 const TInt KCAFTestApparcBufferSize = 100;
       
    32 
       
    33 /* 
       
    34  * This step starts the CAF Apparc recognizer and checks to see that it recognizes the
       
    35  * correct files
       
    36  *
       
    37  */
       
    38 
       
    39 CCAFRecognizeStep::~CCAFRecognizeStep()
       
    40 	{
       
    41 	}
       
    42 
       
    43 CCAFRecognizeStep::CCAFRecognizeStep(CCAFServer& aParent)
       
    44 : iParent(aParent)
       
    45 	{
       
    46 	SetTestStepName(KCAFRecognizeStep);
       
    47 	}
       
    48 
       
    49 /* Tests whether a file opened under the caf framework reports the same size as
       
    50  * RFile.  Only works for files that are owned by the f32agent which doesn't
       
    51  * change the content at all.
       
    52  */
       
    53 TVerdict CCAFRecognizeStep::doTestStepL()
       
    54 	{
       
    55 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
       
    56     TBool wmdrmFlag = EFalse;     
       
    57     GetBoolFromConfig(ConfigSection(),_L("wmdrmEnabled"), wmdrmFlag);     
       
    58          
       
    59     if(wmdrmFlag)
       
    60         {     
       
    61         TVerdict verdict = doWmdrmTestStepL();     
       
    62         return verdict;     
       
    63         }     
       
    64 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT    
       
    65 
       
    66 	TBuf8 <KCAFTestApparcBufferSize> buf;
       
    67 
       
    68 	CAgentResolver *resolver;
       
    69 	
       
    70 	// If we leave before our DoRecognize is complete, something must have gone seriously wrong
       
    71 	SetTestStepResult(EFail);
       
    72 
       
    73 	TBuf8 <KCafTestMaxDataTypeLength> ContainerMimeType;
       
    74 	TBuf8 <KCafTestMaxDataTypeLength> ContentMimeType;
       
    75 	TBool result;
       
    76 	
       
    77 	TPtrC fileName;
       
    78 	TBool expectedresult;
       
    79 	TPtrC expectedContainerMime, expectedContentMime;
       
    80 
       
    81 	// Retrieve filename to analyse and expected results from INI file
       
    82 	GetStringFromConfig(ConfigSection(),_L("FileName"),fileName);
       
    83 	GetStringFromConfig(ConfigSection(),_L("Container"),expectedContainerMime);
       
    84 	GetStringFromConfig(ConfigSection(),_L("Content"),expectedContentMime);
       
    85 	GetBoolFromConfig(ConfigSection(),_L("Recognized"),expectedresult);
       
    86 	
       
    87 	if(expectedresult)
       
    88 		{
       
    89 		INFO_PRINTF4(_L("DoRecognize Test DRM file: %S, Container Mime Type: %S, Content Mime Type: %S"),&fileName, &expectedContainerMime, &expectedContentMime);
       
    90 		}
       
    91 	else
       
    92 		{
       
    93 		INFO_PRINTF2(_L("DoRecognize Test non DRM file: %S"), &fileName);	
       
    94 		}
       
    95 
       
    96 	__UHEAP_MARK;
       
    97 
       
    98 	// Read the first KCAFTestApparcBufferSize bytes into the buffer in the same way apparc would do
       
    99 	ReadBufferL(fileName, buf);
       
   100 	
       
   101 	// Pass the filename and buffer to CAF DoRecognize function
       
   102 	resolver = CAgentResolver::NewLC(ETrue);
       
   103     	
       
   104 	result = resolver->DoRecognizeL(fileName, buf, ContainerMimeType, ContentMimeType);
       
   105 
       
   106 	CheckResultL(result, ContainerMimeType, ContentMimeType, expectedresult, expectedContainerMime, expectedContentMime);
       
   107 
       
   108 	CleanupStack::PopAndDestroy(resolver); 
       
   109 
       
   110 	__UHEAP_MARKEND;
       
   111 	return TestStepResult();
       
   112 	}
       
   113 
       
   114 void CCAFRecognizeStep::CheckResultL(TBool aResult, TDes8& aContainerMimeType, TDes8& aContentMimeType, TBool aExpectedResult, TDesC16& aExpectedContainerMime, TDesC16& aExpectedContentMime)
       
   115 	{
       
   116 	// start off by assuming recognition was ok, then check
       
   117 	SetTestStepResult(EPass);
       
   118 	
       
   119 	if(aResult != aExpectedResult)
       
   120 		{
       
   121 		if(aResult)
       
   122 			{
       
   123 			INFO_PRINTF1(_L("File was incorrectly recognized as DRM"));	
       
   124 			}
       
   125 		else
       
   126 			{
       
   127 			INFO_PRINTF1(_L("File was incorrectly recognized as not DRM"));	
       
   128 			}
       
   129 		SetTestStepResult(EFail);
       
   130 		return;
       
   131 		}
       
   132 
       
   133 	if(!aResult) // not a drm file so we don't care about the mime types
       
   134 		return;
       
   135 	
       
   136 	TInt compare;
       
   137 
       
   138 	// Convert TDes16 mime types read from the INI file to TPtr8's
       
   139 	HBufC8 *container = ConvertDes16toHBufC8LC(aExpectedContainerMime);
       
   140 	TPtr8 containerptr(container->Des());
       
   141 
       
   142 	HBufC8 *content = ConvertDes16toHBufC8LC(aExpectedContentMime);
       
   143 	TPtr8 contentptr(content->Des());
       
   144 
       
   145 	// Compare expected Mime Types vs mime type
       
   146 	compare = aContainerMimeType.Compare(containerptr);
       
   147 	if(compare != 0)
       
   148 		{
       
   149 		INFO_PRINTF1(_L("Incorrect Container Mime Type recognized"));	
       
   150 		SetTestStepResult(EFail);
       
   151 		}
       
   152 	compare = aContentMimeType.Compare(contentptr);
       
   153 	if(compare != 0)
       
   154 		{
       
   155 		INFO_PRINTF1(_L("Incorrect Content Mime Type recognized"));	
       
   156 		SetTestStepResult(EFail);
       
   157 		}
       
   158 	CleanupStack::PopAndDestroy(2, container);	
       
   159 	}
       
   160 
       
   161 
       
   162 /*
       
   163  * This step starts the CAF Apparc recognizer speed test
       
   164  * Does 1000 recognitions, log file will measure the time
       
   165  *
       
   166  */
       
   167 
       
   168 CCAFRecognizerSpeedStep::~CCAFRecognizerSpeedStep()
       
   169 	{
       
   170 	}
       
   171 
       
   172 CCAFRecognizerSpeedStep::CCAFRecognizerSpeedStep(CCAFServer& aParent) : iParent(aParent)
       
   173 	{
       
   174 	SetTestStepName(KCAFRecognizerSpeedStep);
       
   175 	}
       
   176 
       
   177 
       
   178 TVerdict CCAFRecognizerSpeedStep::doTestStepL()
       
   179 	{
       
   180 	TBuf8 <KCAFTestApparcBufferSize> buf;
       
   181 
       
   182 	CAgentResolver *resolver;
       
   183 	
       
   184 	// If we leave before our DoRecognize is complete, something must have gone seriously wrong
       
   185 	SetTestStepResult(EFail);
       
   186 
       
   187 	TBuf8 <KCafTestMaxDataTypeLength> ContainerMimeType;
       
   188 	TBuf8 <KCafTestMaxDataTypeLength> ContentMimeType;
       
   189 	
       
   190 	TPtrC fileName;
       
   191 	TBool expectedresult;
       
   192 	TPtrC expectedContainerMime, expectedContentMime;
       
   193 
       
   194 	// Retrieve filename to analyse and expected results from INI file
       
   195 	GetStringFromConfig(ConfigSection(),_L("FileName"),fileName);
       
   196 	GetStringFromConfig(ConfigSection(),_L("Container"),expectedContainerMime);
       
   197 	GetStringFromConfig(ConfigSection(),_L("Content"),expectedContentMime);
       
   198 	GetBoolFromConfig(ConfigSection(),_L("Recognized"),expectedresult);
       
   199 	
       
   200 	if(expectedresult)
       
   201 		{
       
   202 		INFO_PRINTF4(_L("DoRecognize Speed Test DRM file: %S, Container Mime Type: %S, Content Mime Type: %S"),&fileName, &expectedContainerMime, &expectedContentMime);
       
   203 		}
       
   204 	else
       
   205 		{
       
   206 		INFO_PRINTF2(_L("DoRecognize Speed Test non DRM file: %S"), &fileName);	
       
   207 		}
       
   208 
       
   209 	__UHEAP_MARK;
       
   210 
       
   211 	// Read the first KCAFTestApparcBufferSize bytes into the buffer in the same way apparc would do
       
   212 	ReadBufferL(fileName, buf);
       
   213 	
       
   214 	// Pass the filename and buffer to CAF DoRecognize function
       
   215 	resolver = CAgentResolver::NewLC(ETrue);
       
   216 
       
   217 	INFO_PRINTF1(_L("Entering measured mile"));	
       
   218 	
       
   219 	for(TInt Count=0; Count < 1000; Count++)
       
   220 		resolver->DoRecognizeL(fileName, buf, ContainerMimeType, ContentMimeType);
       
   221 	
       
   222 	INFO_PRINTF1(_L("passing mile marker   (1000 recognitions)"));	
       
   223 
       
   224     CleanupStack::PopAndDestroy(resolver); 
       
   225 
       
   226 	__UHEAP_MARKEND;
       
   227 	SetTestStepResult(EPass);
       
   228 	return TestStepResult();
       
   229 	}
       
   230 
       
   231 
       
   232 /* 
       
   233  * This step starts the CAF Apparc recognizer and checks to see that it recognizes the
       
   234  * correct files
       
   235  *
       
   236  */
       
   237 
       
   238 CCAFBufferSizeStep::~CCAFBufferSizeStep()
       
   239 	{
       
   240 	}
       
   241 
       
   242 CCAFBufferSizeStep::CCAFBufferSizeStep(CCAFServer& aParent) : iParent(aParent)
       
   243 	{
       
   244 	SetTestStepName(KCAFBufferSizeStep);
       
   245 	}
       
   246 
       
   247 
       
   248 /* Apparc uses a buffer to pass data from the start of the file into the apparc recognizer
       
   249 * to help it determine what mime type the file is.
       
   250 * In CAF this recognition task is actually handed over to the agents. Each one attempts to
       
   251 * recognize the file until one is successful or until all agents have rejected the file.
       
   252 * Each agent may have it's own preferred size for this buffer. This is configured in each
       
   253 * agent's RSS file, under the default_data tag.
       
   254 * CAgentResolver::PreferredBufferSize() will return the highest value returned by any agent.
       
   255 */
       
   256 TVerdict CCAFBufferSizeStep::doTestStepL()
       
   257 	{
       
   258 	CAgentResolver *resolver;
       
   259 	TInt expectedBufferSize;
       
   260 	TInt bufferSize=0;
       
   261 
       
   262 	SetTestStepResult(EFail);
       
   263 
       
   264 	
       
   265 	// Find the expected max buffer size from the INI file
       
   266 	GetIntFromConfig(ConfigSection(),_L("size"),expectedBufferSize);
       
   267 
       
   268 	INFO_PRINTF2(_L("Expected buffer size: %d"), expectedBufferSize);
       
   269 
       
   270 	__UHEAP_MARK;
       
   271 
       
   272 	
       
   273 	resolver = CAgentResolver::NewLC(ETrue);
       
   274 
       
   275 	bufferSize = resolver->PreferredBufferSize();
       
   276 
       
   277 	INFO_PRINTF2(_L("Caf Preferred buffer size: %d"), bufferSize);
       
   278 
       
   279 	if(bufferSize == expectedBufferSize)
       
   280 		{	
       
   281 		SetTestStepResult(EPass);
       
   282 		}	
       
   283     		
       
   284 	CleanupStack::PopAndDestroy(resolver); 
       
   285 
       
   286 	__UHEAP_MARKEND;
       
   287 	return TestStepResult();
       
   288 	}
       
   289 
       
   290 
       
   291 
       
   292 CCAFApparcStep::~CCAFApparcStep()
       
   293 	{
       
   294 	}
       
   295 
       
   296 CCAFApparcStep::CCAFApparcStep(CCAFServer& aParent) : iParent(aParent)
       
   297 	{
       
   298 	SetTestStepName(KCAFApparcStep);
       
   299 	}
       
   300 
       
   301 
       
   302 /*
       
   303  * This step loads the apparc recognizer and gives it a test run by 
       
   304  * pretending to be apparc
       
   305  * 
       
   306  */
       
   307 TVerdict CCAFApparcStep::doTestStepL()
       
   308 	{
       
   309 	TDataType dataType;
       
   310 	TDataType dataType2;
       
   311 	TDataType dataType3;
       
   312 	TDataType dataTypeNull(_L8(""));	
       
   313 	TPtrC8 mimeType(KNullDesC8);
       
   314 	HBufC16 *displayMime;
       
   315 	HBufC16 *displayMime2;
       
   316 	TPtrC fileName;
       
   317 	TPtrC uri;
       
   318 	TPtrC expectedMimeType;
       
   319 	TPtrC nullFileName(KNullDesC); 
       
   320 	TUid uid = KNullUid;
       
   321 	
       
   322 	SetTestStepResult(EInconclusive);
       
   323 
       
   324 	__UHEAP_MARK;
       
   325 
       
   326 	// Retrieve filename to analyse and expected results from INI file
       
   327 	GetStringFromConfig(ConfigSection(),_L("URI"),uri);
       
   328 	GetStringFromConfig(ConfigSection(),_L("FileName"),fileName);
       
   329 	GetStringFromConfig(ConfigSection(),_L("CafMimeType"),expectedMimeType);
       
   330 
       
   331 	// Use the Application Architecture Server to find the Mime type 
       
   332 	RApaLsSession apparcSession;
       
   333 	User::LeaveIfError(apparcSession.Connect());
       
   334 	CleanupClosePushL(apparcSession);
       
   335 	User::LeaveIfError(apparcSession.AppForDocument(fileName, uid, dataType));
       
   336 
       
   337 	RFile fileHandle;
       
   338 	fileHandle.Open(iParent.Fs(), uri, EFileRead);
       
   339 	User::LeaveIfError(apparcSession.AppForDocument(fileHandle, uid, dataType2));
       
   340 
       
   341 	// Pass in a null file name to make sure it doesn't panic 
       
   342 	User::LeaveIfError(apparcSession.AppForDocument(nullFileName, uid, dataType3));
       
   343 
       
   344 	CleanupStack::PopAndDestroy(&apparcSession);	// close
       
   345 
       
   346 
       
   347 	// check mime type of the file (fileName)
       
   348 	mimeType.Set(dataType.Des8());
       
   349 	displayMime = ConvertDes8toHBufC16LC(mimeType);
       
   350 	TPtr16 displayPtr(displayMime->Des());
       
   351 	if(displayPtr.Compare(expectedMimeType) != 0)
       
   352 		{
       
   353 		INFO_PRINTF2(_L("CAgentResolver returned a mime type of: %S"),&displayPtr);
       
   354 		INFO_PRINTF1(_L("Please make sure the configuration file RecCafMimeTypes.txt exists for RECCAF.DLL."));
       
   355 		SetTestStepResult(EFail);
       
   356 		}
       
   357 	else
       
   358 		INFO_PRINTF3(_L("File - CAgentResolver returned a mime type of: %S, matching the expected mime type of: %S"),&displayPtr, &expectedMimeType);
       
   359 	
       
   360 		
       
   361 	// check mime type of the file (fileHandle)
       
   362 	mimeType.Set(dataType2.Des8());
       
   363 	displayMime2 = ConvertDes8toHBufC16LC(mimeType);
       
   364 	TPtr16 displayPtr2(displayMime2->Des());
       
   365 	if(displayPtr2.Compare(expectedMimeType) != 0)
       
   366 		{
       
   367 		INFO_PRINTF2(_L("CAgentResolver returned a mime type of: %S"),&displayPtr2);
       
   368 		INFO_PRINTF1(_L("Please make sure the configuration file RecCafMimeTypes.txt exists for RECCAF.DLL."));
       
   369 		SetTestStepResult(EFail);
       
   370 		}	
       
   371 	else
       
   372 		INFO_PRINTF3(_L("FileHandle - CAgentResolver returned a mime type of: %S, matching the expected mime type of: %S"),&displayPtr2, &expectedMimeType);
       
   373 	
       
   374 	// Check the returned datatype is null, when a null filename is passed in  
       
   375 	if (dataType3 == dataTypeNull)
       
   376 		INFO_PRINTF1(_L("A null datatype is returned, when a null file name is passed in"));
       
   377 	else 
       
   378 		SetTestStepResult(EFail);
       
   379 	
       
   380 	CleanupStack::PopAndDestroy(displayMime2);		
       
   381 	CleanupStack::PopAndDestroy(displayMime);
       
   382 	
       
   383 	__UHEAP_MARKEND;
       
   384 	
       
   385 	if (TestStepResult() != EFail)
       
   386 		{
       
   387 		SetTestStepResult(EPass);
       
   388 		}
       
   389 	
       
   390 	return TestStepResult();
       
   391 	}
       
   392 
       
   393 /* 
       
   394  * This test verifies that upper case Mime types can be recognized.
       
   395  *
       
   396  * See DEF077443: Propagated:CAF should not be performing case sensitive comparisons on MIME types
       
   397  *
       
   398  */
       
   399 CCAF_DEF077443_Step::~CCAF_DEF077443_Step()
       
   400 	{
       
   401 	}
       
   402 
       
   403 CCAF_DEF077443_Step::CCAF_DEF077443_Step(CCAFServer& aParent) : iParent(aParent)
       
   404 	{
       
   405 	SetTestStepName(KCAF_DEF077443_Step);
       
   406 	}
       
   407 
       
   408 TVerdict CCAF_DEF077443_Step::doTestStepL()
       
   409 	{
       
   410 	TDataType dataType;
       
   411 	TDataType dataType2;
       
   412 	TPtrC8 mimeType(KNullDesC8);
       
   413 	HBufC16 *displayMime;
       
   414 	HBufC16 *displayMime2;
       
   415 	TPtrC upperCaseFileName;
       
   416 	TPtrC emptyFileName;
       
   417 	TPtrC expectedContentMimeType;
       
   418 	TPtrC expectedFileMimeType;
       
   419 	TUid uid = KNullUid;
       
   420 	
       
   421 	SetTestStepResult(EInconclusive);
       
   422 
       
   423 	__UHEAP_MARK;
       
   424 
       
   425 	// Retrieve filename to analyse and expected results from INI file.
       
   426 	// The CAF resolver forces mime types retrieved from agents to lower case.
       
   427 	// When recognising the file mime type and content mine type for a file the
       
   428 	// resolver passes the request to each agent. Its possible that the agent will
       
   429 	// not use lower case for the file mime type and content mime type. To be 
       
   430 	// consistent the resolver should set the returned data to lower case as well.
       
   431 	
       
   432 	// The test agent takes content mime type from the uppercasetest.drm file.
       
   433 	// For this case the content mime type is upper case (e.g. TEXT/PLAIN).
       
   434 	GetStringFromConfig(ConfigSection(),_L("FileName1"), upperCaseFileName);
       
   435 	GetStringFromConfig(ConfigSection(),_L("CafContentMimeType"), expectedContentMimeType);
       
   436 
       
   437 	// For a drm file with no recognised content the test agent sets the file mime type
       
   438 	// as APPLICATION/TESTAGENT.DRM.
       
   439 	// For this case the file emptytest.drm is used.
       
   440 	GetStringFromConfig(ConfigSection(),_L("FileName2"), emptyFileName);
       
   441 	GetStringFromConfig(ConfigSection(),_L("CafFileMimeType"), expectedFileMimeType);
       
   442 	
       
   443 	// create empty DRM file
       
   444 	RFs fs;
       
   445 	RFile file;
       
   446 
       
   447 	// remove first if exists
       
   448 	Delete(emptyFileName);
       
   449 
       
   450 	fs.Connect();
       
   451 	TInt result = file.Create(fs, emptyFileName, EFileWrite);
       
   452 	file.Close();
       
   453 	fs.Close(); 
       
   454 
       
   455 	// Use the Application Architecture Server to find the Content Mime type 
       
   456 	RApaLsSession apparcSession;
       
   457 	User::LeaveIfError(apparcSession.Connect());
       
   458 	CleanupClosePushL(apparcSession);
       
   459 	User::LeaveIfError(apparcSession.AppForDocument(upperCaseFileName, uid, dataType));
       
   460 
       
   461 	// Use the Application Architecture Server to find the File Mime type 
       
   462 	User::LeaveIfError(apparcSession.AppForDocument(emptyFileName, uid, dataType2));
       
   463 
       
   464 	CleanupStack::PopAndDestroy(&apparcSession);	// close
       
   465 
       
   466 	// remove empty file
       
   467 	Delete(emptyFileName);
       
   468 
       
   469 	// check content mime type
       
   470 	mimeType.Set(dataType.Des8());
       
   471 	displayMime = ConvertDes8toHBufC16LC(mimeType);
       
   472 	TPtr16 displayPtr(displayMime->Des());
       
   473 	if(displayPtr.Compare(expectedContentMimeType) != 0)
       
   474 		{
       
   475 		INFO_PRINTF2(_L("CAgentResolver returned a content mime type of: %S"),&displayPtr);
       
   476 		INFO_PRINTF1(_L("Please make sure the configuration file RecCafMimeTypes.txt exists for RECCAF.DLL."));
       
   477 		SetTestStepResult(EFail);
       
   478 		}
       
   479 	else
       
   480 		INFO_PRINTF3(_L("Content - CAgentResolver returned a mime type of: %S, matching the expected mime type of: %S"),&displayPtr, &expectedContentMimeType);
       
   481 	
       
   482 	// check file mime type
       
   483 	mimeType.Set(dataType2.Des8());
       
   484 	displayMime2 = ConvertDes8toHBufC16LC(mimeType);
       
   485 	TPtr16 displayPtr2(displayMime2->Des());
       
   486 	if(displayPtr2.Compare(expectedFileMimeType) != 0)
       
   487 		{
       
   488 		INFO_PRINTF2(_L("CAgentResolver returned a file mime type of: %S"),&displayPtr2);
       
   489 		INFO_PRINTF1(_L("Please make sure the configuration file RecCafMimeTypes.txt exists for RECCAF.DLL."));
       
   490 		SetTestStepResult(EFail);
       
   491 		}	
       
   492 	else
       
   493 		INFO_PRINTF3(_L("File - CAgentResolver returned a mime type of: %S, matching the expected mime type of: %S"),&displayPtr2, &expectedFileMimeType);
       
   494 
       
   495 	CleanupStack::PopAndDestroy(displayMime2);
       
   496 	CleanupStack::PopAndDestroy(displayMime);
       
   497 	
       
   498 	__UHEAP_MARKEND;
       
   499 	
       
   500 	if (TestStepResult() != EFail)
       
   501 		{
       
   502 		SetTestStepResult(EPass);
       
   503 		}
       
   504 	
       
   505 	return TestStepResult();
       
   506 	}
       
   507 	
       
   508 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
       
   509   
       
   510 // Tests DoRecognizeL API for WMDRM content .
       
   511       
       
   512 TVerdict CCAFRecognizeStep::doWmdrmTestStepL()     
       
   513     {     
       
   514     SetTestStepResult(EFail);     
       
   515          
       
   516     TPtrC expectedFileMimeType;     
       
   517     GetStringFromConfig(ConfigSection(),_L("filemime"), expectedFileMimeType);     
       
   518          
       
   519     TPtrC expectedContentMimeType;     
       
   520     GetStringFromConfig(ConfigSection(),_L("contentmime"), expectedContentMimeType);     
       
   521          
       
   522     TBool expectedResult;     
       
   523     GetBoolFromConfig(ConfigSection(),_L("recognized"), expectedResult);     
       
   524          
       
   525     __UHEAP_MARK;     
       
   526     TPtrC header;     
       
   527     HBufC8* headerData = NULL;     
       
   528          
       
   529     if(GetStringFromConfig(ConfigSection(),_L("header"), header))     
       
   530         {     
       
   531         headerData = ConvertDes16toHBufC8LC(header);     
       
   532         }     
       
   533     else     
       
   534         {     
       
   535         headerData = CreateWmdrmHeaderLC();      
       
   536         }     
       
   537       
       
   538     // Pass the WMDRM header data to CAF DoRecognize function     
       
   539     CAgentResolver* resolver = CAgentResolver::NewLC(ETrue);     
       
   540              
       
   541     TBuf8 <KCafTestMaxDataTypeLength> fileMimeType;     
       
   542     TBuf8 <KCafTestMaxDataTypeLength> contentMimeType;     
       
   543              
       
   544     TBool result = resolver->DoRecognizeL(*headerData, fileMimeType, contentMimeType);     
       
   545          
       
   546     CheckResultL(result, fileMimeType, contentMimeType, expectedResult, expectedFileMimeType, expectedContentMimeType);     
       
   547       
       
   548     CleanupStack::PopAndDestroy(2, headerData);      
       
   549       
       
   550     __UHEAP_MARKEND;     
       
   551     return TestStepResult();     
       
   552     }     
       
   553       
       
   554 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
       
   555