|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @test |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 #if (!defined __T_NONNATIVEAPPSTEP_H__) |
|
25 #define __T_NONNATIVEAPPSTEP_H__ |
|
26 |
|
27 #include <APASERVERAPP.H> |
|
28 #include <EIKSERVERAPP.H> |
|
29 |
|
30 #include "ApparcTestServer.h" |
|
31 |
|
32 // RTstFileArray |
|
33 |
|
34 class RTstFileArray |
|
35 { |
|
36 public: |
|
37 RTstFileArray(TInt aGranularity); |
|
38 void Close(); |
|
39 void AppendL(const TDesC& aFullFileName, const TDesC8& aExpectedDataType); |
|
40 inline TInt Count() const {return iFileArray.Count();} |
|
41 void Get(TPtrC& aFullFileName, TPtrC8& aExpectedDataType, TInt aIndex) const; |
|
42 private: |
|
43 struct SFile |
|
44 { |
|
45 HBufC* iFullFileName; |
|
46 HBufC8* iExpectedDataType; |
|
47 }; |
|
48 private: |
|
49 RArray<SFile> iFileArray; |
|
50 }; |
|
51 |
|
52 |
|
53 // RTstAppService |
|
54 |
|
55 class RTstAppService : public RApaAppServiceBase |
|
56 { |
|
57 public: |
|
58 static TInt DoTestL(TUid aServiceUid, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath); |
|
59 private: |
|
60 RTstAppService(TUid aServiceUid); |
|
61 void ConnectL(); |
|
62 void ReceiveTestResult(TRequestStatus& aRequestStatus, TBool aPassingFileByHandle, const TDesC& aFileNameWithoutDriveOrPath); |
|
63 // from RApaAppServiceBase |
|
64 virtual TUid ServiceUid() const; |
|
65 private: |
|
66 const TUid iServiceUid; |
|
67 }; |
|
68 |
|
69 |
|
70 |
|
71 // CT_NonNativeApps test class. |
|
72 |
|
73 class CT_NonNativeAppsStep : public CTestStep |
|
74 { |
|
75 public: |
|
76 CT_NonNativeAppsStep(); |
|
77 ~CT_NonNativeAppsStep(); |
|
78 |
|
79 virtual TVerdict doTestStepPreambleL(); |
|
80 virtual TVerdict doTestStepPostambleL(); |
|
81 virtual TVerdict doTestStepL(); |
|
82 |
|
83 private: |
|
84 HBufC8* OpenFileAndReadBufferLC(RApaLsSession& aApparcServer, RFs& aFileServer, const TDesC& aFullFileName); |
|
85 void OpenFileAndSetFilePositionToSomewhereUnusualLC(RFile& aFile, TInt& aFilePosition, RFs& aFileServer, const TDesC& aFullFileName); |
|
86 void TestFilePosition(RFile& aFile, TInt aFilePosition); |
|
87 void TestResultsOfAppForDocumentAndServiceL(TUid aServiceUid, TInt aError, const TUid& aAppUid, const TDataType& aDataType, const TDesC8& aExpectedDataType); |
|
88 void CheckPropertyUpdateAndResetL(const TDesC& aExpectedNewValue); |
|
89 void CheckApplicationLaunchesOkayL(RApaLsSession& aApparcServer, const CApaCommandLine& aCommandLine, TAny* aOption); |
|
90 void CheckApplicationFailsToLaunchL(RApaLsSession& aApparcServer, const CApaCommandLine& aCommandLine, TAny* aOption); |
|
91 void WaitForApplistUpdate(RApaLsSession& aApparcServer); |
|
92 private: |
|
93 void TestAppForDocumentL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray); |
|
94 void TestAppForDocumentAndServiceL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray); |
|
95 void TestRecognizingL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray); |
|
96 void TestStartDocumentL(RApaLsSession& aApparcServer, RFs& aFileServer, const RTstFileArray& aFileArray); |
|
97 void TestRegisterNonNativeApplicationL(RApaLsSession& aApparcServer, RFs& aFileServer); |
|
98 void TestGetAppIconForNonNativeL(RApaLsSession& aApparcServer, RFs& aFileServer, CApaRegistrationResourceFileWriter* const aRegistrationResourceFileWriter, CApaLocalisableResourceFileWriter* const aLocalisableResourceFileWriter); |
|
99 void TestCommitNNAppUpdatesL(RApaLsSession& aApparcServer); |
|
100 void TestForceCommitNNAppUpdatesL(RApaLsSession& aApparcServer); |
|
101 void TestForceCommitL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine); |
|
102 void TestRollbackRegistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine); |
|
103 void TestRollbackDeregistrationL(RApaLsSession& aApparcServer, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriter, CApaRegistrationResourceFileWriter& aRegistrationResourceFileWriterB, CApaCommandLine& aNextCommandLine); |
|
104 |
|
105 private: |
|
106 |
|
107 }; |
|
108 |
|
109 |
|
110 _LIT(KT_NonNativeAppsStep,"T_NonNativeApps"); |
|
111 |
|
112 #endif |