homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsrootstate.cpp
equal
deleted
inserted
replaced
|
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 "t_hshomescreenstateplugin.h" |
|
21 #include "hsrootstate.h" |
|
22 #include "hsscene.h" |
|
23 |
|
24 void HomeScreenStatePluginTest::testLoadRootStateConstructors() |
|
25 { |
|
26 HsRootState *rs = new HsRootState; |
|
27 delete rs; |
|
28 } |
|
29 |
|
30 void HomeScreenStatePluginTest::testLoadRootStateOnEntryExit() |
|
31 { |
|
32 HsRootState *rs = new HsRootState; |
|
33 |
|
34 QStateMachine *sm = new QStateMachine; |
|
35 sm->addState(rs); |
|
36 sm->setInitialState(rs); |
|
37 |
|
38 QFinalState *fs = new QFinalState; |
|
39 sm->addState(fs); |
|
40 |
|
41 rs->addTransition(this, SIGNAL(finishStateMachine()), fs); |
|
42 |
|
43 sm->start(); |
|
44 QCoreApplication::sendPostedEvents(); |
|
45 emit finishStateMachine(); |
|
46 |
|
47 sm->stop(); |
|
48 delete sm; |
|
49 } |