|
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: Main test class for hsHomeScreenStatePlugin library. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include<hbmessagebox.h> |
|
19 #include<hbaction.h> |
|
20 |
|
21 #include "hsuinstallfailedstate.h" |
|
22 #include "t_hsmenuworkerstateplugin.h" |
|
23 #include "hscontentservice.h" |
|
24 #include "hsmenueventfactory.h" |
|
25 #include "hsmenuevent.h" |
|
26 #include "hsmenuitemmodel.h" |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // --------------------------------------------------------------------------- |
|
30 // |
|
31 void MenuStatesTest::HsUninstallFailedState_construction() |
|
32 { |
|
33 #ifdef Q_OS_SYMBIAN |
|
34 #ifdef UT_MEMORY_CHECK |
|
35 __UHEAP_MARK; |
|
36 #endif//UT_MEMORY_CHECK |
|
37 #endif//Q_OS_SYMBIAN |
|
38 { |
|
39 QState parentState1; |
|
40 parentState1.setObjectName(tr("testName1")); |
|
41 |
|
42 HsUninstallFailedState uni1(&parentState1); |
|
43 QString s1 = uni1.objectName(); |
|
44 QVERIFY(s1 == tr("testName1/HsUninstallFailedState")); |
|
45 } |
|
46 #ifdef Q_OS_SYMBIAN |
|
47 #ifdef UT_MEMORY_CHECK |
|
48 __UHEAP_MARKEND; |
|
49 #endif//UT_MEMORY_CHECK |
|
50 #endif//Q_OS_SYMBIAN |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 void MenuStatesTest::HsUninstallFailedState_onEntry() |
|
57 { |
|
58 #ifdef Q_OS_SYMBIAN |
|
59 #ifdef UT_MEMORY_CHECK |
|
60 __UHEAP_MARK; |
|
61 #endif//UT_MEMORY_CHECK |
|
62 #endif//Q_OS_SYMBIAN |
|
63 { |
|
64 QState parentState; |
|
65 HsUninstallFailedState failedState(&parentState); |
|
66 |
|
67 int fakeError = 3; |
|
68 QVariantMap params; |
|
69 params.insert(Hs::uninstallError, fakeError); |
|
70 |
|
71 //test event |
|
72 QScopedPointer<HsMenuEvent> event(new HsMenuEvent(HsMenuEvent::UninstallationFailed, params)); |
|
73 |
|
74 failedState.onEntry(event.data()); |
|
75 |
|
76 checkDialogController(); |
|
77 } |
|
78 #ifdef Q_OS_SYMBIAN |
|
79 #ifdef UT_MEMORY_CHECK |
|
80 __UHEAP_MARKEND; |
|
81 #endif//UT_MEMORY_CHECK |
|
82 #endif//Q_OS_SYMBIAN |
|
83 } |
|
84 |