90
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <e32property.h>
|
|
19 |
|
|
20 |
#include "t_hsapplication.h"
|
|
21 |
#include "hsrecoverymanager.h"
|
|
22 |
|
|
23 |
const TInt KPSCategoryUid(0x20022F36);
|
|
24 |
const TInt KPSCrashCountKey(1);
|
|
25 |
const int KResetCrashCountInterval(60000);
|
|
26 |
|
|
27 |
void t_hsapplication::testHsRecoveryManagerConstruction()
|
|
28 |
{
|
|
29 |
HsRecoveryManager rm;
|
|
30 |
QVERIFY(rm.mTimer.isSingleShot());
|
|
31 |
QCOMPARE(rm.mTimer.interval(), KResetCrashCountInterval);
|
|
32 |
}
|
|
33 |
|
|
34 |
void t_hsapplication::testHsRecoveryManagerCrashCount()
|
|
35 |
{
|
|
36 |
TInt storedCount = 0;
|
|
37 |
RProperty::Get(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, storedCount);
|
|
38 |
|
|
39 |
HsRecoveryManager rm;
|
|
40 |
rm.resetCrashCount();
|
|
41 |
QCOMPARE(rm.crashCount(), 0);
|
|
42 |
|
|
43 |
RProperty::Set(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, storedCount);
|
|
44 |
}
|
|
45 |
|
|
46 |
void t_hsapplication::testHsRecoveryManagerRestoreRomDatabase()
|
|
47 |
{
|
|
48 |
HsRecoveryManager rm;
|
|
49 |
rm.restoreRomDatabase();
|
|
50 |
}
|
|
51 |
|
|
52 |
void t_hsapplication::testHsRecoveryManagerExecute()
|
|
53 |
{
|
|
54 |
HsRecoveryManager rm;
|
|
55 |
rm.execute();
|
|
56 |
}
|