3
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 - 2007 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 the License "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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
// [INCLUDE FILES] - do not remove
|
|
21 |
#include <e32svr.h>
|
|
22 |
#include <StifParser.h>
|
|
23 |
#include <Stiftestinterface.h>
|
|
24 |
#include "BrCtlApiTest.h"
|
|
25 |
|
|
26 |
#define RETURN_FAILURE_ON_ERROR \
|
|
27 |
if ( err ) \
|
|
28 |
{ \
|
|
29 |
return KErrNone; \
|
|
30 |
}
|
|
31 |
|
|
32 |
// ============================= LOCAL FUNCTIONS ===============================
|
|
33 |
|
|
34 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
35 |
|
|
36 |
// -----------------------------------------------------------------------------
|
|
37 |
// CBrowserControlApiTest::Delete
|
|
38 |
// Delete here all resources allocated and opened from test methods.
|
|
39 |
// Called from destructor.
|
|
40 |
// -----------------------------------------------------------------------------
|
|
41 |
//
|
|
42 |
void CBrowserControlApiTest::Delete()
|
|
43 |
{
|
|
44 |
}
|
|
45 |
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
// CBrowserControlApiTest::RunMethodL
|
|
48 |
// Run specified method. Contains also table of test mothods and their names.
|
|
49 |
// -----------------------------------------------------------------------------
|
|
50 |
//
|
|
51 |
TInt CBrowserControlApiTest::RunMethodL(CStifItemParser& aItem )
|
|
52 |
{
|
|
53 |
|
|
54 |
static TStifFunctionInfo const KFunctions[] =
|
|
55 |
{
|
|
56 |
// Copy this line for every implemented function.
|
|
57 |
// First string is the function name used in TestScripter script file.
|
|
58 |
// Second is the actual implementation member function.
|
|
59 |
ENTRY( "Example", CBrowserControlApiTest::ExampleL ),
|
|
60 |
ENTRY( "CreateBrowserControl", CBrowserControlApiTest::CreateBrCtlL ),
|
|
61 |
ENTRY( "DestroyBrowserControl", CBrowserControlApiTest::DestroyBrowserControlL ),
|
|
62 |
ENTRY( "ZoomLevels", CBrowserControlApiTest::ZoomLevels ),
|
|
63 |
ENTRY( "HandleCommand", CBrowserControlApiTest::HandleCommandL ),
|
|
64 |
ENTRY( "SavedPage", CBrowserControlApiTest::SavedPageL ),
|
|
65 |
ENTRY( "LoadData", CBrowserControlApiTest::LoadData ),
|
|
66 |
ENTRY( "CertInfo", CBrowserControlApiTest::CertInfo ),
|
|
67 |
ENTRY( "NavigationAvailable", CBrowserControlApiTest::NavigationAvailable ),
|
|
68 |
ENTRY( "PageInfo", CBrowserControlApiTest::PageInfo ),
|
|
69 |
ENTRY( "EmptyCache", CBrowserControlApiTest::EmptyCache ),
|
|
70 |
ENTRY( "GetBitmapData", CBrowserControlApiTest::GetBitmapData ),
|
|
71 |
ENTRY( "SaveToFile", CBrowserControlApiTest::SaveToFile ),
|
|
72 |
ENTRY( "OkToExit", CBrowserControlApiTest::OkToExit ),
|
|
73 |
ENTRY( "FindKeyword", CBrowserControlApiTest::FindKeyword ),
|
|
74 |
ENTRY( "MinimumSize", CBrowserControlApiTest::MinimumSize ),
|
|
75 |
ENTRY( "OfferKeyEvent", CBrowserControlApiTest::OfferKeyEvent ),
|
|
76 |
ENTRY( "BrCtlSubscribeToMenuItems", CBrowserControlApiTest::BrCtlSubscribeToMenuItemsL ),
|
|
77 |
ENTRY( "ContentSize", CBrowserControlApiTest::ContentSize ),
|
|
78 |
ENTRY( "BrCtlSettings", CBrowserControlApiTest::BrCtlSettings ),
|
|
79 |
ENTRY( "FocusedImage", CBrowserControlApiTest::FocusedImage ),
|
|
80 |
ENTRY( "CommandObserver", CBrowserControlApiTest::CommandObserver ),
|
|
81 |
ENTRY( "FocusedElementType", CBrowserControlApiTest::FocusedElementType ),
|
|
82 |
ENTRY( "BrCtlSetParam", CBrowserControlApiTest::BrCtlSetParam ),
|
|
83 |
ENTRY( "SetSelfDownloadContentTypes", CBrowserControlApiTest::SetSelfDownloadContentTypes ),
|
|
84 |
ENTRY( "AddOptionMenuItems", CBrowserControlApiTest::AddOptionMenuItems ),
|
|
85 |
ENTRY( "BrCtlInitLoadData", CBrowserControlApiTest::BrCtlInitLoadData ),
|
|
86 |
ENTRY( "HandleDownloadCommand", CBrowserControlApiTest::HandleDownloadCommand ),
|
|
87 |
ENTRY( "VersionInfo", CBrowserControlApiTest::VersionInfo ),
|
|
88 |
ENTRY( "WmlOptionMenuItems", CBrowserControlApiTest::WmlOptionMenuItems ),
|
|
89 |
ENTRY( "ImageCount", CBrowserControlApiTest::ImageCount),
|
|
90 |
ENTRY( "PostUrl", CBrowserControlApiTest::PostUrlL),
|
|
91 |
// Added for Widget Extension Test
|
|
92 |
ENTRY( "CreateBrCtlWithWidgetExtension", CBrowserControlApiTest::CreateBrCtlWithWidgetExtensionL),
|
|
93 |
ENTRY( "HistoryHandler", CBrowserControlApiTest::TestHistoryHandlerL ),
|
|
94 |
ENTRY( "WMLLoad", CBrowserControlApiTest::TestWMLLoadL )
|
|
95 |
};
|
|
96 |
|
|
97 |
const TInt count = sizeof( KFunctions ) /
|
|
98 |
sizeof( TStifFunctionInfo );
|
|
99 |
|
|
100 |
// TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem );
|
|
101 |
// TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests );
|
|
102 |
// TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );
|
|
103 |
|
|
104 |
return RunInternalL( KFunctions, count, aItem );
|
|
105 |
}
|
|
106 |
|
|
107 |
// -----------------------------------------------------------------------------
|
|
108 |
// CBrowserControlApiTest::ExampleL
|
|
109 |
// Example test method function.
|
|
110 |
// (other items were commented in a header).
|
|
111 |
// -----------------------------------------------------------------------------
|
|
112 |
//
|
|
113 |
TInt CBrowserControlApiTest::ExampleL( CStifItemParser& aItem )
|
|
114 |
{
|
|
115 |
|
|
116 |
// Print to UI
|
|
117 |
_LIT( KMyExample, "MyExample" );
|
|
118 |
_LIT( KExample, "In ExampleL" );
|
|
119 |
TestModuleIf().Printf( 0, KMyExample, KExample );
|
|
120 |
// Print to log file
|
|
121 |
iLog->Log( KExample );
|
|
122 |
|
|
123 |
TInt i = 0;
|
|
124 |
TPtrC string;
|
|
125 |
_LIT( KParam, "Param[%i]: %S" );
|
|
126 |
while ( aItem.GetNextString ( string ) == KErrNone )
|
|
127 |
{
|
|
128 |
TestModuleIf().Printf( i, KMyExample,
|
|
129 |
KParam, i, &string );
|
|
130 |
i++;
|
|
131 |
}
|
|
132 |
|
|
133 |
// test block
|
|
134 |
return KErrNone;
|
|
135 |
}
|
|
136 |
|
|
137 |
// -----------------------------------------------------------------------------
|
|
138 |
// CBrowserControlApiTest::CreateBrCtlL
|
|
139 |
// Creates a browser control contained within iBrCtlTestContainer
|
|
140 |
// -----------------------------------------------------------------------------
|
|
141 |
//
|
|
142 |
TInt CBrowserControlApiTest::CreateBrCtlL(
|
|
143 |
CStifItemParser& aItem )
|
|
144 |
{
|
|
145 |
TInt err( KErrNone );
|
|
146 |
TInt aBrCtlConfig = 0x0000;
|
|
147 |
|
|
148 |
TPtrC string;
|
|
149 |
|
|
150 |
TPoint base( 0, 0 );
|
|
151 |
TPoint extent( 252, 195 );
|
|
152 |
TRect rect( base, extent );
|
|
153 |
|
|
154 |
|
|
155 |
// To test for different configurations of the Browser control
|
|
156 |
|
|
157 |
while ( aItem.GetNextString ( string ) == KErrNone )
|
|
158 |
{
|
|
159 |
if ( string.Compare(_L("DisplayScrollBar"))==0)
|
|
160 |
{
|
|
161 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityDisplayScrollBar;
|
|
162 |
}
|
|
163 |
if ( string.Compare(_L("ClientResolveEmbeddedURL"))==0)
|
|
164 |
{
|
|
165 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityClientResolveEmbeddedURL;
|
|
166 |
}
|
|
167 |
if ( string.Compare(_L("ClientNotifyURL"))==0)
|
|
168 |
{
|
|
169 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityClientNotifyURL ;
|
|
170 |
}
|
|
171 |
if ( string.Compare(_L("DisableInputAndPlugins"))==0)
|
|
172 |
{
|
|
173 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityDisableInputAndPlugins;
|
|
174 |
}
|
|
175 |
if ( string.Compare(_L("FindItem"))==0)
|
|
176 |
{
|
|
177 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityFindItem;
|
|
178 |
}
|
|
179 |
if ( string.Compare(_L("LoadHttpFw"))==0)
|
|
180 |
{
|
|
181 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityLoadHttpFw;
|
|
182 |
}
|
|
183 |
if ( string.Compare(_L("SavedPage"))==0)
|
|
184 |
{
|
|
185 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilitySavedPage;
|
|
186 |
}
|
|
187 |
if ( string.Compare(_L("GraphicalHistory"))==0)
|
|
188 |
{
|
|
189 |
aBrCtlConfig = aBrCtlConfig | TBrCtlDefs::ECapabilityGraphicalHistory;
|
|
190 |
}
|
|
191 |
|
|
192 |
}
|
|
193 |
|
|
194 |
if ( aBrCtlConfig == 0x0000 )
|
|
195 |
aBrCtlConfig = TBrCtlDefs::ECapabilityDisplayScrollBar |
|
|
196 |
TBrCtlDefs::ECapabilityClientResolveEmbeddedURL |
|
|
197 |
TBrCtlDefs::ECapabilityLoadHttpFw |
|
|
198 |
TBrCtlDefs::ECapabilitySavedPage |
|
|
199 |
TBrCtlDefs::ECapabilityDisplayScrollBar ;
|
|
200 |
|
|
201 |
TRAP( err,
|
|
202 |
iBrCtlTestContainer = new (ELeave) CBrCtlApiTestContainer;
|
|
203 |
iBrCtlTestContainer->ConstructL( rect );
|
|
204 |
iBrCtlTestContainer->CreateBrowserControlInterfaceL(aBrCtlConfig);
|
|
205 |
);
|
|
206 |
|
|
207 |
if ( err )
|
|
208 |
{
|
|
209 |
delete iBrCtlTestContainer;
|
|
210 |
iBrCtlTestContainer = 0;
|
|
211 |
return KErrNone;
|
|
212 |
}
|
|
213 |
|
|
214 |
// Great, now set the focus of the browser control
|
|
215 |
iBrCtlTestContainer->SetFocus();
|
|
216 |
iBrCtlTestContainer->DrawNow();
|
|
217 |
|
|
218 |
// test block executed
|
|
219 |
return KErrNone;
|
|
220 |
}
|
|
221 |
|
|
222 |
// -----------------------------------------------------------------------------
|
|
223 |
// CBrowserControlApiTest::DestroyBrowserControlL
|
|
224 |
// Deletes iBrCtlTestContainer which causes the browser control to be deleted.
|
|
225 |
// -----------------------------------------------------------------------------
|
|
226 |
//
|
|
227 |
TInt CBrowserControlApiTest::DestroyBrowserControlL(
|
|
228 |
CStifItemParser& /* aItem */ )
|
|
229 |
{
|
|
230 |
delete iBrCtlTestContainer;
|
|
231 |
iBrCtlTestContainer = 0;
|
|
232 |
|
|
233 |
// test block executed
|
|
234 |
return KErrNone;
|
|
235 |
}
|
|
236 |
|
|
237 |
// -----------------------------------------------------------------------------
|
|
238 |
// CBrowserControlApiTest::ZoomLevels
|
|
239 |
// BC Test that ZoomLevels() works.
|
|
240 |
// -----------------------------------------------------------------------------
|
|
241 |
//
|
|
242 |
TInt CBrowserControlApiTest::ZoomLevels( CStifItemParser& /* aItem */ )
|
|
243 |
{
|
|
244 |
if ( iBrCtlTestContainer )
|
|
245 |
{
|
|
246 |
iBrCtlTestContainer->ZoomLevels();
|
|
247 |
}
|
|
248 |
|
|
249 |
// test executed
|
|
250 |
return KErrNone;
|
|
251 |
}
|
|
252 |
|
|
253 |
// -----------------------------------------------------------------------------
|
|
254 |
// CBrowserControlApiTest::HandleCommandL
|
|
255 |
// BC Test that all browser commands work.
|
|
256 |
// -----------------------------------------------------------------------------
|
|
257 |
//
|
|
258 |
TInt CBrowserControlApiTest::HandleCommandL( CStifItemParser& aItem )
|
|
259 |
{
|
|
260 |
TPtrC string;
|
|
261 |
if ( iBrCtlTestContainer )
|
|
262 |
if ( aItem.GetNextString ( string ) == KErrNone )
|
|
263 |
{
|
|
264 |
if (string.Compare(_L("Disconnect1"))==0)
|
|
265 |
{
|
|
266 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandDisconnect ) );
|
|
267 |
RETURN_FAILURE_ON_ERROR
|
|
268 |
}
|
|
269 |
if (string.Compare(_L("CancelFetch"))==0)
|
|
270 |
{
|
|
271 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandCancelFetch ) );
|
|
272 |
RETURN_FAILURE_ON_ERROR
|
|
273 |
}
|
|
274 |
if (string.Compare(_L("Open"))==0)
|
|
275 |
{
|
|
276 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandOpen ) );
|
|
277 |
RETURN_FAILURE_ON_ERROR
|
|
278 |
}
|
|
279 |
if (string.Compare(_L("Reload"))==0)
|
|
280 |
{
|
|
281 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandReload ) );
|
|
282 |
RETURN_FAILURE_ON_ERROR
|
|
283 |
}
|
|
284 |
if (string.Compare(_L("Back"))==0)
|
|
285 |
{
|
|
286 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandBack ) );
|
|
287 |
RETURN_FAILURE_ON_ERROR
|
|
288 |
}
|
|
289 |
if (string.Compare(_L("Forward"))==0)
|
|
290 |
{
|
|
291 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandForward ) );
|
|
292 |
RETURN_FAILURE_ON_ERROR
|
|
293 |
}
|
|
294 |
if (string.Compare(_L("ClearHistory"))==0)
|
|
295 |
{
|
|
296 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandClearHistory ) );
|
|
297 |
RETURN_FAILURE_ON_ERROR
|
|
298 |
}
|
|
299 |
if (string.Compare(_L("ShowHistory"))==0)
|
|
300 |
{
|
|
301 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowHistory ) );
|
|
302 |
RETURN_FAILURE_ON_ERROR
|
|
303 |
}
|
|
304 |
if (string.Compare(_L("Disconnect2"))==0)
|
|
305 |
{
|
|
306 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandDisconnect ) );
|
|
307 |
RETURN_FAILURE_ON_ERROR
|
|
308 |
}
|
|
309 |
if (string.Compare(_L("Accept"))==0)
|
|
310 |
{
|
|
311 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandAccept ) );
|
|
312 |
RETURN_FAILURE_ON_ERROR
|
|
313 |
}
|
|
314 |
if (string.Compare(_L("Cancel"))==0)
|
|
315 |
{
|
|
316 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandCancel ) );
|
|
317 |
RETURN_FAILURE_ON_ERROR
|
|
318 |
}
|
|
319 |
if (string.Compare(_L("OpenToViewer1"))==0)
|
|
320 |
{
|
|
321 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandOpenToViewer ) );
|
|
322 |
RETURN_FAILURE_ON_ERROR
|
|
323 |
}
|
|
324 |
if (string.Compare(_L("AddToPhoneBook"))==0)
|
|
325 |
{
|
|
326 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandAddToPhoneBook ) );
|
|
327 |
RETURN_FAILURE_ON_ERROR
|
|
328 |
}
|
|
329 |
if (string.Compare(_L("MakeCall"))==0)
|
|
330 |
{
|
|
331 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandMakeCall ) );
|
|
332 |
RETURN_FAILURE_ON_ERROR
|
|
333 |
}
|
|
334 |
if (string.Compare(_L("RemoveFileName"))==0)
|
|
335 |
{
|
|
336 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandRemoveFileName ) );
|
|
337 |
RETURN_FAILURE_ON_ERROR
|
|
338 |
}
|
|
339 |
if (string.Compare(_L("ShowImages"))==0)
|
|
340 |
{
|
|
341 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowImages ) );
|
|
342 |
RETURN_FAILURE_ON_ERROR
|
|
343 |
}
|
|
344 |
if (string.Compare(_L("LoadImages"))==0)
|
|
345 |
{
|
|
346 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandLoadImages ) );
|
|
347 |
RETURN_FAILURE_ON_ERROR
|
|
348 |
}
|
|
349 |
if (string.Compare(_L("GainFocus"))==0)
|
|
350 |
{
|
|
351 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandGainFocus ) );
|
|
352 |
RETURN_FAILURE_ON_ERROR
|
|
353 |
}
|
|
354 |
if (string.Compare(_L("LoseFocus"))==0)
|
|
355 |
{
|
|
356 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandLoseFocus ) );
|
|
357 |
RETURN_FAILURE_ON_ERROR
|
|
358 |
}
|
|
359 |
if (string.Compare(_L("FindItem"))==0)
|
|
360 |
{
|
|
361 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFindItem ) );
|
|
362 |
RETURN_FAILURE_ON_ERROR
|
|
363 |
}
|
|
364 |
if (string.Compare(_L("FindItemPhoneNumber"))==0)
|
|
365 |
{
|
|
366 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFindItemPhoneNumber ) );
|
|
367 |
RETURN_FAILURE_ON_ERROR
|
|
368 |
}
|
|
369 |
if (string.Compare(_L("FindItemEMail"))==0)
|
|
370 |
{
|
|
371 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFindItemEMail ) );
|
|
372 |
RETURN_FAILURE_ON_ERROR
|
|
373 |
}
|
|
374 |
if (string.Compare(_L("FindItemAddress"))==0)
|
|
375 |
{
|
|
376 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFindItemAddress ) );
|
|
377 |
RETURN_FAILURE_ON_ERROR
|
|
378 |
}
|
|
379 |
if (string.Compare(_L("FindKeyword"))==0)
|
|
380 |
{
|
|
381 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFindKeyword ) );
|
|
382 |
RETURN_FAILURE_ON_ERROR
|
|
383 |
}
|
|
384 |
if (string.Compare(_L("ClearFind"))==0)
|
|
385 |
{
|
|
386 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandClearFind ) );
|
|
387 |
RETURN_FAILURE_ON_ERROR
|
|
388 |
}
|
|
389 |
if (string.Compare(_L("ShowThumbnailView"))==0)
|
|
390 |
{
|
|
391 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowThumbnailView ) );
|
|
392 |
RETURN_FAILURE_ON_ERROR
|
|
393 |
}
|
|
394 |
if (string.Compare(_L("OneStepBack"))==0)
|
|
395 |
{
|
|
396 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandOneStepBack ) );
|
|
397 |
RETURN_FAILURE_ON_ERROR
|
|
398 |
}
|
|
399 |
if (string.Compare(_L("ShowHistory"))==0)
|
|
400 |
{
|
|
401 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowHistory ) );
|
|
402 |
RETURN_FAILURE_ON_ERROR
|
|
403 |
}
|
|
404 |
if (string.Compare(_L("AppForeground"))==0)
|
|
405 |
{
|
|
406 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandAppForeground ) );
|
|
407 |
RETURN_FAILURE_ON_ERROR
|
|
408 |
}
|
|
409 |
if (string.Compare(_L("AppBackground"))==0)
|
|
410 |
{
|
|
411 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandAppBackground ) );
|
|
412 |
RETURN_FAILURE_ON_ERROR
|
|
413 |
}
|
|
414 |
if (string.Compare(_L("OpenNewWindow"))==0)
|
|
415 |
{
|
|
416 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandOpenNewWindow ) );
|
|
417 |
RETURN_FAILURE_ON_ERROR
|
|
418 |
}
|
|
419 |
if (string.Compare(_L("OpenToViewer2"))==0)
|
|
420 |
{
|
|
421 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandOpenToViewer ) );
|
|
422 |
RETURN_FAILURE_ON_ERROR
|
|
423 |
}
|
|
424 |
if (string.Compare(_L("ClearAutoFormFillData"))==0)
|
|
425 |
{
|
|
426 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandClearAutoFormFillData ) );
|
|
427 |
RETURN_FAILURE_ON_ERROR
|
|
428 |
}
|
|
429 |
if (string.Compare(_L("ClearAutoFormFillPasswordData"))==0)
|
|
430 |
{
|
|
431 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandClearAutoFormFillPasswordData ) );
|
|
432 |
RETURN_FAILURE_ON_ERROR
|
|
433 |
}
|
|
434 |
if (string.Compare(_L("RemoveFileName"))==0)
|
|
435 |
{
|
|
436 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandRemoveFileName ) );
|
|
437 |
RETURN_FAILURE_ON_ERROR
|
|
438 |
}
|
|
439 |
if (string.Compare(_L("FreeMemory"))==0)
|
|
440 |
{
|
|
441 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFreeMemory ) );
|
|
442 |
RETURN_FAILURE_ON_ERROR
|
|
443 |
}
|
|
444 |
if (string.Compare(_L("MemoryGood"))==0)
|
|
445 |
{
|
|
446 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandMemoryGood ) );
|
|
447 |
RETURN_FAILURE_ON_ERROR
|
|
448 |
}
|
|
449 |
if (string.Compare(_L("DumpRenderTree"))==0)
|
|
450 |
{
|
|
451 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandDumpRenderTree ) );
|
|
452 |
RETURN_FAILURE_ON_ERROR
|
|
453 |
}
|
|
454 |
if (string.Compare(_L("UnloadWMLEngine"))==0)
|
|
455 |
{
|
|
456 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandUnloadWMLEngine ) );
|
|
457 |
RETURN_FAILURE_ON_ERROR
|
|
458 |
}
|
|
459 |
if (string.Compare(_L("SmartLinkMakeCall"))==0)
|
|
460 |
{
|
|
461 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandSmartLinkMakeCall ) );
|
|
462 |
RETURN_FAILURE_ON_ERROR
|
|
463 |
}
|
|
464 |
if (string.Compare(_L("SmartLinkSendMessage"))==0)
|
|
465 |
{
|
|
466 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandSmartLinkSendMessage ) );
|
|
467 |
RETURN_FAILURE_ON_ERROR
|
|
468 |
}
|
|
469 |
if (string.Compare(_L("SmartLinkAddToPhoneBook"))==0)
|
|
470 |
{
|
|
471 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandSmartLinkAddToPhoneBook ) );
|
|
472 |
RETURN_FAILURE_ON_ERROR
|
|
473 |
}
|
|
474 |
if (string.Compare(_L("ShowToolBar"))==0)
|
|
475 |
{
|
|
476 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowToolBar ) );
|
|
477 |
RETURN_FAILURE_ON_ERROR
|
|
478 |
}
|
|
479 |
if (string.Compare(_L("SmartLinkSendEmail"))==0)
|
|
480 |
{
|
|
481 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandSmartLinkSendEmail ) );
|
|
482 |
RETURN_FAILURE_ON_ERROR
|
|
483 |
}
|
|
484 |
if (string.Compare(_L("UnLoadPluginWindows"))==0)
|
|
485 |
{
|
|
486 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandUnLoadPluginWindows ) );
|
|
487 |
RETURN_FAILURE_ON_ERROR
|
|
488 |
}
|
|
489 |
if (string.Compare(_L("FindItemVoIPAddress"))==0)
|
|
490 |
{
|
|
491 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandFindItemVoIPAddress ) );
|
|
492 |
RETURN_FAILURE_ON_ERROR
|
|
493 |
}
|
|
494 |
if (string.Compare(_L("SmartLinkMakeVoipCall"))==0)
|
|
495 |
{
|
|
496 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandSmartLinkMakeVoipCall ) );
|
|
497 |
RETURN_FAILURE_ON_ERROR
|
|
498 |
}
|
|
499 |
if (string.Compare(_L("ZoomSliderHide"))==0)
|
|
500 |
{
|
|
501 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandZoomSliderHide ) );
|
|
502 |
RETURN_FAILURE_ON_ERROR
|
|
503 |
}
|
|
504 |
if (string.Compare(_L("EnterFullscreenBrowsing"))==0)
|
|
505 |
{
|
|
506 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandEnterFullscreenBrowsing ) );
|
|
507 |
RETURN_FAILURE_ON_ERROR
|
|
508 |
}
|
|
509 |
if (string.Compare(_L("LeaveFullscreenBrowsing"))==0)
|
|
510 |
{
|
|
511 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandLeaveFullscreenBrowsing ) );
|
|
512 |
RETURN_FAILURE_ON_ERROR
|
|
513 |
}
|
|
514 |
if (string.Compare(_L("ShowDownloads"))==0)
|
|
515 |
{
|
|
516 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowDownloads ) );
|
|
517 |
RETURN_FAILURE_ON_ERROR
|
|
518 |
}
|
|
519 |
if (string.Compare(_L("SaveLaunchParams"))==0)
|
|
520 |
{
|
|
521 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandSaveLaunchParams ) );
|
|
522 |
RETURN_FAILURE_ON_ERROR
|
|
523 |
}
|
|
524 |
if (string.Compare(_L("ShowAnchorHref"))==0)
|
|
525 |
{
|
|
526 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandShowAnchorHref ) );
|
|
527 |
RETURN_FAILURE_ON_ERROR
|
|
528 |
}
|
|
529 |
if (string.Compare(_L("LoadFocusedImage"))==0)
|
|
530 |
{
|
|
531 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandLoadFocusedImage ) );
|
|
532 |
RETURN_FAILURE_ON_ERROR
|
|
533 |
}
|
|
534 |
if (string.Compare(_L("ZoomSliderShow"))==0)
|
|
535 |
{
|
|
536 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandZoomSliderShow ) );
|
|
537 |
RETURN_FAILURE_ON_ERROR
|
|
538 |
}
|
|
539 |
if (string.Compare(_L("HistoryNavigateForward"))==0)
|
|
540 |
{
|
|
541 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandHistoryNavigateForward ) );
|
|
542 |
RETURN_FAILURE_ON_ERROR
|
|
543 |
}
|
|
544 |
if (string.Compare(_L("HistoryNavigateBack"))==0)
|
|
545 |
{
|
|
546 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL( TBrCtlDefs::ECommandHistoryNavigateBack ) );
|
|
547 |
RETURN_FAILURE_ON_ERROR
|
|
548 |
}
|
|
549 |
if (string.Compare(_L(""))==0)
|
|
550 |
{
|
|
551 |
TRAPD( err, iBrCtlTestContainer->HandleCommandL(NULL) );
|
|
552 |
RETURN_FAILURE_ON_ERROR
|
|
553 |
}
|
|
554 |
}
|
|
555 |
|
|
556 |
// test block
|
|
557 |
return KErrNone;
|
|
558 |
}
|
|
559 |
|
|
560 |
// -----------------------------------------------------------------------------
|
|
561 |
// CBrowserControlApiTest::LoadData
|
|
562 |
// BC Test that all browser commands work.
|
|
563 |
// -----------------------------------------------------------------------------
|
|
564 |
//
|
|
565 |
TInt CBrowserControlApiTest::LoadData( CStifItemParser& /* aItem */ )
|
|
566 |
{
|
|
567 |
TInt err( KErrNone );
|
|
568 |
if ( iBrCtlTestContainer )
|
|
569 |
{
|
|
570 |
TRAP( err, iBrCtlTestContainer->LoadDataL() );
|
|
571 |
}
|
|
572 |
|
|
573 |
return err;
|
|
574 |
}
|
|
575 |
|
|
576 |
// -----------------------------------------------------------------------------
|
|
577 |
// CBrowserControlApiTest::SavedPageL
|
|
578 |
// BC Test that LoadSavedPageL works.
|
|
579 |
// -----------------------------------------------------------------------------
|
|
580 |
//
|
|
581 |
TInt CBrowserControlApiTest::SavedPageL( CStifItemParser& /* aItem */)
|
|
582 |
{
|
|
583 |
iBrCtlTestContainer->LoadSavedPageL();
|
|
584 |
|
|
585 |
// test executed
|
|
586 |
return KErrNone;
|
|
587 |
}
|
|
588 |
|
|
589 |
// -----------------------------------------------------------------------------
|
|
590 |
// CBrowserControlApiTest::CertInfo
|
|
591 |
// BC Test that CertInfo works.
|
|
592 |
// -----------------------------------------------------------------------------
|
|
593 |
//
|
|
594 |
TInt CBrowserControlApiTest::CertInfo( CStifItemParser& /* aItem */)
|
|
595 |
{
|
|
596 |
if ( iBrCtlTestContainer )
|
|
597 |
{
|
|
598 |
iBrCtlTestContainer->CertInfo();
|
|
599 |
}
|
|
600 |
// test executed
|
|
601 |
return KErrNone;
|
|
602 |
}
|
|
603 |
|
|
604 |
// -----------------------------------------------------------------------------
|
|
605 |
// CBrowserControlApiTest::SetSelfDownloadContentTypes
|
|
606 |
// BC Test that all browser commands work.
|
|
607 |
// -----------------------------------------------------------------------------
|
|
608 |
//
|
|
609 |
TInt CBrowserControlApiTest::SetSelfDownloadContentTypes( CStifItemParser& /* aItem */ )
|
|
610 |
{
|
|
611 |
if ( iBrCtlTestContainer )
|
|
612 |
{
|
|
613 |
iBrCtlTestContainer->SetSelfDownloadContentTypes();
|
|
614 |
}
|
|
615 |
|
|
616 |
// test executed
|
|
617 |
return KErrNone;
|
|
618 |
}
|
|
619 |
|
|
620 |
// -----------------------------------------------------------------------------
|
|
621 |
// CBrowserControlApiTest::NavigationAvailable
|
|
622 |
// BC Test that all browser commands work.
|
|
623 |
// -----------------------------------------------------------------------------
|
|
624 |
//
|
|
625 |
TInt CBrowserControlApiTest::NavigationAvailable( CStifItemParser& /* aItem */)
|
|
626 |
{
|
|
627 |
TInt err = iBrCtlTestContainer->NavigationAvailableTest();
|
|
628 |
RETURN_FAILURE_ON_ERROR
|
|
629 |
|
|
630 |
// Now load first page - still should not be able to go back...
|
|
631 |
TRAP(err, iBrCtlTestContainer->LoadSavedPageL() );
|
|
632 |
RETURN_FAILURE_ON_ERROR
|
|
633 |
err = iBrCtlTestContainer->NavigationAvailableTest();
|
|
634 |
|
|
635 |
// test executed
|
|
636 |
return KErrNone;
|
|
637 |
}
|
|
638 |
|
|
639 |
// -----------------------------------------------------------------------------
|
|
640 |
// CBrowserControlApiTest::PageInfo
|
|
641 |
// BC Test that all browser commands work.
|
|
642 |
// -----------------------------------------------------------------------------
|
|
643 |
//
|
|
644 |
TInt CBrowserControlApiTest::PageInfo( CStifItemParser& aItem )
|
|
645 |
{
|
|
646 |
TPtrC string;
|
|
647 |
if ( iBrCtlTestContainer )
|
|
648 |
if ( aItem.GetNextString ( string ) == KErrNone )
|
|
649 |
{
|
|
650 |
if (string.Compare(_L("Title"))==0)
|
|
651 |
{
|
|
652 |
TRAPD( err, iBrCtlTestContainer->PageInfoLC( TBrCtlDefs::EPageInfoTitle ) );
|
|
653 |
RETURN_FAILURE_ON_ERROR
|
|
654 |
}
|
|
655 |
if (string.Compare(_L("Url"))==0)
|
|
656 |
{
|
|
657 |
TRAPD( err, iBrCtlTestContainer->PageInfoLC( TBrCtlDefs::EPageInfoUrl ) );
|
|
658 |
RETURN_FAILURE_ON_ERROR
|
|
659 |
}
|
|
660 |
if (string.Compare(_L("FocusedNodeUrl"))==0)
|
|
661 |
{
|
|
662 |
TRAPD( err, iBrCtlTestContainer->PageInfoLC( TBrCtlDefs::EPageInfoFocusedNodeUrl ) );
|
|
663 |
RETURN_FAILURE_ON_ERROR
|
|
664 |
}
|
|
665 |
if (string.Compare(_L("Content"))==0)
|
|
666 |
{
|
|
667 |
TRAPD( err, iBrCtlTestContainer->PageInfoLC( TBrCtlDefs::EPageInfoContent ) );
|
|
668 |
RETURN_FAILURE_ON_ERROR
|
|
669 |
}
|
|
670 |
if (string.Compare(_L("SavedPage"))==0)
|
|
671 |
{
|
|
672 |
TRAPD( err, iBrCtlTestContainer->PageInfoLC( TBrCtlDefs::EPageInfoSavedPage ) );
|
|
673 |
RETURN_FAILURE_ON_ERROR
|
|
674 |
}
|
|
675 |
}
|
|
676 |
|
|
677 |
// test executed
|
|
678 |
return KErrNone;
|
|
679 |
}
|
|
680 |
|
|
681 |
// -----------------------------------------------------------------------------
|
|
682 |
// CBrowserControlApiTest::EmptyCache
|
|
683 |
// BC Test that all browser commands work.
|
|
684 |
// -----------------------------------------------------------------------------
|
|
685 |
//
|
|
686 |
TInt CBrowserControlApiTest::EmptyCache( CStifItemParser& /* aItem */ )
|
|
687 |
{
|
|
688 |
if ( iBrCtlTestContainer )
|
|
689 |
{
|
|
690 |
TInt err = iBrCtlTestContainer->ClearCacheTest();
|
|
691 |
RETURN_FAILURE_ON_ERROR
|
|
692 |
TBool inCache = iBrCtlTestContainer->IsUrlInCacheTest( ( TDesC16 & )KUrlLoadTestHtml() );
|
|
693 |
if ( inCache )
|
|
694 |
{
|
|
695 |
return KErrNone;
|
|
696 |
}
|
|
697 |
err = iBrCtlTestContainer->ClearItemInCacheTest();
|
|
698 |
RETURN_FAILURE_ON_ERROR
|
|
699 |
|
|
700 |
// Now try loading a page
|
|
701 |
TRAP( err, iBrCtlTestContainer->LoadDataL() );
|
|
702 |
RETURN_FAILURE_ON_ERROR
|
|
703 |
// Now the url should be in the cache
|
|
704 |
inCache = iBrCtlTestContainer->IsUrlInCacheTest( ( TDesC16 & )KUrlLoadTestHtml() );
|
|
705 |
if ( !inCache )
|
|
706 |
{
|
|
707 |
return KErrNone;
|
|
708 |
}
|
|
709 |
err = iBrCtlTestContainer->ClearItemInCacheTest();
|
|
710 |
RETURN_FAILURE_ON_ERROR
|
|
711 |
// Now the url should expunged from the cache
|
|
712 |
inCache = iBrCtlTestContainer->IsUrlInCacheTest( ( TDesC16 & )KUrlLoadTestHtml() );
|
|
713 |
if ( inCache )
|
|
714 |
{
|
|
715 |
return KErrNone;
|
|
716 |
}
|
|
717 |
}
|
|
718 |
// test executed
|
|
719 |
return KErrNone;
|
|
720 |
}
|
|
721 |
|
|
722 |
// -----------------------------------------------------------------------------
|
|
723 |
// CBrowserControlApiTest::GetBitmapData
|
|
724 |
// BC Test that all browser commands work.
|
|
725 |
// -----------------------------------------------------------------------------
|
|
726 |
//
|
|
727 |
TInt CBrowserControlApiTest::GetBitmapData( CStifItemParser& /* aItem */ )
|
|
728 |
{
|
|
729 |
TRAPD( err, iBrCtlTestContainer->LoadDataL() );
|
|
730 |
RETURN_FAILURE_ON_ERROR
|
|
731 |
|
|
732 |
TRAP( err,
|
|
733 |
if ( iBrCtlTestContainer )
|
|
734 |
{
|
|
735 |
err = iBrCtlTestContainer->GetBitmapData();
|
|
736 |
}
|
|
737 |
)
|
|
738 |
// test executed
|
|
739 |
return err;
|
|
740 |
}
|
|
741 |
|
|
742 |
// -----------------------------------------------------------------------------
|
|
743 |
// CBrowserControlApiTest::SaveToFile
|
|
744 |
// BC Test that all browser commands work.
|
|
745 |
// -----------------------------------------------------------------------------
|
|
746 |
//
|
|
747 |
TInt CBrowserControlApiTest::SaveToFile( CStifItemParser& /* aItem */ )
|
|
748 |
{
|
|
749 |
TInt err( KErrNone );
|
|
750 |
if ( iBrCtlTestContainer )
|
|
751 |
{
|
|
752 |
TRAP( err, iBrCtlTestContainer->SaveToFileL() );
|
|
753 |
}
|
|
754 |
|
|
755 |
return err;
|
|
756 |
}
|
|
757 |
|
|
758 |
// -----------------------------------------------------------------------------
|
|
759 |
// CBrowserControlApiTest::OkToExit
|
|
760 |
// BC Test that all browser commands work.
|
|
761 |
// -----------------------------------------------------------------------------
|
|
762 |
//
|
|
763 |
TInt CBrowserControlApiTest::OkToExit( CStifItemParser& /* aItem */ )
|
|
764 |
{
|
|
765 |
if ( iBrCtlTestContainer )
|
|
766 |
{
|
|
767 |
iBrCtlTestContainer->OkToExit();
|
|
768 |
}
|
|
769 |
|
|
770 |
// test executed
|
|
771 |
return KErrNone;
|
|
772 |
}
|
|
773 |
|
|
774 |
// -----------------------------------------------------------------------------
|
|
775 |
// CBrowserControlApiTest::OfferKeyEvent
|
|
776 |
// BC Test that all browser commands work.
|
|
777 |
// -----------------------------------------------------------------------------
|
|
778 |
//
|
|
779 |
TInt CBrowserControlApiTest::OfferKeyEvent( CStifItemParser& /* aItem */ )
|
|
780 |
{
|
|
781 |
if ( iBrCtlTestContainer )
|
|
782 |
{
|
|
783 |
iBrCtlTestContainer->OfferKeyEvent();
|
|
784 |
}
|
|
785 |
|
|
786 |
// test executed
|
|
787 |
return KErrNone;
|
|
788 |
}
|
|
789 |
|
|
790 |
// -----------------------------------------------------------------------------
|
|
791 |
// CBrowserControlApiTest::MinimumSize
|
|
792 |
// BC Test that all browser commands work.
|
|
793 |
// -----------------------------------------------------------------------------
|
|
794 |
//
|
|
795 |
TInt CBrowserControlApiTest::MinimumSize( CStifItemParser& /* aItem */ )
|
|
796 |
{
|
|
797 |
if ( iBrCtlTestContainer )
|
|
798 |
{
|
|
799 |
iBrCtlTestContainer->BrCtlMinimumSize();
|
|
800 |
}
|
|
801 |
// test executed
|
|
802 |
return KErrNone;
|
|
803 |
}
|
|
804 |
|
|
805 |
// -----------------------------------------------------------------------------
|
|
806 |
// CBrowserControlApiTest::FocusedElementType
|
|
807 |
// BC Test that all browser commands work.
|
|
808 |
// -----------------------------------------------------------------------------
|
|
809 |
//
|
|
810 |
TInt CBrowserControlApiTest::FocusedElementType( CStifItemParser& /* aItem */ )
|
|
811 |
{
|
|
812 |
TInt err( KErrNone );
|
|
813 |
if ( iBrCtlTestContainer )
|
|
814 |
{
|
|
815 |
TRAP( err, err = iBrCtlTestContainer->BrCtlFocusedElementTypeL() );
|
|
816 |
}
|
|
817 |
|
|
818 |
return err;
|
|
819 |
}
|
|
820 |
|
|
821 |
// -----------------------------------------------------------------------------
|
|
822 |
// CBrowserControlApiTest::ContentSize
|
|
823 |
// BC Test that all browser commands work.
|
|
824 |
// -----------------------------------------------------------------------------
|
|
825 |
//
|
|
826 |
TInt CBrowserControlApiTest::ContentSize( CStifItemParser& /* aItem */ )
|
|
827 |
{
|
|
828 |
if ( iBrCtlTestContainer )
|
|
829 |
{
|
|
830 |
iBrCtlTestContainer->BrCtlContentSize();
|
|
831 |
}
|
|
832 |
|
|
833 |
// test executed
|
|
834 |
return KErrNone;
|
|
835 |
}
|
|
836 |
|
|
837 |
// -----------------------------------------------------------------------------
|
|
838 |
// CBrowserControlApiTest::BrCtlSetParam
|
|
839 |
// BC Test that all browser commands work.
|
|
840 |
// -----------------------------------------------------------------------------
|
|
841 |
//
|
|
842 |
TInt CBrowserControlApiTest::BrCtlSetParam( CStifItemParser& /* aItem */ )
|
|
843 |
{
|
|
844 |
if ( iBrCtlTestContainer )
|
|
845 |
{
|
|
846 |
iBrCtlTestContainer->BrCtlSetParam();
|
|
847 |
}
|
|
848 |
// test executed
|
|
849 |
return KErrNone;
|
|
850 |
}
|
|
851 |
|
|
852 |
// -----------------------------------------------------------------------------
|
|
853 |
// CBrowserControlApiTest::BrCtlSubscribeToMenuItemsL
|
|
854 |
// BC Test that all browser commands work.
|
|
855 |
// -----------------------------------------------------------------------------
|
|
856 |
//
|
|
857 |
TInt CBrowserControlApiTest::BrCtlSubscribeToMenuItemsL( CStifItemParser& /* aItem */ )
|
|
858 |
{
|
|
859 |
TInt err( KErrNone );
|
|
860 |
if ( iBrCtlTestContainer )
|
|
861 |
{
|
|
862 |
TRAP(err, err = iBrCtlTestContainer->BrCtlSubscribeToMenuItemsL() );
|
|
863 |
}
|
|
864 |
|
|
865 |
return err;
|
|
866 |
}
|
|
867 |
|
|
868 |
// -----------------------------------------------------------------------------
|
|
869 |
// CBrowserControlApiTest::FocusedImage
|
|
870 |
// BC Test that all browser commands work.
|
|
871 |
// -----------------------------------------------------------------------------
|
|
872 |
//
|
|
873 |
TInt CBrowserControlApiTest::FocusedImage( CStifItemParser& /* aItem */ )
|
|
874 |
{
|
|
875 |
TRAPD( err, err = iBrCtlTestContainer->FocusedImageL() );
|
|
876 |
RETURN_FAILURE_ON_ERROR
|
|
877 |
|
|
878 |
const TInt KExpectedImageCount( 1 );
|
|
879 |
|
|
880 |
TInt actualCount( KErrNotFound );
|
|
881 |
|
|
882 |
TRAP( err, actualCount = iBrCtlTestContainer->ImageCountL() );
|
|
883 |
if ( err || ( actualCount != KExpectedImageCount ) )
|
|
884 |
{
|
|
885 |
return KErrNone;
|
|
886 |
}
|
|
887 |
|
|
888 |
// test executed
|
|
889 |
return KErrNone;
|
|
890 |
}
|
|
891 |
|
|
892 |
// -----------------------------------------------------------------------------
|
|
893 |
// CBrowserControlApiTest::BrCtlSettings
|
|
894 |
// BC Test that all browser commands work.
|
|
895 |
// -----------------------------------------------------------------------------
|
|
896 |
//
|
|
897 |
TInt CBrowserControlApiTest::BrCtlSettings( CStifItemParser& /* aItem */ )
|
|
898 |
{
|
|
899 |
if ( iBrCtlTestContainer )
|
|
900 |
{
|
|
901 |
TRAPD(err,
|
|
902 |
err = iBrCtlTestContainer->SetBrowserSettingL();
|
|
903 |
RETURN_FAILURE_ON_ERROR
|
|
904 |
TUint result = 0;
|
|
905 |
err = iBrCtlTestContainer->BrowserSettingL( result );
|
|
906 |
if ( err || result )
|
|
907 |
{
|
|
908 |
return KErrNone;
|
|
909 |
}
|
|
910 |
) // TRAP
|
|
911 |
}
|
|
912 |
// test executed
|
|
913 |
return KErrNone;
|
|
914 |
}
|
|
915 |
|
|
916 |
// -----------------------------------------------------------------------------
|
|
917 |
// CBrowserControlApiTest::FindKeyword
|
|
918 |
// BC Test that all browser commands work.
|
|
919 |
// -----------------------------------------------------------------------------
|
|
920 |
//
|
|
921 |
TInt CBrowserControlApiTest::FindKeyword( CStifItemParser& aItem )
|
|
922 |
{
|
|
923 |
|
|
924 |
TPtrC html;
|
|
925 |
TPtrC keyword;
|
|
926 |
TInt match;
|
|
927 |
|
|
928 |
TInt err ( KErrNone );
|
|
929 |
|
|
930 |
if ( iBrCtlTestContainer )
|
|
931 |
{
|
|
932 |
|
|
933 |
//if ( aItem.GetNextString ( html ) == KErrNone )
|
|
934 |
if ( (err = aItem.GetNextString ( keyword )) == KErrNone )
|
|
935 |
if ( (err = aItem.GetNextInt ( match )) == KErrNone )
|
|
936 |
{
|
|
937 |
|
|
938 |
}
|
|
939 |
|
|
940 |
err = iBrCtlTestContainer->FindKeyword( html, keyword, match );
|
|
941 |
RETURN_FAILURE_ON_ERROR
|
|
942 |
err = iBrCtlTestContainer->FindKeywordAgain( match );
|
|
943 |
RETURN_FAILURE_ON_ERROR
|
|
944 |
}
|
|
945 |
// test executed
|
|
946 |
return KErrNone;
|
|
947 |
}
|
|
948 |
|
|
949 |
// -----------------------------------------------------------------------------
|
|
950 |
// CBrowserControlApiTest::CommandObserver
|
|
951 |
// BC Test that all browser commands work.
|
|
952 |
// -----------------------------------------------------------------------------
|
|
953 |
//
|
|
954 |
TInt CBrowserControlApiTest::CommandObserver( CStifItemParser& /* aItem */ )
|
|
955 |
{
|
|
956 |
TInt ret(KErrGeneral);
|
|
957 |
|
|
958 |
if ( iBrCtlTestContainer )
|
|
959 |
{
|
|
960 |
TRAPD(err, ret = iBrCtlTestContainer->AddCommandObserverL() );
|
|
961 |
if ( err || !ret )
|
|
962 |
{
|
|
963 |
err = iBrCtlTestContainer->RemoveCommandObserver();
|
|
964 |
return KErrNone;
|
|
965 |
}
|
|
966 |
err = iBrCtlTestContainer->RemoveCommandObserver();
|
|
967 |
RETURN_FAILURE_ON_ERROR
|
|
968 |
}
|
|
969 |
// test executed
|
|
970 |
return KErrNone;
|
|
971 |
}
|
|
972 |
|
|
973 |
// -----------------------------------------------------------------------------
|
|
974 |
// CBrowserControlApiTest::AddOptionMenuItems
|
|
975 |
// BC Test that all browser commands work.
|
|
976 |
// -----------------------------------------------------------------------------
|
|
977 |
//
|
|
978 |
TInt CBrowserControlApiTest::AddOptionMenuItems( CStifItemParser& /* aItem */ )
|
|
979 |
{
|
|
980 |
if ( iBrCtlTestContainer )
|
|
981 |
{
|
|
982 |
TRAPD(err, iBrCtlTestContainer->LoadDataL() );
|
|
983 |
RETURN_FAILURE_ON_ERROR
|
|
984 |
|
|
985 |
err = iBrCtlTestContainer->AddOptionMenuItems();
|
|
986 |
RETURN_FAILURE_ON_ERROR
|
|
987 |
}
|
|
988 |
// test executed
|
|
989 |
return KErrNone;
|
|
990 |
}
|
|
991 |
|
|
992 |
// -----------------------------------------------------------------------------
|
|
993 |
// CBrowserControlApiTest::BrCtlInitLoadData
|
|
994 |
// BC Test that all browser commands work.
|
|
995 |
// -----------------------------------------------------------------------------
|
|
996 |
//
|
|
997 |
TInt CBrowserControlApiTest::BrCtlInitLoadData( CStifItemParser& /* aItem */ )
|
|
998 |
{
|
|
999 |
if ( iBrCtlTestContainer )
|
|
1000 |
{
|
|
1001 |
TRAPD(err, iBrCtlTestContainer->BrCtlInitLoadDataL() );
|
|
1002 |
RETURN_FAILURE_ON_ERROR
|
|
1003 |
}
|
|
1004 |
|
|
1005 |
// test executed
|
|
1006 |
return KErrNone;
|
|
1007 |
}
|
|
1008 |
|
|
1009 |
// -----------------------------------------------------------------------------
|
|
1010 |
// CBrowserControlApiTest::HandleDownloadCommand
|
|
1011 |
// BC Test that all browser commands work.
|
|
1012 |
// -----------------------------------------------------------------------------
|
|
1013 |
//
|
|
1014 |
TInt CBrowserControlApiTest::HandleDownloadCommand( CStifItemParser& /* aItem */)
|
|
1015 |
{
|
|
1016 |
if ( iBrCtlTestContainer )
|
|
1017 |
{
|
|
1018 |
TInt err = iBrCtlTestContainer->HandleDownloadCommand();
|
|
1019 |
RETURN_FAILURE_ON_ERROR
|
|
1020 |
}
|
|
1021 |
|
|
1022 |
// test executed
|
|
1023 |
return KErrNone;
|
|
1024 |
}
|
|
1025 |
|
|
1026 |
// -----------------------------------------------------------------------------
|
|
1027 |
// CBrowserControlApiTest::VersionInfo
|
|
1028 |
// This BrCtl API function does nothing!
|
|
1029 |
// BC Test that this function still works.
|
|
1030 |
// -----------------------------------------------------------------------------
|
|
1031 |
//
|
|
1032 |
TInt CBrowserControlApiTest::VersionInfo( CStifItemParser& /* aItem */ )
|
|
1033 |
{
|
|
1034 |
if ( iBrCtlTestContainer )
|
|
1035 |
{
|
|
1036 |
TRAPD( err, err = iBrCtlTestContainer->VersionInfoL() );
|
|
1037 |
RETURN_FAILURE_ON_ERROR
|
|
1038 |
}
|
|
1039 |
|
|
1040 |
// test executed
|
|
1041 |
return KErrNone;
|
|
1042 |
}
|
|
1043 |
|
|
1044 |
|
|
1045 |
// -----------------------------------------------------------------------------
|
|
1046 |
// CBrowserControlApiTest::WmlOptionMenuItem
|
|
1047 |
//
|
|
1048 |
// -----------------------------------------------------------------------------
|
|
1049 |
//
|
|
1050 |
TInt CBrowserControlApiTest::WmlOptionMenuItems( CStifItemParser& /* aItem */ )
|
|
1051 |
{
|
|
1052 |
if ( iBrCtlTestContainer )
|
|
1053 |
{
|
|
1054 |
TRAPD( err, err = iBrCtlTestContainer->WmlOptionMenuItemsL() );
|
|
1055 |
RETURN_FAILURE_ON_ERROR
|
|
1056 |
}
|
|
1057 |
|
|
1058 |
// test executed
|
|
1059 |
return KErrNone;
|
|
1060 |
}
|
|
1061 |
|
|
1062 |
// -----------------------------------------------------------------------------
|
|
1063 |
// CBrowserControlApiTest::ImageCount
|
|
1064 |
//
|
|
1065 |
// -----------------------------------------------------------------------------
|
|
1066 |
//
|
|
1067 |
TInt CBrowserControlApiTest::ImageCount( CStifItemParser& /* aItem */ )
|
|
1068 |
{
|
|
1069 |
if ( iBrCtlTestContainer )
|
|
1070 |
{
|
|
1071 |
TRAPD( err, err = iBrCtlTestContainer->ImageCountL() );
|
|
1072 |
RETURN_FAILURE_ON_ERROR
|
|
1073 |
}
|
|
1074 |
|
|
1075 |
// test executed
|
|
1076 |
return KErrNone;
|
|
1077 |
}
|
|
1078 |
|
|
1079 |
// -----------------------------------------------------------------------------
|
|
1080 |
// CBrowserControlApiTest::PostUrlL
|
|
1081 |
//
|
|
1082 |
// -----------------------------------------------------------------------------
|
|
1083 |
//
|
|
1084 |
TInt CBrowserControlApiTest::PostUrlL( CStifItemParser& /* aItem */ )
|
|
1085 |
{
|
|
1086 |
if ( iBrCtlTestContainer )
|
|
1087 |
{
|
|
1088 |
TRAPD( err, err = iBrCtlTestContainer->BrCtlPostL() );
|
|
1089 |
RETURN_FAILURE_ON_ERROR
|
|
1090 |
}
|
|
1091 |
|
|
1092 |
// test executed
|
|
1093 |
return KErrNone;
|
|
1094 |
}
|
|
1095 |
|
|
1096 |
// -----------------------------------------------------------------------------
|
|
1097 |
// CBrowserControlApiTest::CreateBrCtlWithWidgetExtensionL
|
|
1098 |
// Creates a browser control with widget extension contained within iBrCtlTestContainer
|
|
1099 |
// -----------------------------------------------------------------------------
|
|
1100 |
//
|
|
1101 |
TInt CBrowserControlApiTest::CreateBrCtlWithWidgetExtensionL(
|
|
1102 |
CStifItemParser& aItem )
|
|
1103 |
{
|
|
1104 |
TInt err( KErrNone );
|
|
1105 |
|
|
1106 |
TInt aBrCtlConfig = 0x0000;
|
|
1107 |
|
|
1108 |
TPtrC string;
|
|
1109 |
|
|
1110 |
TPoint base( 0, 0 );
|
|
1111 |
TPoint extent( 252, 195 );
|
|
1112 |
TRect rect( base, extent );
|
|
1113 |
|
|
1114 |
TRAP( err,
|
|
1115 |
iBrCtlTestContainer = new (ELeave) CBrCtlApiTestContainer;
|
|
1116 |
iBrCtlTestContainer->ConstructL( rect );
|
|
1117 |
err = iBrCtlTestContainer->CreateBrCtlInterfaceAndWidgetExtensionL();
|
|
1118 |
);
|
|
1119 |
|
|
1120 |
if ( err )
|
|
1121 |
{
|
|
1122 |
delete iBrCtlTestContainer;
|
|
1123 |
iBrCtlTestContainer = 0;
|
|
1124 |
return KErrNone;
|
|
1125 |
}
|
|
1126 |
|
|
1127 |
// Great, now set the focus of the browser control
|
|
1128 |
iBrCtlTestContainer->SetFocus();
|
|
1129 |
iBrCtlTestContainer->DrawNow();
|
|
1130 |
|
|
1131 |
// test block executed
|
|
1132 |
return KErrNone;
|
|
1133 |
}
|
|
1134 |
|
|
1135 |
|
|
1136 |
// -----------------------------------------------------------------------------
|
|
1137 |
// CBrowserControlApiTest::TestHistoryHandlerL
|
|
1138 |
// Load several pages in an attempt to indirectly exercise History Handler
|
|
1139 |
// -----------------------------------------------------------------------------
|
|
1140 |
//
|
|
1141 |
TInt CBrowserControlApiTest::TestHistoryHandlerL( CStifItemParser& aItem )
|
|
1142 |
{
|
|
1143 |
TPtrC string;
|
|
1144 |
if ( iBrCtlTestContainer )
|
|
1145 |
{
|
|
1146 |
if ( aItem.GetNextString ( string ) == KErrNone )
|
|
1147 |
{
|
|
1148 |
if (string.Compare(_L("Page1"))==0)
|
|
1149 |
{
|
|
1150 |
TRAPD( err, iBrCtlTestContainer->HistoryLoad1L() );
|
|
1151 |
RETURN_FAILURE_ON_ERROR
|
|
1152 |
}
|
|
1153 |
|
|
1154 |
if (string.Compare(_L("Page2"))==0)
|
|
1155 |
{
|
|
1156 |
TRAPD( err, iBrCtlTestContainer->HistoryLoad2L() );
|
|
1157 |
RETURN_FAILURE_ON_ERROR
|
|
1158 |
}
|
|
1159 |
|
|
1160 |
if (string.Compare(_L("Page3"))==0)
|
|
1161 |
{
|
|
1162 |
TRAPD( err, iBrCtlTestContainer->HistoryLoad3L() );
|
|
1163 |
RETURN_FAILURE_ON_ERROR
|
|
1164 |
}
|
|
1165 |
}
|
|
1166 |
}
|
|
1167 |
|
|
1168 |
// test executed
|
|
1169 |
return KErrNone;
|
|
1170 |
}
|
|
1171 |
|
|
1172 |
// -----------------------------------------------------------------------------
|
|
1173 |
// CBrowserControlApiTest::TestWMLLoadL
|
|
1174 |
// Load a WML page in an attempt to indirectly exercise WML functionality
|
|
1175 |
// -----------------------------------------------------------------------------
|
|
1176 |
//
|
|
1177 |
TInt CBrowserControlApiTest::TestWMLLoadL( CStifItemParser& aItem )
|
|
1178 |
{
|
|
1179 |
TPtrC string;
|
|
1180 |
if ( iBrCtlTestContainer )
|
|
1181 |
{
|
|
1182 |
if ( aItem.GetNextString ( string ) == KErrNone )
|
|
1183 |
{
|
|
1184 |
if (string.Compare(_L("Page1"))==0)
|
|
1185 |
{
|
|
1186 |
TRAPD( err, iBrCtlTestContainer->WMLLoad1L() );
|
|
1187 |
RETURN_FAILURE_ON_ERROR
|
|
1188 |
}
|
|
1189 |
if (string.Compare(_L("Page2"))==0)
|
|
1190 |
{
|
|
1191 |
TRAPD( err, iBrCtlTestContainer->WMLLoad2L() );
|
|
1192 |
RETURN_FAILURE_ON_ERROR
|
|
1193 |
}
|
|
1194 |
if (string.Compare(_L("Page3"))==0)
|
|
1195 |
{
|
|
1196 |
TRAPD( err, iBrCtlTestContainer->WMLLoad3L() );
|
|
1197 |
RETURN_FAILURE_ON_ERROR
|
|
1198 |
}
|
|
1199 |
}
|
|
1200 |
}
|
|
1201 |
|
|
1202 |
// test executed
|
|
1203 |
return KErrNone;
|
|
1204 |
}
|
|
1205 |
|
|
1206 |
// ========================== OTHER EXPORTED FUNCTIONS =========================
|
|
1207 |
// None
|
|
1208 |
|
|
1209 |
// [End of File] - Do not remove
|