|
1 // Copyright (c) 2006-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // @file ctlbsstepsetbehaviourmodeoriginal.cpp |
|
15 // This is the class implementation for the Set Behaviour Mode Original Step |
|
16 // |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalTechnology |
|
24 @test |
|
25 */ |
|
26 |
|
27 #include "ctlbsstepsetbehaviourmodeoriginal.h" |
|
28 #include <lbsadmin.h> |
|
29 |
|
30 CT_LbsStep_SetBehaviourModeOriginal::CT_LbsStep_SetBehaviourModeOriginal(CT_LbsServer& aParent) : CT_LbsStep(aParent) |
|
31 { |
|
32 SetTestStepName(KLbsStep_SetBehaviourModeOriginal); |
|
33 } |
|
34 |
|
35 /** |
|
36 Static Constructor |
|
37 */ |
|
38 CT_LbsStep_SetBehaviourModeOriginal* CT_LbsStep_SetBehaviourModeOriginal::New(CT_LbsServer& aParent) |
|
39 { |
|
40 return new CT_LbsStep_SetBehaviourModeOriginal(aParent); |
|
41 // Note the lack of ELeave. |
|
42 // This means that having insufficient memory will return NULL; |
|
43 } |
|
44 |
|
45 |
|
46 /** |
|
47 */ |
|
48 TBool CT_LbsStep_SetBehaviourModeOriginal::SetAndVerifyBehaviourModeOriginalL() |
|
49 { |
|
50 TBool ret = TRUE; |
|
51 CLbsAdmin* adminApi = CLbsAdmin::NewL(); |
|
52 CleanupStack::PushL(adminApi); |
|
53 |
|
54 CLbsAdmin::TLbsBehaviourMode behaviourMode; |
|
55 |
|
56 TInt err = adminApi->Set(KLbsSettingBehaviourMode, CLbsAdmin::ELbsBehaviourModeOriginal); |
|
57 User::LeaveIfError(err); |
|
58 err = adminApi->Get(KLbsSettingBehaviourMode, behaviourMode); |
|
59 User::LeaveIfError(err); |
|
60 |
|
61 if(behaviourMode != CLbsAdmin::ELbsBehaviourModeOriginal) |
|
62 { |
|
63 INFO_PRINTF1(_L("Admin setting didn't work")); |
|
64 ret = FALSE; |
|
65 } |
|
66 CleanupStack::PopAndDestroy(adminApi); |
|
67 |
|
68 // Alow he setting to be propagated |
|
69 User::After(2000000); |
|
70 |
|
71 return ret; |
|
72 } |
|
73 |
|
74 /** |
|
75 @pre |
|
76 @return Test verdict |
|
77 @post Lbs Behaviour mode set to "original" |
|
78 */ |
|
79 TVerdict CT_LbsStep_SetBehaviourModeOriginal::doTestStepL() |
|
80 { |
|
81 INFO_PRINTF1(_L(">>CT_LbsStep_SetBehaviourModeOriginal::doTestStepL()")); |
|
82 |
|
83 if(!SetAndVerifyBehaviourModeOriginalL()) |
|
84 { |
|
85 SetTestStepResult(EFail); |
|
86 } |
|
87 |
|
88 INFO_PRINTF1(_L("<<CT_LbsStep_SetBehaviourModeOriginal::doTestStepL()")); |
|
89 |
|
90 return TestStepResult(); |
|
91 } |