|
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: Test class for taskswitcher::TaskSwitcher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <QtTest/QtTest> |
|
20 #include "afasyncrequestobserver.h" |
|
21 #include "afasyncsession.h" |
|
22 |
|
23 class CFbsBitmap; |
|
24 |
|
25 /** |
|
26 * @test Test class |
|
27 */ |
|
28 class T_ActivityClient : public QObject, |
|
29 public MAfAsyncSession, |
|
30 public MAfAsyncRequestObserver |
|
31 { |
|
32 Q_OBJECT |
|
33 public: |
|
34 T_ActivityClient(); |
|
35 ~T_ActivityClient(); |
|
36 |
|
37 public: //MAfAsyncRequestObserver |
|
38 void waitActivityRequestCompleted(int result, |
|
39 const TDesC8 &data); |
|
40 |
|
41 void getThumbnailRequestCompleted(int result, |
|
42 int bitmapHandle, |
|
43 void* userData); |
|
44 |
|
45 void dataChangeNotificationCompleted(int result); |
|
46 |
|
47 public: //MAfAsyncSession |
|
48 void PushL(CBase* asyncTask); |
|
49 void Pop(CBase* asyncTask); |
|
50 void executeL(int function); |
|
51 void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status); |
|
52 void getDataL(int id, TDes8& buffer); |
|
53 |
|
54 private slots: |
|
55 void initTestCase(); |
|
56 void cleanupTestCase(); |
|
57 |
|
58 void testEntry(); |
|
59 void testAsyncRequest(); |
|
60 void testCreateClient(); |
|
61 void testAddActivity(); |
|
62 void testUpdateActivity(); |
|
63 void testSaveActivity(); |
|
64 void testRemoveActivity(); |
|
65 void testRemoveApplicationActivities(); |
|
66 void testActivities(); |
|
67 void testApplicationActivities(); |
|
68 void testGetData(); |
|
69 void testWaitLaunchActivity(); |
|
70 void testGetThumbnail(); |
|
71 |
|
72 private: |
|
73 CFbsBitmap *mBitmap; |
|
74 |
|
75 HBufC *mData; |
|
76 |
|
77 TInt mScreenshotHandle; |
|
78 CFbsBitmap *mScreenshot; |
|
79 |
|
80 CBase *mRunningTask; |
|
81 void *mUserData; |
|
82 int mExpectedResponse; |
|
83 int mRealResponse; |
|
84 QEventLoop mLoop; |
|
85 |
|
86 }; |