sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysstatechange.cpp
equal
deleted
inserted
replaced
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
20 */ |
20 */ |
21 |
21 |
22 #include "tcmd_step_coopsysstatechange.h" |
22 #include "tcmd_step_coopsysstatechange.h" |
23 #include "ssmcustomcmdfactory.h" |
23 #include "ssmcustomcmdfactory.h" |
24 #include <ssm/ssmstate.h> |
24 #include <ssm/ssmstate.h> |
25 #include <e32property.h> |
|
26 #include "cmdcoopsysstatechange.h" |
25 #include "cmdcoopsysstatechange.h" |
27 const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A; |
|
28 const TUid KPropertyCategory={0x2000D75B}; |
|
29 |
26 |
30 CCustomCmdTestCoopSysStateChange::~CCustomCmdTestCoopSysStateChange() |
27 CCustomCmdTestCoopSysStateChange::~CCustomCmdTestCoopSysStateChange() |
31 { |
28 { |
32 } |
29 } |
33 |
30 |
41 New Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0007 |
38 New Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0007 |
42 */ |
39 */ |
43 |
40 |
44 void CCustomCmdTestCoopSysStateChange::TestCustomCmdCoopSysStateChangeL() |
41 void CCustomCmdTestCoopSysStateChange::TestCustomCmdCoopSysStateChangeL() |
45 { |
42 { |
46 // Setting the P and S key will route the request to the reference plugins instead of the actual plugins |
|
47 TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt); |
|
48 TEST(KErrNone == err || KErrAlreadyExists == err); |
|
49 err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1); |
|
50 TEST(KErrNone == err); |
|
51 |
|
52 _LIT(KTESTLOG, "TestCustomCmdCoopSysStateChangeL"); |
43 _LIT(KTESTLOG, "TestCustomCmdCoopSysStateChangeL"); |
53 INFO_PRINTF1(KTESTLOG); |
44 INFO_PRINTF1(KTESTLOG); |
54 |
45 |
55 MSsmCustomCommand* customCmdCoopSysStateChange = SsmCustomCmdFactory::CmdCoopSysStateChangeNewL(); |
46 MSsmCustomCommand* customCmdCoopSysStateChange = SsmCustomCmdFactory::CmdCoopSysStateChangeNewL(); |
56 CSsmCustomCommandEnv* cmdEnv = NULL; |
47 CSsmCustomCommandEnv* cmdEnv = NULL; |
86 //Close the command |
77 //Close the command |
87 customCmdCoopSysStateChange->Close(); |
78 customCmdCoopSysStateChange->Close(); |
88 |
79 |
89 //Releasing the comand will delete itself. |
80 //Releasing the comand will delete itself. |
90 customCmdCoopSysStateChange->Release(); |
81 customCmdCoopSysStateChange->Release(); |
91 err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey); |
|
92 TEST(KErrNone == err); |
|
93 } |
82 } |
94 |
83 |
95 TVerdict CCustomCmdTestCoopSysStateChange::doTestStepL() |
84 TVerdict CCustomCmdTestCoopSysStateChange::doTestStepL() |
96 { |
85 { |
97 __UHEAP_MARK; |
86 __UHEAP_MARK; |