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 |
|
19 #include "ut_lcvideowidget.h" |
|
20 #include "ut_lcuidefs.h" |
|
21 #include "lcvideowidget.h" |
|
22 #include <QtTest/QtTest> |
|
23 #include <hbmainwindow.h> |
|
24 #include <QPainter> |
|
25 #include <QStyleOptionGraphicsItem> |
|
26 |
|
27 void UT_LcVideoWidget::initTestCase() |
|
28 { |
|
29 } |
|
30 |
|
31 void UT_LcVideoWidget::cleanupTestCase() |
|
32 { |
|
33 } |
|
34 |
|
35 |
|
36 void UT_LcVideoWidget::init() |
|
37 { |
|
38 mVideoWidget = new LcVideoWidget(); |
|
39 mVideoWidget2 = new LcVideoWidget(0,false); |
|
40 } |
|
41 |
|
42 void UT_LcVideoWidget::cleanup() |
|
43 { |
|
44 delete mVideoWidget; |
|
45 delete mVideoWidget2; |
|
46 } |
|
47 |
|
48 void UT_LcVideoWidget::testConstructor() |
|
49 { |
|
50 QVERIFY( mVideoWidget ); |
|
51 QVERIFY( mVideoWidget->isShowingVideo() ); |
|
52 QVERIFY( mVideoWidget2 ); |
|
53 QVERIFY( !mVideoWidget2->isShowingVideo() ); |
|
54 } |
|
55 |
|
56 void UT_LcVideoWidget::testSetShowVideo() |
|
57 { |
|
58 QVERIFY( mVideoWidget->isShowingVideo() ); |
|
59 mVideoWidget->setShowVideo(false); |
|
60 QVERIFY( !mVideoWidget->isShowingVideo() ); |
|
61 mVideoWidget->setShowVideo(true); |
|
62 QVERIFY( mVideoWidget->isShowingVideo() ); |
|
63 } |
|
64 |
|
65 void UT_LcVideoWidget::testPaint() |
|
66 { |
|
67 QPainter painter; |
|
68 QStyleOptionGraphicsItem style; |
|
69 mVideoWidget->setPos(QPointF(10,100)); |
|
70 mVideoWidget->paint(&painter,&style,0); |
|
71 mVideoWidget2->paint(&painter,&style,0); |
|
72 } |
|
73 |
|