equal
deleted
inserted
replaced
|
1 // Copyright (c) 2007-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 |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 |
|
23 #include "tsus_goodsup.h" |
|
24 |
|
25 |
|
26 |
|
27 EXPORT_C MSsmUtility* CGoodSup::NewL() |
|
28 { |
|
29 return new (ELeave) CGoodSup; |
|
30 } |
|
31 |
|
32 CGoodSup::CGoodSup() : CActive(CActive::EPriorityStandard) |
|
33 { |
|
34 } |
|
35 |
|
36 CGoodSup::~CGoodSup() |
|
37 { |
|
38 if(IsAdded()) |
|
39 { |
|
40 Deque(); |
|
41 } |
|
42 } |
|
43 |
|
44 void CGoodSup::InitializeL() |
|
45 { |
|
46 CActiveScheduler::Add(this); |
|
47 } |
|
48 |
|
49 void CGoodSup::StartL() |
|
50 { |
|
51 if(IsAdded()) |
|
52 { |
|
53 if(!IsActive()) |
|
54 { |
|
55 SetActive(); |
|
56 TRequestStatus* status = &iStatus; |
|
57 User::RequestComplete(status, KErrNone); |
|
58 } |
|
59 } |
|
60 else |
|
61 { |
|
62 User::Leave(KErrNotReady); |
|
63 } |
|
64 } |
|
65 |
|
66 void CGoodSup::Release() |
|
67 { |
|
68 delete this; |
|
69 } |
|
70 |
|
71 void CGoodSup::DoCancel() |
|
72 { |
|
73 } |
|
74 |
|
75 void CGoodSup::RunL() |
|
76 { |
|
77 RSemaphore sem; |
|
78 if(KErrNone == sem.OpenGlobal(KTestGoodSupSemaphore)) |
|
79 { |
|
80 sem.Signal(); |
|
81 sem.Close(); |
|
82 } |
|
83 } |
|
84 |
|
85 TInt CGoodSup::RunError(TInt aError) |
|
86 { |
|
87 return aError; |
|
88 } |