Exemplo n.º 1
0
TBool CHttpTestCase8::GetCredentialsL(const TUriC8& aURI, RString aRealm, RStringF aAuthenticationType, RString& aUsername, RString& aPassword)
	{
	iEngine->Utils().LogIt(_L("Supplying credentials"));
	iEngine->Utils().DumpData(aURI.UriDes());
	iEngine->Utils().DumpData(aRealm.DesC());
	iEngine->Utils().DumpData(aAuthenticationType.DesC());
	_LIT8(KScooby, "scooby");
	_LIT8(KDoo, "doo");
	RStringPool p = aRealm.Pool();
	aUsername = p.OpenStringL(KScooby);
	aPassword = p.OpenStringL(KDoo);
	return ETrue;
	}
// ----------------------------------------------------------------------------
// CWmDrmDlaDefaultHttpManager::GetCredentialsL
// This function is NOT currently used as authentication is not current used in
// this project at the current time
// ----------------------------------------------------------------------------
TBool CWmDrmDlaDefaultHttpManager::GetCredentialsL(
    const TUriC8& /*aURI*/,
    RString aRealm,
    RStringF aAuthenticationType,
    RString& aUsername,
    RString& aPassword )
    {
    LOGFN( "CWmDrmDlaDefaultHttpManager::GetCredentialsL" );
    iCredentialsOk = EFalse;
    RStringPool pool = aRealm.Pool();
    if ( aAuthenticationType == HTTP_STRING( HTTP::EBasic ) )
        {
        DeleteUsernamePassword();

        // Get the username/password
        iInCallback = ETrue;
        iCredentialsOk =
            iObserver.OnGetUsernamePasswordL( iUsername, iPassword );
        iInCallback = EFalse;

        // authentication = iCredentialsOk && iUsername && iPassword
        // no authentication = !iCredentialsOk && !iUsername && !iPassword
        ASSERT( (iCredentialsOk && iUsername && iPassword) ||
            (!iCredentialsOk && !iUsername && !iPassword ) );

        if (iCredentialsOk)
            {
            aUsername = pool.OpenStringL( *iUsername );
            aPassword = pool.OpenStringL( *iPassword );
            }
        }

    // If the authentication type is not Basic, we simply return EFalse.
    return iCredentialsOk;
    }
/**
Subtest function

@SYMTestCaseID          SYSLIB-BAFL-CT-0490
@SYMTestCaseDesc        Tests for defect number DEF043985
@SYMTestPriority        High
@SYMTestActions         Tests that the table is invalid when creating a folded RString
@SYMTestExpectedResults Tests must not fail
@SYMREQ                 REQ0000
*/
void RStringPoolPanicTest::DEF043985_IndexTest_SubFunctionL()
	{
	__UHEAP_MARK;

	RStringPool stringPool;
	stringPool.OpenL();

	// Create a table and make it so it passes some internal tests
	// for validity as we are testing a particular internal test
	TStringTable testTable;
	testTable.iCaseSensitive = ETrue;
	testTable.iCount = 1;

	RString testString = stringPool.OpenStringL(KDummyString());
	CleanupClosePushL(testString);
	
	// Test for Panic
	testString.Index(testTable);
	
	// Test should never get this far as it Panics
	
	CleanupStack::PopAndDestroy(&testString);
	stringPool.Close();
	
	__UHEAP_MARKEND;
	}
Exemplo n.º 4
0
TBool CHttpTestCaseGet14::GetCredentialsL(const TUriC8& aURI, RString aRealm, RStringF aAuthenticationType, RString& aUsername, RString& aPassword)
	{
	 if(iCallsNum++)
		 {
		 iTestFail=1;
		 iEngine->Utils().LogIt(_L("The test will fail: the credential haven't been kept(the GetCredential function has been called again)"));
		 return EFalse;
		 }
	iEngine->Utils().LogIt(_L("Supplying credentials"));
	iEngine->Utils().DumpData(aURI.UriDes());
	iEngine->Utils().DumpData(aRealm.DesC());	
	iEngine->Utils().DumpData(aAuthenticationType.DesC());	
	_LIT8(KScooby, "scooby");
	_LIT8(KDoo, "doo");
	RStringPool p = aRealm.Pool();
	aUsername = p.OpenStringL(KScooby);
	aPassword = p.OpenStringL(KDoo);
	return ETrue;
	}