90
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 <QStateMachine>
|
|
19 |
|
|
20 |
#include <HbInstance>
|
|
21 |
#include <HbMainWindow>
|
|
22 |
|
|
23 |
#include "t_hshomescreenstateplugin.h"
|
|
24 |
#include "hsbackuprestorestate.h"
|
|
25 |
#include "hsscene.h"
|
|
26 |
#include "hsdatabase.h"
|
|
27 |
#include "hsgui.h"
|
|
28 |
|
|
29 |
void HomeScreenStatePluginTest::testLoadBackupRestoreStateConstructors()
|
|
30 |
{
|
|
31 |
HsBackupRestoreState *brs = new HsBackupRestoreState;
|
|
32 |
delete brs;
|
|
33 |
}
|
|
34 |
|
|
35 |
void HomeScreenStatePluginTest::testLoadBackupRestoreStateOnEntryExit()
|
|
36 |
{
|
|
37 |
HbInstance::instance();
|
|
38 |
HbMainWindow mainWindow;
|
101
|
39 |
// mainWindow.show();
|
90
|
40 |
|
|
41 |
QStateMachine *sm = new QStateMachine;
|
|
42 |
HsBackupRestoreState *brs = new HsBackupRestoreState;
|
|
43 |
|
|
44 |
sm->addState(brs);
|
|
45 |
sm->setInitialState(brs);
|
|
46 |
|
|
47 |
|
|
48 |
QFinalState *fs = new QFinalState;
|
|
49 |
sm->addState(fs);
|
|
50 |
|
|
51 |
brs->addTransition(this, SIGNAL(finishStateMachine()), fs);
|
|
52 |
|
|
53 |
sm->start();
|
101
|
54 |
QCoreApplication::sendPostedEvents(sm,0);
|
90
|
55 |
emit finishStateMachine();
|
|
56 |
|
|
57 |
sm->stop();
|
|
58 |
// main window deleted -> HsGui must be deleted also
|
|
59 |
delete HsGui::takeInstance();
|
|
60 |
delete sm;
|
|
61 |
}
|