|
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 "t_tsdocumentloader.h" |
|
19 |
|
20 #include <QtTest/QtTest> |
|
21 #include <QGraphicsWidget> |
|
22 |
|
23 #include "tsdocumentloader.h" |
|
24 |
|
25 void T_TsDocumentLoader::initTestCase() |
|
26 { |
|
27 mDocumentLoader = new TsDocumentLoader(); |
|
28 bool ok(false); |
|
29 mDocumentLoader->load(":/resource/test.docml", &ok); |
|
30 QVERIFY(ok); |
|
31 } |
|
32 |
|
33 void T_TsDocumentLoader::cleanupTestCase() |
|
34 { |
|
35 delete mDocumentLoader; |
|
36 mDocumentLoader = NULL; |
|
37 } |
|
38 |
|
39 void T_TsDocumentLoader::taskGridIsCreated() |
|
40 { |
|
41 QGraphicsWidget *grid = mDocumentLoader->findWidget("grid"); |
|
42 QVERIFY(grid); |
|
43 QCOMPARE(grid->metaObject()->className(), "TsTasksGrid"); |
|
44 } |
|
45 |
|
46 void T_TsDocumentLoader::taskSwitcherGridItemIsCreated() |
|
47 { |
|
48 QGraphicsWidget *item = mDocumentLoader->findWidget("item"); |
|
49 QVERIFY(item); |
|
50 QCOMPARE(item->metaObject()->className(), "TsTasksGridItem"); |
|
51 } |
|
52 |
|
53 void T_TsDocumentLoader::noItemsLabelIsCreated() |
|
54 { |
|
55 QGraphicsWidget *noItemsLabel = mDocumentLoader->findWidget("noitemslabel"); |
|
56 QVERIFY(noItemsLabel); |
|
57 QCOMPARE(noItemsLabel->metaObject()->className(), "TsNoItemsLabel"); |
|
58 } |
|
59 |
|
60 void T_TsDocumentLoader::baseClassIsUsedForOtherTypes() |
|
61 { |
|
62 QGraphicsWidget *hbwidget = mDocumentLoader->findWidget("hbwidget"); |
|
63 QVERIFY(hbwidget); |
|
64 QCOMPARE(hbwidget->metaObject()->className(), "HbWidget"); |
|
65 } |
|
66 |
|
67 QTEST_MAIN(T_TsDocumentLoader) |