|
1 // Copyright (c) 2001-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 // The context for the unit tests upon the CBackupNotifier class methods. |
|
15 // Additionally supply a stub for the CBackupNotifier observation class that |
|
16 // logs the resume and suspend calls |
|
17 // |
|
18 // |
|
19 |
|
20 #include "BackupNotifierTransitions.h" |
|
21 |
|
22 // ______________________________________________________________________________ |
|
23 // |
|
24 inline CNotificationStub::CNotificationStub(CDataLogger& aDataLogger) |
|
25 : CBase(), iDataLogger(aDataLogger) |
|
26 { |
|
27 // Do nothing |
|
28 } |
|
29 |
|
30 inline CNotificationStub::~CNotificationStub() |
|
31 { |
|
32 // Do nothing |
|
33 } |
|
34 |
|
35 inline TInt CNotificationStub::Suspend() |
|
36 { |
|
37 _LIT(KBackupNotifierObserverSuspendMethod, "MBackupNotifierObserver::Suspend called"); |
|
38 iDataLogger.LogInformation(KBackupNotifierObserverSuspendMethod); |
|
39 return KErrNone; |
|
40 } |
|
41 |
|
42 inline TInt CNotificationStub::Resume() |
|
43 { |
|
44 _LIT(KBackupNotifierObserverResumeMethod, "MBackupNotifierObserver::Resume called"); |
|
45 iDataLogger.LogInformation(KBackupNotifierObserverResumeMethod); |
|
46 return KErrNone; |
|
47 } |
|
48 |
|
49 // ______________________________________________________________________________ |
|
50 // |
|
51 inline CBackupNotifier_UnitTestContext::CBackupNotifier_UnitTestContext(CDataLogger& aDataLogger, |
|
52 MStateAccessor& aStateAccessor, |
|
53 MTransitionObserver& aObserver) |
|
54 : CUnitTestContext(aDataLogger, aStateAccessor, aObserver) |
|
55 { |
|
56 //Do nothing |
|
57 } |
|
58 |
|
59 inline CBackupNotifier_UnitTestContext::~CBackupNotifier_UnitTestContext() |
|
60 { |
|
61 delete iBackupNotifier; |
|
62 delete iStub; |
|
63 } |
|
64 |