common/tools/ats/smoketest/http/src/testhttpeboclientconditionalstep.cpp
author Maciej Seroka <maciejs@symbian.org>
Wed, 06 Jan 2010 13:41:51 +0000
changeset 836 675529c38614
child 872 17498133d9ad
permissions -rw-r--r--
Added smoke test for making a connection to a web server through ethernet
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
836
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
// under the terms of the License "Symbian Foundation License v1.0"
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
//
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
//
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
// Contributors:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
//
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
// Description:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
// Contains implementation of CHttpEboClientStep class
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
// @internalAll
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
// 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
//
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
// User Include
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
#include "testhttpeboclientconditionalstep.h"
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
// Standard headers used by default
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
_LIT8(KUserAgent, "TestHttpEboClientConditional");
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
_LIT8(KAccept, "*/*");
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
_LIT8(KHttpUrl1, "http://www.google.co.in/");
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
_LIT8(KHttpUrl2, "http://www.live.com/");
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
_LIT8(KHttpUrl3, "http://www.search.com/");
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
_LIT8(KHttpUrl4, "http://www.find.com/");
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
Constructor: Sets the test step name.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
@internalTechnology
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
CHttpEboClientConditionalStep::CHttpEboClientConditionalStep()
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
	//Call base class method to set human readable name for test step
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
	SetTestStepName(KTestHttpEboClientConditionalStep);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
Destructor
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
@internalTechnology
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
CHttpEboClientConditionalStep::~CHttpEboClientConditionalStep()
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
Sets the proxy and HttpDataOptimiser implemetation to session
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
based on the patameter values in ini file and calls InvokeHttpMethodL()
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
@internalTechnology
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
@param		None
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
@return		None
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
void CHttpEboClientConditionalStep::StartClientL()
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
	if (!GetBoolFromConfig(ConfigSection(), KDisableTransOpt, iDisableTransOpt))
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
		{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
		ERR_PRINTF2(_L("Problem in reading values from ini.			\
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
						\nExpected fields are: \n%S\n"
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
					  ),&KDisableTransOpt);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
		SetTestStepResult(EFail);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
		return;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
		}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
	RStringPool strP = iSess.StringPool();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
	RStringF method;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
	// method
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
	method = strP.StringF(HTTP::EGET,RHTTPSession::GetTable());		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
	TBuf8<256> url8;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
	TRAPD(err,InvokeHttpMethodL(url8, method));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
	if (err != KErrNone)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
		{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
		ERR_PRINTF2(_L("Teststep Failed: Leave occured in CTestHttpBufferSizeStep::InvokeHttpMethodL: %D\n"
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
					  ),err
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
				   );
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
		SetTestStepResult(EFail);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
		}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
	method.Close(); 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
Invoke the http method
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
This actually creates the transaction, sets the headers and HttpDataOptimiser implemetation to transaction
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
and then starts the transaction 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
@internalTechnology
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
@param		aUri 		Requested uri
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
@param		aMethod 	Requested method
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
@return		None		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
void CHttpEboClientConditionalStep::InvokeHttpMethodL(const TDesC8& /*aUri*/, RStringF aMethod)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
	TUriParser8 uri1; 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
	uri1.Parse( KHttpUrl1 );
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
	// Opening transactions	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	RHTTPTransaction trans1 = iSess.OpenTransactionL(uri1, *this, aMethod);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
	CleanupClosePushL(trans1);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
	RHTTPHeaders hdr1 = trans1.Request().GetHeaderCollection();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
	SetHeaderL(hdr1, HTTP::EUserAgent, KUserAgent);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
	SetHeaderL(hdr1, HTTP::EAccept, KAccept);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	TUriParser8 uri2; 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
	uri2.Parse( KHttpUrl2 );
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
	RHTTPTransaction trans2 = iSess.OpenTransactionL(uri2, *this, aMethod);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
	CleanupClosePushL(trans2);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
	RHTTPHeaders hdr2 = trans2.Request().GetHeaderCollection();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
	SetHeaderL(hdr2, HTTP::EUserAgent, KUserAgent);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
	SetHeaderL(hdr2, HTTP::EAccept, KAccept);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
	TUriParser8 uri3; 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
	uri3.Parse( KHttpUrl3 );
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
	RHTTPTransaction trans3 = iSess.OpenTransactionL(uri3, *this, aMethod);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
	CleanupClosePushL(trans3);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
	RHTTPHeaders hdr3 = trans3.Request().GetHeaderCollection();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
	SetHeaderL(hdr3, HTTP::EUserAgent, KUserAgent);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
	SetHeaderL(hdr3, HTTP::EAccept, KAccept);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
	TUriParser8 uri4; 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
	uri4.Parse( KHttpUrl4 );
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
	RHTTPTransaction trans4 = iSess.OpenTransactionL(uri4, *this, aMethod);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
	CleanupClosePushL(trans4);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	RHTTPHeaders hdr4 = trans4.Request().GetHeaderCollection();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
	SetHeaderL(hdr4, HTTP::EUserAgent, KUserAgent);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
	SetHeaderL(hdr4, HTTP::EAccept, KAccept);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
	if (iDisableTransOpt)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
		{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
		iSess.SetupHttpDataOptimiser(*this);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
		THTTPHdrVal disableOptimiser(iSess.StringPool().StringF(HTTP::EDisableHTTPTransOptimiser,RHTTPSession::GetTable()));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
		trans3.PropertySet().SetPropertyL(iSess.StringPool().StringF(HTTP::EHTTPTransOptimiser,RHTTPSession::GetTable()), disableOptimiser);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
		}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
	else
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
		{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
		trans1.SetupHttpDataOptimiser(*this);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
		trans2.SetupHttpDataOptimiser(*this);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
		trans4.SetupHttpDataOptimiser(*this);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
		}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
	trans1.SubmitL();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
	CActiveScheduler::Start();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
	trans2.SubmitL();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
	CActiveScheduler::Start();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
	trans3.SubmitL();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	CActiveScheduler::Start();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
		
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
	trans4.SubmitL();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
	CActiveScheduler::Start();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
	CleanupStack::Pop(&trans4);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
	CleanupStack::Pop(&trans3);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
	CleanupStack::Pop(&trans2);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
	CleanupStack::Pop(&trans1);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
This is the implementation of interface method MHttpDataOptimiser::MHFRunL
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
If there is a reponse body it will be copied to a file.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
Just printing the fired events to the log file.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
@internalTechnology 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
@param		aTransaction Transaction which is being processed currently
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
@param      THTTPEvent Event for which it is called
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
@return		None
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
*/	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
void CHttpEboClientConditionalStep::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
	switch (aEvent.iStatus)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
		{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
		case THTTPEvent::EGotResponseHeaders:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
			INFO_PRINTF2(_L("Processing Transaction %d\n"), aTransaction.Id());
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
			RHTTPResponse resp = aTransaction.Response();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
			TInt status = resp.StatusCode();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
			RStringF statusStr = resp.StatusText();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
			TBuf<32> statusStr16;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
			statusStr16.Copy(statusStr.DesC());
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
			INFO_PRINTF3(_L("Status: %D (%S)\n"),status, &statusStr16);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
			if (resp.HasBody() && (status >= 200) && (status < 300) && (status != 204))
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
				{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
				TInt dataSize = resp.Body()->OverallDataSize();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
				if (dataSize >= 0)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
					INFO_PRINTF2(_L("Response body size is %d\n"), dataSize);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
				else
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
					INFO_PRINTF1(_L("Response body size is unknown\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
				} 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
		case THTTPEvent::EGotResponseBodyData:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
			// Get the body data supplier
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
			iRespBody = aTransaction.Response().Body();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
			INFO_PRINTF1(_L("Receiving response body...\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
			
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
			TPtrC8 bodyData;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
			TBool lastChunk = iRespBody->GetNextDataPart(bodyData);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
			if(bodyData.Size() > iChunkSize)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
				{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
				iChunkSize = bodyData.Size();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
				}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
			iRespBody->ReleaseData();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
		case THTTPEvent::EResponseComplete:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
			// The transaction's response is complete
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
			INFO_PRINTF1(_L("\nTransaction Complete\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
		case KErrHttpOptimiserFailsTrans:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
			INFO_PRINTF1(_L("Cancelling/Failing Transaction\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
			aTransaction.Fail(THTTPFilterHandle::EProtocolHandler);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
			//CActiveScheduler::Stop();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
		case THTTPEvent::ESucceeded:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
			INFO_PRINTF1(_L("Transaction Successful\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
			aTransaction.Close();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
			CActiveScheduler::Stop();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
		case THTTPEvent::EFailed:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
			INFO_PRINTF1(_L("Transaction Failed\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
			aTransaction.Close();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
			CActiveScheduler::Stop();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
		case THTTPEvent::ERedirectedPermanently:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
			INFO_PRINTF1(_L("Permanent Redirection\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
		case THTTPEvent::ERedirectedTemporarily:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
			INFO_PRINTF1(_L("Temporary Redirection\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
		case THTTPEvent::ERedirectRequiresConfirmation:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
 			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
			// 301(Moved Permanently), 302(Found) or 307(Temporary Redirect) status is received 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
			// from a transaction and hence ERedirectRequiresConfirmation is sent by filter
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
			// client has opted to close the transaction
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
			INFO_PRINTF1(_L("Redirect requires confirmation\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
 			aTransaction.Close();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
 			CActiveScheduler::Stop();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
 			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
		default:
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
			{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
			INFO_PRINTF2(_L("<unrecognised event: %D>\n"), aEvent.iStatus);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
			// close off the transaction if it's an error
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
			if (aEvent.iStatus < 0)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
				{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
				aTransaction.Close();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
				CActiveScheduler::Stop();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
				}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
			} break;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
		}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
This is the implementation of interface method MHttpDataOptimiser::MHFRunError
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
@internalTechnology 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
@param		aError  Error which has been raised.	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
@param		aTransaction Transaction which is being processed currently
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
@param      THTTPEvent Event which it is being handled currently.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
@return		None
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
TInt CHttpEboClientConditionalStep::MHFRunError(TInt aError, RHTTPTransaction /*aTransaction*/, const THTTPEvent& /*aEvent*/)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
	INFO_PRINTF2(_L("MHFRunError fired with error code %D\n"), aError);
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
	return KErrNone;
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
It enocodes the request data.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
@internalTechnology 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
@param		aHttpData  Actual request.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
@param		aEncodedData Encoded request.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
@return		None
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
void CHttpEboClientConditionalStep::EncodeL (const TDesC8& aHttpData, HBufC8* &aEncodedData)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
	INFO_PRINTF1(_L("######## CHttpEboClientStep::EncodeL ########\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
	aEncodedData =  aHttpData.AllocLC();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
	CleanupStack::Pop();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
	INFO_PRINTF1(_L("Encoded/Changed the request\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
	}
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
/**
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
It decodes the responsing data before parsing.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
@internalTechnology 
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
@test
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
@param		aHttpData  Actual response.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
@param		aEncodedData Decoded response.
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
@return		None
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
*/
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
void CHttpEboClientConditionalStep::DecodeL (const TDesC8& aData, HBufC8*& aHttpData, TBool& /*aTransFail*/)
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
	{
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
	INFO_PRINTF1(_L("######## CHttpEboClientStep::DecodeL ########\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
	aHttpData = aData.AllocLC();
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
	CleanupStack::Pop();	
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
	INFO_PRINTF1(_L("Sent the actual response as a decoded response\n"));
675529c38614 Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
	}