279
|
1 |
// Copyright (c) 2010 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 "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 |
// e32test/domainmgr/t_dmslave_onecap.cpp
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#include <e32test.h>
|
|
19 |
#include <domainmember.h>
|
|
20 |
|
|
21 |
#include "domainpolicytest.h"
|
|
22 |
|
|
23 |
|
|
24 |
RTest test(_L(" T_DMSLAVE_ONECAP "));
|
|
25 |
|
|
26 |
|
|
27 |
GLDEF_C TInt E32Main()
|
|
28 |
{
|
|
29 |
test.Title();
|
|
30 |
test.Start(_L("Call DeferAcknowledgement() with one capability"));
|
|
31 |
|
|
32 |
// Steps 1. & 2. are in the parent process
|
|
33 |
|
|
34 |
// 3. Connect to domain
|
|
35 |
RDmDomain domain;
|
|
36 |
TInt r = domain.Connect(KDmHierarchyIdTestV2, KDmIdTestA);
|
|
37 |
test(r == KErrNone);
|
|
38 |
|
|
39 |
// 4. Request transition notification
|
|
40 |
TRequestStatus status;
|
|
41 |
test.Printf(_L("Requesting transition notification"));
|
|
42 |
domain.RequestTransitionNotification(status);
|
|
43 |
|
|
44 |
// Tell parent we're done
|
|
45 |
RProcess().Rendezvous(KErrNone);
|
|
46 |
|
|
47 |
// Step 5. is in the parent process
|
|
48 |
|
|
49 |
User::WaitForRequest(status);
|
|
50 |
test(status.Int() == KErrNone);
|
|
51 |
|
|
52 |
// 6. Try to defer acknowledgement (this is the sole purpose of this test)
|
|
53 |
test.Printf(_L("Requesting acknowledgement deferral\n"));
|
|
54 |
domain.DeferAcknowledgement(status);
|
|
55 |
User::WaitForRequest(status);
|
|
56 |
test(status.Int() == KErrNone);
|
|
57 |
|
|
58 |
// 7. Acknowledge
|
|
59 |
test.Printf(_L("Acknowledging last state\n"));
|
|
60 |
domain.AcknowledgeLastState();
|
|
61 |
|
|
62 |
test.End();
|
|
63 |
|
|
64 |
return KErrNone;
|
|
65 |
}
|