|
1 // Copyright (c) 2003-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 // |
|
15 |
|
16 /** |
|
17 @file TestQoSWarningDialog.cpp |
|
18 */ |
|
19 |
|
20 //Symbian OS Headers |
|
21 #include <c32comm.h> |
|
22 #include <agentdialog.h> |
|
23 |
|
24 //Test Framework Header |
|
25 #include <test/testexecutelog.h> |
|
26 |
|
27 //Test Step Header |
|
28 #include "TestQoSWarningDialog.h" |
|
29 |
|
30 |
|
31 CTestQoSWarningDialog::~CTestQoSWarningDialog() |
|
32 /** |
|
33 * Destructor |
|
34 */ |
|
35 { |
|
36 } |
|
37 |
|
38 CTestQoSWarningDialog::CTestQoSWarningDialog() |
|
39 /** |
|
40 * Constructor |
|
41 */ |
|
42 { |
|
43 SetTestStepName(KTestQoSWarningDialog); |
|
44 } |
|
45 |
|
46 TVerdict CTestQoSWarningDialog::doTestStepL() |
|
47 { |
|
48 |
|
49 TInt ret=StartC32(); |
|
50 if ((ret != KErrNone) && (ret != KErrAlreadyExists)) |
|
51 INFO_PRINTF2(_L("error is : %d \n"),ret); |
|
52 else |
|
53 INFO_PRINTF1(_L("Started C32\n")); |
|
54 |
|
55 RGenConAgentDialogServer dlgSv; |
|
56 TRAP_IGNORE(dlgSv.Connect()); |
|
57 INFO_PRINTF1(_L("Connected Dialog Server\n")); |
|
58 |
|
59 TRequestStatus status; |
|
60 |
|
61 INFO_PRINTF1(_L("\nTesting the QoS Warning Dialog\n")); |
|
62 TBool response = ETrue; |
|
63 dlgSv.QoSWarning(response, status); |
|
64 INFO_PRINTF1(_L("Requested QoS warning\n")); |
|
65 User::WaitForRequest(status); |
|
66 ret=status.Int(); |
|
67 INFO_PRINTF2(_L("Request QoS warning completed with code=%d\n"),ret); |
|
68 checkError(dlgSv,ret); |
|
69 if (response) |
|
70 INFO_PRINTF1(_L("Disconnect\n")); |
|
71 else |
|
72 INFO_PRINTF1(_L("Do not disconnect\n")); |
|
73 |
|
74 |
|
75 return TestStepResult(); |
|
76 } |
|
77 |
|
78 |
|
79 void CTestQoSWarningDialog::checkError(RGenConAgentDialogServer& aDlgSvr, TInt aError) |
|
80 { |
|
81 if (aError!=KErrNone && aError!=KErrCancel) |
|
82 aDlgSvr.Close(); |
|
83 |
|
84 if ((aError!=KErrNone) && (aError!=KErrCancel)) |
|
85 INFO_PRINTF2(_L("Error is : %d \n"), aError); |
|
86 } |
|
87 |
|
88 void CTestQoSWarningDialog::checkPctError(RGenConAgentDialogServer& aDlgSvr, TInt aError) |
|
89 { |
|
90 if (aError!=KErrNone) |
|
91 { |
|
92 aDlgSvr.ClosePct(); |
|
93 TRequestStatus destroyStatus; |
|
94 User::WaitForRequest(destroyStatus); |
|
95 aDlgSvr.Close(); |
|
96 } |
|
97 |
|
98 TEST(aError==KErrNone); |
|
99 } |
|
100 |
|
101 |