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 "t_hsdomainmodel.h"
|
|
19 |
#include "hscontentservice.h"
|
|
20 |
|
|
21 |
// ---------------------------------------------------------------------------
|
|
22 |
// ---------------------------------------------------------------------------
|
|
23 |
//
|
|
24 |
void TestHsDomainModel::testCreateNDeleteWidget()
|
|
25 |
{
|
|
26 |
createSceneWithPages();
|
|
27 |
|
|
28 |
HsContentService contentService;
|
|
29 |
|
|
30 |
QVariantHash params;
|
|
31 |
|
|
32 |
params["uri"]= "invalidmockwidgetplugin";
|
|
33 |
QVERIFY(!contentService.createWidget(params));
|
|
34 |
|
|
35 |
//this has to be uri1 because of mocked factory
|
|
36 |
params["uri"]= "mockwidgetplugin";
|
|
37 |
QVERIFY(contentService.createWidget(params));
|
|
38 |
|
|
39 |
QVERIFY(!HsContentService::instance()->addWidget(QString(), QVariantHash()));
|
|
40 |
|
|
41 |
destroySceneAndPages();
|
|
42 |
}
|
|
43 |
|
|
44 |
void TestHsDomainModel::testContentServiceStaticInterface()
|
|
45 |
{
|
|
46 |
QVERIFY(HsContentService::instance());
|
|
47 |
}
|
|
48 |
|
|
49 |
|
|
50 |
void TestHsDomainModel::testContentServiceWidgetCount()
|
|
51 |
{
|
|
52 |
createSceneWithPages();
|
|
53 |
HsContentService *contentService = HsContentService::instance();
|
|
54 |
QVERIFY(contentService);
|
|
55 |
int count = 0;
|
|
56 |
QVERIFY(contentService->widgets("testing", QVariantHash(), count));
|
|
57 |
|
|
58 |
|
|
59 |
}
|