|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Author: Franco.Bellu@symbian.com |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 #include "Tc1.h" |
|
20 #include <http.h> |
|
21 |
|
22 CHttpTestCase1::CHttpTestCase1() |
|
23 { |
|
24 iExpectedStatusCode=0; |
|
25 } |
|
26 |
|
27 void CHttpTestCase1::DoRunL() |
|
28 { |
|
29 RHTTPSession mySession; |
|
30 iEngine->Utils().LogIt(_L("A RHTTPSession object created")); |
|
31 |
|
32 mySession.OpenL(); |
|
33 CleanupClosePushL(mySession); |
|
34 iEngine->Utils().LogIt(_L("Session Created (TC1)(Default) params:RHTTPProxy aProxy = RHTTPProxy(),MHTTPSessionCallback* aCallback = NULL")); |
|
35 |
|
36 mySession.Close(); |
|
37 iEngine->Utils().LogIt(_L("RHTTPSession.Close called")); |
|
38 if (iTestFail==1) |
|
39 { |
|
40 User::Leave(-1); |
|
41 } |
|
42 CleanupStack::Pop();//mySession |
|
43 } |
|
44 |
|
45 TInt CHttpTestCase1::RunError(TInt aErr) |
|
46 { |
|
47 iEngine->Utils().LogIt(_L("\nTest failed with error code %d\n"), aErr); |
|
48 return KErrNone; |
|
49 } |
|
50 |
|
51 void CHttpTestCase1::DoCancel() |
|
52 { |
|
53 } |
|
54 CHttpTestCase1::~CHttpTestCase1() |
|
55 { |
|
56 } |
|
57 |
|
58 /** set this object active */ |
|
59 void CHttpTestCase1::CompleteOwnRequest() |
|
60 { |
|
61 TRequestStatus* stat = &iStatus; |
|
62 User::RequestComplete(stat,KErrNone); |
|
63 if (!IsActive()) |
|
64 SetActive(); |
|
65 } |
|
66 |
|
67 |
|
68 /** sets base test name. |
|
69 @param void |
|
70 @return string - the test name |
|
71 */ |
|
72 const TDesC& CHttpTestCase1::TestName() |
|
73 { |
|
74 _LIT(KHeaderTestName,"Test Case 1 "); |
|
75 return KHeaderTestName; |
|
76 } |
|
77 |
|
78 void CHttpTestCase1::MHFRunL(RHTTPTransaction /*aTransaction*/, |
|
79 const THTTPEvent& /*aEvent*/) |
|
80 { |
|
81 } |
|
82 |
|
83 TInt CHttpTestCase1::MHFRunError(TInt aError, RHTTPTransaction /*aTransaction*/, |
|
84 const THTTPEvent& /*aEvent*/) |
|
85 { |
|
86 return aError; |
|
87 } |