blob: 2085c73e1f73e81bf0e8a948909561c07adcbf54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/*
* Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
* Contact: http://www.qt-project.org/legal
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
/**
@file
@publishedAll
@released
*/
#ifndef __CONCURRENT_LISTENER_STEP_H__
#define __CONCURRENT_LISTENER_STEP_H__
#include <test/testexecutestepbase.h>
#include "performancefunctionalitybase.h"
class CConcurrentListenerStep : public CPerformanceFunctionalityBase
{
class CConcurrentListenerActive;
friend class CConcurrentListenerActive;
public:
CConcurrentListenerStep();
~CConcurrentListenerStep();
virtual TVerdict doTestStepL();
private:
void PreTestL();
void InitializeL();
void Cleanup();
void NotifyReceivedL();
void GetEventsL();
void GetContactsL();
void GetNextTestL();
void GetSharedArrayL(const TDesC &aShare, RArray<TInt> &aArray, RArray<TInt> &aDBArray);
TBool CompareNotifications();
void ResetArrays();
void GetMessageCountL();
private:
TTime iStart;//store test start time
TTime iEnd;//store current time
TBool iSharedNext;//new test case
TBool iEndTest;//test has ended (last count is greater than current count)
TInt iLastCount;//current test case being testsed
TInt iMessageCount;//number of notifications to expect
CContactChangeNotifier *iNotifier;
RArray<TInt> *iSharedContacts;//contact ids of expected notifications
RArray<TInt> *iSharedEvents;//event ids of expected notifications
RArray<TInt> *iDBContacts;//contact ids of database generated notifications
RArray<TInt> *iDBEvents;//event ids of database generated notifications
CConcurrentListenerStep::CConcurrentListenerActive *iActive;
private:
class CConcurrentListenerActive : public CActive, MContactDbObserver
{
friend class CConcurrentListenerStep;
public:
CConcurrentListenerActive(CConcurrentListenerStep *aStep);
private:
void Activate();
private: // From CActive.
void RunL();
void DoCancel();
TInt RunError(TInt aError);
private: // from MContactDbObserver
void HandleDatabaseEventL(TContactDbObserverEvent aEvent);
private:
CConcurrentListenerStep *iStep;
};
};
_LIT(KConcurrentListenerStep,"ConcurrentListenerStep");
#endif
|