diff -r d07aa956024a -r 030c4fbc13d7 contentmgmt/referencedrmagent/tcaf/source/Contentstep.cpp --- a/contentmgmt/referencedrmagent/tcaf/source/Contentstep.cpp Thu Apr 01 00:24:41 2010 +0300 +++ b/contentmgmt/referencedrmagent/tcaf/source/Contentstep.cpp Wed Apr 14 17:48:59 2010 +0300 @@ -47,17 +47,6 @@ TVerdict CCAFContentAttributeStep::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 - TInt attribute; TInt value = KErrNone; TInt expectedValue; @@ -125,17 +114,6 @@ TVerdict CCAFContentAttributeSetStep::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 - TInt value1; TInt value2; TInt expectedValue1; @@ -240,17 +218,6 @@ TVerdict CCAFContentStringAttributeStep::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 - TInt expectedResult; TInt attribute; TInt unresolvedUri = EFalse; @@ -339,17 +306,6 @@ TVerdict CCAFContentStringAttributeSetStep::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 - TPtrC expectedValue1; TPtrC expectedValue2; TBuf <200> value1; @@ -1034,238 +990,4 @@ return TestStepResult(); } -#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT - -// The following methods test the various content attribute APIs for WMDRM content. - -TVerdict CCAFContentAttributeStep::doWmdrmTestStepL() - { - SetTestStepResult(EFail); - - TInt attribVal; - GetIntFromConfig(ConfigSection(),_L("attribute"), attribVal); - - TInt expectedValue; - GetIntFromConfig(ConfigSection(),_L("value"), expectedValue); - -__UHEAP_MARK; - TPtrC header; - HBufC8* headerData = NULL; - - if(GetStringFromConfig(ConfigSection(),_L("header"), header)) - { - headerData = ConvertDes16toHBufC8LC(header); - } - else - { - headerData = CreateWmdrmHeaderLC(); - } - - CContent *content = CContent::NewLC(*headerData); - TInt value; - User::LeaveIfError(content->GetAttribute(attribVal, value)); - - if(expectedValue == value) - { - SetTestStepResult(EPass); - } - else - { - INFO_PRINTF3(_L("CContent::GetAttribute() Expected value: %d, actual value: %d"), expectedValue, value); - } - - CleanupStack::PopAndDestroy(2, headerData); -__UHEAP_MARKEND; - - return TestStepResult(); - } - - -TVerdict CCAFContentAttributeSetStep::doWmdrmTestStepL() - { - SetTestStepResult(EFail); - - TInt attribute1; - GetIntFromConfig(ConfigSection(),_L("attribute1"),attribute1); - - TInt attribute2; - GetIntFromConfig(ConfigSection(),_L("attribute2"),attribute2); - - TInt expectedValue1; - GetIntFromConfig(ConfigSection(),_L("value1"),expectedValue1); - - TInt expectedValue2; - GetIntFromConfig(ConfigSection(),_L("value2"),expectedValue2); - -__UHEAP_MARK; - - TPtrC header; - HBufC8* headerData = NULL; - - if(GetStringFromConfig(ConfigSection(),_L("header"), header)) - { - headerData = ConvertDes16toHBufC8LC(header); - } - else - { - headerData = CreateWmdrmHeaderLC(); - } - - CContent *content = CContent::NewLC(*headerData); - - RAttributeSet attributeSet; - CleanupClosePushL(attributeSet); - attributeSet.AddL(attribute1); - attributeSet.AddL(attribute2); - - TInt result = content->GetAttributeSet(attributeSet); - if(result == KErrNone) - { - TInt value1; - User::LeaveIfError(attributeSet.GetValue(attribute1, value1)); - - TInt value2; - User::LeaveIfError(attributeSet.GetValue(attribute2, value2)); - - if(expectedValue1 == value1 && expectedValue2 == value2 && attributeSet.Count() == 2) - { - SetTestStepResult(EPass); - } - else - { - INFO_PRINTF1(_L("CContent::GetAttributeSet() values don't match expected values")); - } - } - - else - { - INFO_PRINTF1(_L("CContent::GetAttributeSet() failed")); - } - - CleanupStack::PopAndDestroy(3, headerData); - -__UHEAP_MARKEND; - - return TestStepResult(); - } - - -TVerdict CCAFContentStringAttributeStep::doWmdrmTestStepL() - { - SetTestStepResult(EFail); - - TInt attribVal; - GetIntFromConfig(ConfigSection(),_L("attribute"),attribVal); - - TPtrC expectedValue; - GetStringFromConfig(ConfigSection(),_L("value"),expectedValue); - - TInt expectedResult; - GetIntFromConfig(ConfigSection(),_L("result"),expectedResult); - -__UHEAP_MARK; - TPtrC header; - HBufC8* headerData = NULL; - - if(GetStringFromConfig(ConfigSection(),_L("header"), header)) - { - headerData = ConvertDes16toHBufC8LC(header); - } - else - { - headerData = CreateWmdrmHeaderLC(); - } - - CContent *content = CContent::NewLC(*headerData); - - TBuf <200> value; - TInt result = content->GetStringAttribute(attribVal, value); - if(result == expectedResult && value == expectedValue) - { - SetTestStepResult(EPass); - } - else - { - INFO_PRINTF3(_L("CContent::GetStringAttribute() Expected result: %d, actual result: %d"), expectedResult, result); - INFO_PRINTF3(_L("CContent::GetStringAttribute() Expected value: %S, actual value: %S"), &expectedValue, &value); - } - - CleanupStack::PopAndDestroy(2, headerData); - -__UHEAP_MARKEND; - - return TestStepResult(); - } - - -TVerdict CCAFContentStringAttributeSetStep::doWmdrmTestStepL() - { - SetTestStepResult(EFail); - - TInt attribute1; - GetIntFromConfig(ConfigSection(),_L("attribute1"),attribute1); - - TInt attribute2; - GetIntFromConfig(ConfigSection(),_L("attribute2"),attribute2); - - TPtrC expectedValue1; - GetStringFromConfig(ConfigSection(),_L("value1"),expectedValue1); - - TPtrC expectedValue2; - GetStringFromConfig(ConfigSection(),_L("value2"),expectedValue2); - -__UHEAP_MARK; - TPtrC header; - HBufC8* headerData = NULL; - - if(GetStringFromConfig(ConfigSection(),_L("header"), header)) - { - headerData = ConvertDes16toHBufC8LC(header); - } - else - { - headerData = CreateWmdrmHeaderLC(); - } - - CContent *content = CContent::NewLC(*headerData); - - RStringAttributeSet attributeSet; - CleanupClosePushL(attributeSet); - attributeSet.AddL(attribute1); - attributeSet.AddL(attribute2); - - TInt result = content->GetStringAttributeSet(attributeSet); - TBuf <200> value1; - TBuf <200> value2; - if(result == KErrNone) - { - TInt result3 = attributeSet.GetValue(attribute1, value1); - TInt result4 = attributeSet.GetValue(attribute2, value2); - - if(value1 == expectedValue1 && value2 == expectedValue2 && attributeSet.Count() == 2 - && result3 == KErrNone && result4 == KErrNone) - { - SetTestStepResult(EPass); - } - else - { - INFO_PRINTF3(_L("RStringAttributeSet::GetValue() for attribute1.Expected value: %S, actual value: %S"), &expectedValue1, &value1); - INFO_PRINTF3(_L("RStringAttributeSet::GetValue() for attribute2.Expected value: %S, actual value: %S"), &expectedValue2, &value2); - INFO_PRINTF3(_L("RStringAttributeSet::GetValue() for attribute1. Expected result: %d, actual result: %d"), 0, result3); - INFO_PRINTF3(_L("RStringAttributeSet::GetValue() for attribute2. Expected result: %d, actual result: %d"), 0, result4); - } - } - else - { - INFO_PRINTF1(_L("CContent::GetStringAttributeSet() failed")); - } - - CleanupStack::PopAndDestroy(3, headerData); - -__UHEAP_MARKEND; - - return TestStepResult(); - } - -#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT