contentmgmt/referencedrmagent/tcaf/source/RecognizerStep.cpp
branchRCL_3
changeset 95 641f389e9157
parent 53 030c4fbc13d7
child 96 a71299154b21
--- a/contentmgmt/referencedrmagent/tcaf/source/RecognizerStep.cpp	Thu Aug 19 11:38:48 2010 +0300
+++ b/contentmgmt/referencedrmagent/tcaf/source/RecognizerStep.cpp	Tue Aug 31 17:00:08 2010 +0300
@@ -52,6 +52,17 @@
  */
 TVerdict CCAFRecognizeStep::doTestStepL()
 	{
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+    TBool wmdrmFlag = EFalse;     
+    GetBoolFromConfig(ConfigSection(),_L("wmdrmEnabled"), wmdrmFlag);     
+         
+    if(wmdrmFlag)
+        {     
+        TVerdict verdict = doWmdrmTestStepL();     
+        return verdict;     
+        }     
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT    
+
 	TBuf8 <KCAFTestApparcBufferSize> buf;
 
 	CAgentResolver *resolver;
@@ -494,5 +505,51 @@
 	return TestStepResult();
 	}
 	
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+  
+// Tests DoRecognizeL API for WMDRM content .
+      
+TVerdict CCAFRecognizeStep::doWmdrmTestStepL()     
+    {     
+    SetTestStepResult(EFail);     
+         
+    TPtrC expectedFileMimeType;     
+    GetStringFromConfig(ConfigSection(),_L("filemime"), expectedFileMimeType);     
+         
+    TPtrC expectedContentMimeType;     
+    GetStringFromConfig(ConfigSection(),_L("contentmime"), expectedContentMimeType);     
+         
+    TBool expectedResult;     
+    GetBoolFromConfig(ConfigSection(),_L("recognized"), expectedResult);     
+         
+    __UHEAP_MARK;     
+    TPtrC header;     
+    HBufC8* headerData = NULL;     
+         
+    if(GetStringFromConfig(ConfigSection(),_L("header"), header))     
+        {     
+        headerData = ConvertDes16toHBufC8LC(header);     
+        }     
+    else     
+        {     
+        headerData = CreateWmdrmHeaderLC();      
+        }     
+      
+    // Pass the WMDRM header data to CAF DoRecognize function     
+    CAgentResolver* resolver = CAgentResolver::NewLC(ETrue);     
+             
+    TBuf8 <KCafTestMaxDataTypeLength> fileMimeType;     
+    TBuf8 <KCafTestMaxDataTypeLength> contentMimeType;     
+             
+    TBool result = resolver->DoRecognizeL(*headerData, fileMimeType, contentMimeType);     
+         
+    CheckResultL(result, fileMimeType, contentMimeType, expectedResult, expectedFileMimeType, expectedContentMimeType);     
+      
+    CleanupStack::PopAndDestroy(2, headerData);      
+      
+    __UHEAP_MARKEND;     
+    return TestStepResult();     
+    }     
+      
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
 
-