|
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: Main test class for hspluginmodel library. |
|
15 * |
|
16 */ |
|
17 #include "t_caclient.h" |
|
18 #include "caservice.h" |
|
19 #include "caquery.h" |
|
20 #include <sacls.h> |
|
21 #include <connect/sbdefs.h> |
|
22 |
|
23 #ifdef Q_OS_SYMBIAN |
|
24 //s60 |
|
25 #include <e32base.h> |
|
26 //#include <> |
|
27 #include <W32STD.H> |
|
28 #include <APGTASK.H> |
|
29 |
|
30 #include "t_caclient.h" |
|
31 #include "cabackupnotifier.h" |
|
32 #include "castorageproxy.h" |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 void TestCaClient::TestCreateBackupNotifier() |
|
38 { |
|
39 QScopedPointer<CCaStorageProxy> proxy( CCaStorageProxy::NewL() ) ; |
|
40 QScopedPointer<CCaBackupNotifier> notifier( CCaBackupNotifier::NewL( proxy.data() ) ); |
|
41 |
|
42 QVERIFY( notifier ); |
|
43 |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 void TestCaClient::TestBackupNotifierRunL() |
|
50 { |
|
51 QScopedPointer<CCaStorageProxy> proxy( CCaStorageProxy::NewL() ); |
|
52 QScopedPointer<CCaBackupNotifier> notifier( CCaBackupNotifier::NewL( proxy.data() ) ); |
|
53 |
|
54 TUid KUidMyCat={0x101aaaa6}; |
|
55 RProperty::Define(KUidMyCat, 0, RProperty::EInt, 0); |
|
56 |
|
57 notifier->Cancel(); |
|
58 notifier->iProperty.Attach(KUidMyCat,0); |
|
59 notifier->iStatus = KRequestPending; |
|
60 notifier->iProperty.Subscribe(notifier->iStatus); |
|
61 notifier->SetActive(); |
|
62 |
|
63 RProperty::Set(KUidMyCat, 0, conn::EBURRestorePartial); |
|
64 QTest::qWait(5000); |
|
65 |
|
66 QVERIFY( notifier->iLastState == CCaBackupNotifier::ECaRestore ); |
|
67 |
|
68 } |
|
69 |
|
70 |
|
71 #endif //Q_OS_SYMBIAN |