20
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-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: Contains the test cases.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <avkon.hrh>
|
|
19 |
#include <eikfrlb.h>
|
|
20 |
#include <aknappui.h>
|
|
21 |
#include <aknpointereventmodifier.h>
|
|
22 |
#include <akntashook.h>
|
|
23 |
#include <aknpreviewpopupcontroller.h>
|
|
24 |
#include <eikmenub.h>
|
|
25 |
#include <eikenv.h>
|
|
26 |
#include <aknutils.h>
|
|
27 |
#include <akntoolbar.h>
|
|
28 |
#include <caknmemoryselectionsettingitemmultidrive.h>
|
|
29 |
#include <AknCommonDialogsDynMem.h>
|
|
30 |
|
|
31 |
#include <bctestmixmcl.rsg>
|
|
32 |
#include <eikedwin.h>
|
|
33 |
#include <aknphysics.h>
|
|
34 |
#include <aknradiobuttonsettingpage.h>
|
|
35 |
#include <aknpopupsettingpage.h>
|
|
36 |
#include <ItemFinder.h>
|
|
37 |
#include <finditemdialog.h>
|
|
38 |
#include <aknphysics.h>
|
|
39 |
#include <aknbutton.h>
|
|
40 |
|
|
41 |
#include "bctestmixmclgeneralcase.h"
|
|
42 |
#include "bctestmixmclcontainer.h"
|
|
43 |
#include "bctestmixmcl.hrh"
|
|
44 |
|
|
45 |
// CONSTANTS
|
|
46 |
|
|
47 |
//
|
|
48 |
// class CSettingPageTest
|
|
49 |
// Helper class for testing protected setting page methods.
|
|
50 |
//
|
|
51 |
NONSHARABLE_CLASS( CSettingPageTest ) : public CAknSettingPage
|
|
52 |
{
|
|
53 |
public:
|
|
54 |
virtual void ProcessCommandL( TInt aCommandId );
|
|
55 |
};
|
|
56 |
|
|
57 |
// ======== MEMBER FUNCTIONS ========
|
|
58 |
|
|
59 |
// ---------------------------------------------------------------------------
|
|
60 |
// Symbian 2nd static Constructor
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
CBCTestMixMCLGeneralCase* CBCTestMixMCLGeneralCase::NewL( CBCTestMixMCLContainer*
|
|
64 |
aContainer, CBCTestMixMCLView* aView )
|
|
65 |
{
|
|
66 |
CBCTestMixMCLGeneralCase* self = new( ELeave ) CBCTestMixMCLGeneralCase(
|
|
67 |
aContainer, aView );
|
|
68 |
CleanupStack::PushL( self );
|
|
69 |
self->ConstructL();
|
|
70 |
CleanupStack::Pop( self );
|
|
71 |
return self;
|
|
72 |
}
|
|
73 |
|
|
74 |
// ---------------------------------------------------------------------------
|
|
75 |
// C++ default constructor
|
|
76 |
// ---------------------------------------------------------------------------
|
|
77 |
//
|
|
78 |
CBCTestMixMCLGeneralCase::CBCTestMixMCLGeneralCase( CBCTestMixMCLContainer*
|
|
79 |
aContainer, CBCTestMixMCLView* aView )
|
|
80 |
: iView( aView ), iContainer( aContainer )
|
|
81 |
{
|
|
82 |
}
|
|
83 |
|
|
84 |
// ---------------------------------------------------------------------------
|
|
85 |
// Destructor
|
|
86 |
// ---------------------------------------------------------------------------
|
|
87 |
//
|
|
88 |
CBCTestMixMCLGeneralCase::~CBCTestMixMCLGeneralCase()
|
|
89 |
{
|
|
90 |
}
|
|
91 |
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
// Symbian 2nd Constructor
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
//
|
|
96 |
void CBCTestMixMCLGeneralCase::ConstructL()
|
|
97 |
{
|
|
98 |
BuildScriptL();
|
|
99 |
}
|
|
100 |
|
|
101 |
// ---------------------------------------------------------------------------
|
|
102 |
// CBCTestMixMCLGeneralCase::BuildScriptL
|
|
103 |
// ---------------------------------------------------------------------------
|
|
104 |
//
|
|
105 |
void CBCTestMixMCLGeneralCase::BuildScriptL()
|
|
106 |
{
|
|
107 |
// Add script as your need.
|
|
108 |
AddTestL( DELAY(1), LeftCBA, Down, KeyOK, TEND ); // outline02
|
|
109 |
}
|
|
110 |
|
|
111 |
// ---------------------------------------------------------------------------
|
|
112 |
// CBCTestMixMCLGeneralCase::RunL
|
|
113 |
// ---------------------------------------------------------------------------
|
|
114 |
//
|
|
115 |
void CBCTestMixMCLGeneralCase::RunL( TInt aCmd )
|
|
116 |
{
|
|
117 |
if ( aCmd != EBCTestCmdOutline2 )
|
|
118 |
{
|
|
119 |
return;
|
|
120 |
}
|
|
121 |
// Call release before prepare to let container has time to draw the
|
|
122 |
// control created in PrepareCaseL.
|
|
123 |
ReleaseCaseL();
|
|
124 |
PrepareCaseL( aCmd );
|
|
125 |
|
|
126 |
TestListBoxL();
|
|
127 |
TestOptionsMenuL();
|
|
128 |
TestTasObjectInfoAndTasHookL();
|
|
129 |
TestMiscApisFuncOneL();
|
|
130 |
TestAknToolbarL();
|
|
131 |
TestAknPopupUtilsL();
|
|
132 |
TestAknListUtilsL();
|
|
133 |
TestRadioButtonSettingPageL();
|
|
134 |
TestPopupSettingPageL();
|
|
135 |
TestItemFinderL();
|
|
136 |
TestFindItemDialogL();
|
|
137 |
TestEditorKineticScrollingL();
|
|
138 |
TestEnableKineticScrollingPhysicsL();
|
|
139 |
TestAknPhysicsSuspendPhysicsL();
|
|
140 |
TestAknPhysicsResumePhysicsL();
|
|
141 |
TestCbaL();
|
|
142 |
TestCommonDialogsL();
|
|
143 |
TestAknButtonEnableFeedbackL();
|
|
144 |
}
|
|
145 |
|
|
146 |
// ---------------------------------------------------------------------------
|
|
147 |
// CBCTestMixMCLGeneralCase::PrepareCaseL
|
|
148 |
// ---------------------------------------------------------------------------
|
|
149 |
//
|
|
150 |
void CBCTestMixMCLGeneralCase::PrepareCaseL( TInt aCmd )
|
|
151 |
{
|
|
152 |
switch ( aCmd )
|
|
153 |
{
|
|
154 |
case EBCTestCmdOutline2:
|
|
155 |
// Here is a simple demo. You should create your control
|
|
156 |
// instead of this.
|
|
157 |
iControl = new( ELeave ) CCoeControl();
|
|
158 |
iControl->SetContainerWindowL( *iContainer );
|
|
159 |
iControl->MakeVisible( ETrue );
|
|
160 |
break;
|
|
161 |
default:
|
|
162 |
break;
|
|
163 |
}
|
|
164 |
// Pass the owner of iControl to iContainer.
|
|
165 |
iContainer->SetControlL( iControl );
|
|
166 |
}
|
|
167 |
|
|
168 |
// ---------------------------------------------------------------------------
|
|
169 |
// CBCTestMixMCLGeneralCase::ReleaseCaseL
|
|
170 |
// ---------------------------------------------------------------------------
|
|
171 |
//
|
|
172 |
void CBCTestMixMCLGeneralCase::ReleaseCaseL()
|
|
173 |
{
|
|
174 |
// let container delete the component control.
|
|
175 |
iContainer->ResetControl();
|
|
176 |
iControl = NULL;
|
|
177 |
}
|
|
178 |
|
|
179 |
// ---------------------------------------------------------------------------
|
|
180 |
// CBCTestMixMCLGeneralCase::HandleLongTapEventL
|
|
181 |
// ---------------------------------------------------------------------------
|
|
182 |
//
|
|
183 |
void CBCTestMixMCLGeneralCase::HandleLongTapEventL(
|
|
184 |
const TPoint& /*aPenEventLocation*/,
|
|
185 |
const TPoint& /*aPenEventScreenLocation*/ )
|
|
186 |
{
|
|
187 |
|
|
188 |
}
|
|
189 |
|
|
190 |
// ---------------------------------------------------------------------------
|
|
191 |
// CBCTestMixMCLGeneralCase::TestListBoxL
|
|
192 |
// ---------------------------------------------------------------------------
|
|
193 |
//
|
|
194 |
void CBCTestMixMCLGeneralCase::TestListBoxL()
|
|
195 |
{
|
|
196 |
_LIT( KDisableScrolling, "CEikListBox::DisableScrolling() invoked" );
|
|
197 |
_LIT( KSetItemsInSingleLine,
|
|
198 |
"CEikListBox::SetItemsInSingleLine() invoked" );
|
|
199 |
_LIT( KBackgroundDrawingSuppressed,
|
|
200 |
"CEikListBox::BackgroundDrawingSuppressed() invoked" );
|
|
201 |
_LIT( KHandlePhysicsScrollEventL,
|
|
202 |
"CEikListBox::HandlePhysicsScrollEventL() invoked" );
|
|
203 |
_LIT( KSuspendEffectsL, "CEikListBox::SuspendEffects() invoked" );
|
|
204 |
_LIT( KScrollingDisabledL, "CEikListBox::ScrollingDisabled() invoked" );
|
|
205 |
_LIT( KItemIsPartiallyVisibleL,
|
|
206 |
"CListBoxView::ItemIsPartiallyVisible() invoked" );
|
|
207 |
_LIT( KItemOffsetInPixels,
|
|
208 |
"CListBoxView::ItemOffsetInPixels() invoked" );
|
|
209 |
_LIT( KDisableItemSpecificMenu,
|
|
210 |
"CListBoxView::DisableItemSpecificMenu() invoked" );
|
|
211 |
_LIT( KMakeVisible,
|
|
212 |
"CEikListBox::MakeVisible() invoked" );
|
|
213 |
_LIT( KItemsInSingleLine,
|
|
214 |
"CEikListBox::ItemsInSingleLine() invoked" );
|
|
215 |
|
|
216 |
CEikFormattedCellListBox * listbox = new (ELeave) CEikFormattedCellListBox();
|
|
217 |
CleanupStack::PushL( listbox );
|
|
218 |
|
|
219 |
listbox->ConstructL( iContainer, EAknListBoxSelectionList );
|
|
220 |
CDesCArrayFlat* text = new (ELeave) CDesCArrayFlat(1);
|
|
221 |
CleanupStack::PushL( text );
|
|
222 |
|
|
223 |
text->AppendL( _L( "\tTextItem1\t" ) );
|
|
224 |
text->AppendL( _L( "\tTextItem2\t" ) );
|
|
225 |
text->AppendL( _L( "\tTextItem3\t" ) );
|
|
226 |
|
|
227 |
listbox->Model()->SetItemTextArray( text );
|
|
228 |
listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
|
|
229 |
|
|
230 |
listbox->DisableScrolling( ETrue );
|
|
231 |
AssertTrueL( ETrue, KDisableScrolling );
|
|
232 |
|
|
233 |
listbox->SetItemsInSingleLine( 1 );
|
|
234 |
AssertTrueL( ETrue, KSetItemsInSingleLine );
|
|
235 |
|
|
236 |
listbox->BackgroundDrawingSuppressed();
|
|
237 |
AssertTrueL( ETrue, KBackgroundDrawingSuppressed );
|
|
238 |
|
|
239 |
listbox->HandlePhysicsScrollEventL( listbox->ItemHeight() );
|
|
240 |
AssertTrueL( ETrue, KHandlePhysicsScrollEventL );
|
|
241 |
|
|
242 |
listbox->SuspendEffects( ETrue );
|
|
243 |
AssertTrueL( ETrue, KSuspendEffectsL );
|
|
244 |
|
|
245 |
listbox->ScrollingDisabled();
|
|
246 |
AssertTrueL( ETrue, KScrollingDisabledL );
|
|
247 |
|
|
248 |
listbox->View()->ItemIsPartiallyVisible( 1 );
|
|
249 |
AssertTrueL( ETrue, KItemIsPartiallyVisibleL );
|
|
250 |
|
|
251 |
listbox->View()->ItemOffsetInPixels();
|
|
252 |
AssertTrueL( ETrue, KItemOffsetInPixels );
|
|
253 |
|
|
254 |
listbox->DisableItemSpecificMenu();
|
|
255 |
AssertTrueL( ETrue, KDisableItemSpecificMenu );
|
|
256 |
listbox->MakeVisible( ETrue );
|
|
257 |
AssertTrueL( ETrue, KMakeVisible );
|
|
258 |
|
|
259 |
listbox->ItemsInSingleLine();
|
|
260 |
AssertTrueL( ETrue, KItemsInSingleLine );
|
|
261 |
|
|
262 |
CleanupStack::PopAndDestroy( text );
|
|
263 |
CleanupStack::PopAndDestroy( listbox );
|
|
264 |
}
|
|
265 |
|
|
266 |
// ---------------------------------------------------------------------------
|
|
267 |
// CBCTestMixMCLGeneralCase::TestOptionsMenuL
|
|
268 |
// ---------------------------------------------------------------------------
|
|
269 |
//
|
|
270 |
void CBCTestMixMCLGeneralCase::TestOptionsMenuL()
|
|
271 |
{
|
|
272 |
_LIT( KGetMenuType, "CEikMenuBar::GetMenuType invoked" );
|
|
273 |
CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar();
|
|
274 |
if( menuBar )
|
|
275 |
{
|
|
276 |
menuBar->GetMenuType();
|
|
277 |
AssertTrueL( ETrue, KGetMenuType );
|
|
278 |
}
|
|
279 |
}
|
|
280 |
|
|
281 |
// ---------------------------------------------------------------------------
|
|
282 |
// CBCTestMixMCLGeneralCase::TestTasObjectInfoAndTasHookL
|
|
283 |
// ---------------------------------------------------------------------------
|
|
284 |
//
|
|
285 |
void CBCTestMixMCLGeneralCase::TestTasObjectInfoAndTasHookL()
|
|
286 |
{
|
|
287 |
_LIT( KClassName, "CBCTestMixMCLGeneralCase" );
|
|
288 |
_LIT( KAddL, "CAknTasHook::AddL() tested" );
|
|
289 |
_LIT( KGet, "CAknTasHook::Get() tested" );
|
|
290 |
_LIT( KRemove, "CAknTasHook::Remove() tested" );
|
|
291 |
_LIT( KIsA, "CAknTasObjectInfo::IsA() tested" );
|
|
292 |
_LIT( KType, "CAknTasObjectInfo::Type() tested" );
|
|
293 |
_LIT( KGetClassNames, "CAknTasObjectInfo::GetClassNames() tested" );
|
|
294 |
_LIT( KGetControl, "CAknTasObjectInfo::GetControl() tested" );
|
|
295 |
|
|
296 |
CAknTasHook::AddL( this, KClassName() );
|
|
297 |
AssertTrueL( ETrue, KAddL );
|
|
298 |
|
|
299 |
CAknTasObjectInfo* info = CAknTasHook::Get( this );
|
|
300 |
AssertTrueL( ETrue, KGet );
|
|
301 |
|
|
302 |
// info would be NULL if KTasHooking is not enabled.
|
|
303 |
if ( info )
|
|
304 |
{
|
|
305 |
info->IsA( KClassName() );
|
|
306 |
AssertTrueL( ETrue, KIsA );
|
|
307 |
|
|
308 |
info->Type();
|
|
309 |
AssertTrueL( ETrue, KType );
|
|
310 |
|
|
311 |
info->GetClassNames();
|
|
312 |
AssertTrueL( ETrue, KGetClassNames );
|
|
313 |
|
|
314 |
info->GetControl();
|
|
315 |
AssertTrueL( ETrue, KGetControl );
|
|
316 |
}
|
|
317 |
|
|
318 |
CAknTasHook::Remove( this );
|
|
319 |
AssertTrueL( ETrue, KRemove );
|
|
320 |
}
|
|
321 |
|
|
322 |
// ---------------------------------------------------------------------------
|
|
323 |
// CBCTestMixMCLGeneralCase::TestMiscApisFuncOneL
|
|
324 |
// ---------------------------------------------------------------------------
|
|
325 |
//
|
|
326 |
void CBCTestMixMCLGeneralCase::TestMiscApisFuncOneL()
|
|
327 |
{
|
|
328 |
_LIT( KCancelAnimationL,
|
|
329 |
"CAknLongTapDetector::CancelAnimationL() invoked" );
|
|
330 |
_LIT( KHandlePointerEvent,
|
|
331 |
"CAknPointerEventModifier::CAknPointerEventModifier() tested");
|
|
332 |
_LIT( KResetTimer, "CAknPreviewPopUpController::ResetTimer() teseted");
|
|
333 |
|
|
334 |
CAknLongTapDetector* detector = CAknLongTapDetector::NewL( this );
|
|
335 |
CleanupStack::PushL( detector );
|
|
336 |
|
|
337 |
detector->After( TTimeIntervalMicroSeconds32( 1000000 ) );
|
|
338 |
detector->CancelAnimationL();
|
|
339 |
AssertTrueL( ETrue, KCancelAnimationL );
|
|
340 |
|
|
341 |
CleanupStack::PopAndDestroy( detector );
|
|
342 |
|
|
343 |
CAknPreviewPopUpController* popupController =
|
|
344 |
CAknPreviewPopUpController::NewL( *iControl );
|
|
345 |
CleanupStack::PushL( popupController );
|
|
346 |
|
|
347 |
popupController->ResetTimer();
|
|
348 |
AssertTrueL( ETrue, KResetTimer );
|
|
349 |
|
|
350 |
CleanupStack::PopAndDestroy( popupController );
|
|
351 |
|
|
352 |
// simulate a pointer event for forcing the CAknAppUi::HandleWsEventL
|
|
353 |
// to call CAknPointerEventModifier::HandlePointerEventL().
|
|
354 |
TRawEvent eventDown;
|
|
355 |
eventDown.Set( TRawEvent::EButton1Down, 0, 0 );
|
|
356 |
UserSvr::AddEvent( eventDown );
|
|
357 |
|
|
358 |
User::After( 1000000 );
|
|
359 |
|
|
360 |
TRawEvent eventUp;
|
|
361 |
eventUp.Set( TRawEvent::EButton1Up, 0, 0 );
|
|
362 |
UserSvr::AddEvent( eventUp );
|
|
363 |
|
|
364 |
AssertTrueL( ETrue, KHandlePointerEvent );
|
|
365 |
}
|
|
366 |
|
|
367 |
// ---------------------------------------------------------------------------
|
|
368 |
// CBCTestMixMCLGeneralCase::TestAknPopupUtilsL
|
|
369 |
// ---------------------------------------------------------------------------
|
|
370 |
//
|
|
371 |
void CBCTestMixMCLGeneralCase::TestAknPopupUtilsL()
|
|
372 |
{
|
|
373 |
TSize size( 10, 10 );
|
|
374 |
TPoint point( AknPopupUtils::Position( size, ETrue ) );
|
|
375 |
point = AknPopupUtils::Position( size, EFalse );
|
|
376 |
point = AknPopupUtils::Position( size, NULL );
|
|
377 |
_LIT( KAknPopupUtilsPosition, "AknPopupUtils::Position funcs are tested" );
|
|
378 |
AssertTrueL( ETrue, KAknPopupUtilsPosition );
|
|
379 |
}
|
|
380 |
|
|
381 |
|
|
382 |
// ---------------------------------------------------------------------------
|
|
383 |
// CBCTestMixMCLGeneralCase::TestAknListUtils
|
|
384 |
// ---------------------------------------------------------------------------
|
|
385 |
//
|
|
386 |
void CBCTestMixMCLGeneralCase::TestAknListUtilsL()
|
|
387 |
{
|
|
388 |
CFbsBitmap *bitmap = new ( ELeave ) CFbsBitmap();
|
|
389 |
CleanupStack::PushL( bitmap );
|
|
390 |
bitmap->Create( TSize( 20, 20 ), EColor16MA );
|
|
391 |
CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL( bitmap );
|
|
392 |
CleanupStack::PushL( bitmapDevice );
|
|
393 |
CFbsBitGc *gc = CFbsBitGc::NewL();
|
|
394 |
CleanupStack::PushL( gc );
|
|
395 |
gc->Activate( bitmapDevice );
|
|
396 |
|
|
397 |
TRect rect( 10,100,20,120 );
|
|
398 |
TRgb color( KRgbRed );
|
|
399 |
AknListUtils::DrawSeparator( *gc, rect, color );
|
|
400 |
|
|
401 |
CleanupStack::PopAndDestroy( gc );
|
|
402 |
CleanupStack::PopAndDestroy( bitmapDevice );
|
|
403 |
CleanupStack::PopAndDestroy( bitmap );
|
|
404 |
|
|
405 |
_LIT( KAknListUtilsDrawSeparator, "AknListUtils::DrawSeparator tested" );
|
|
406 |
AssertTrueL( ETrue, KAknListUtilsDrawSeparator );
|
|
407 |
}
|
|
408 |
|
|
409 |
|
|
410 |
// ---------------------------------------------------------------------------
|
|
411 |
// CBCTestMixMCLGeneralCase::TestAknToolbarL
|
|
412 |
// ---------------------------------------------------------------------------
|
|
413 |
//
|
|
414 |
void CBCTestMixMCLGeneralCase::TestAknToolbarL()
|
|
415 |
{
|
|
416 |
_LIT( KAknToolbarNew, "CAknToolbar::New toolbar is constructed" );
|
|
417 |
_LIT( KAknToolbarSetBgId, "CAknToolbar::New background skin theme ID is set" );
|
|
418 |
|
|
419 |
CAknToolbar* toolbar = CAknToolbar::NewL( R_BCTESTMIXMCL_TOOLBAR_FIXED );
|
|
420 |
CleanupStack::PushL( toolbar );
|
|
421 |
AssertTrueL( ETrue, KAknToolbarNew );
|
|
422 |
|
|
423 |
toolbar->SetSkinBackgroundId( KAknsIIDQsnBgAreaControlMp );
|
|
424 |
AssertTrueL( ETrue, KAknToolbarSetBgId );
|
|
425 |
CleanupStack::PopAndDestroy( toolbar );
|
|
426 |
}
|
|
427 |
|
|
428 |
|
|
429 |
// -----------------------------------------------------------------------------
|
|
430 |
// CBCTestMixMCLGeneralCase::TestRadioButtonSettingPageL
|
|
431 |
// -----------------------------------------------------------------------------
|
|
432 |
//
|
|
433 |
void CBCTestMixMCLGeneralCase::TestRadioButtonSettingPageL()
|
|
434 |
{
|
|
435 |
const TInt KBufSize = 32;
|
|
436 |
const TInt KZero = 0;
|
|
437 |
const TInt KOne = 1;
|
|
438 |
const TInt KTwo = 2;
|
|
439 |
_LIT( KTestString, "Radiobuttonsettingpage test" );
|
|
440 |
_LIT( KTestRadioButtonSettingPage,
|
|
441 |
"CAknRadioButtonSettingPage::ProcessCommandL tested" );
|
|
442 |
|
|
443 |
CDesCArrayFlat* array = CCoeEnv::Static()->
|
|
444 |
ReadDesCArrayResourceL( R_BCTESTMIXMCL_LIST_ITEM_ARRAY );
|
|
445 |
CleanupStack::PushL( array );
|
|
446 |
|
|
447 |
TInt optin( KZero );
|
|
448 |
TBuf< KBufSize > buffer( KTestString );
|
|
449 |
CAknRadioButtonSettingPage* settingPage = new (ELeave)
|
|
450 |
CAknRadioButtonSettingPage( &buffer, KOne, EAknCtPopupSettingList,
|
|
451 |
R_BCTESTMIXMCL_RADIOBUTTON_EDITOR,
|
|
452 |
R_BCTESTMIXMCL_RADIOBUTTON_SETTING_PAGE,
|
|
453 |
optin, array );
|
|
454 |
CleanupStack::PushL( settingPage );
|
|
455 |
|
|
456 |
settingPage->ConstructL();
|
|
457 |
|
|
458 |
// CSettingPageTest is used to access protected method
|
|
459 |
// CAknRadioButtonSettingPage::ProcessCommandL
|
|
460 |
CSettingPageTest* test = reinterpret_cast<CSettingPageTest*>( settingPage );
|
|
461 |
|
|
462 |
CCoeEnv::Static()->AppUi()->AddToStackL( test );
|
|
463 |
test->ProcessCommandL( EAknSoftkeySelect );
|
|
464 |
CCoeEnv::Static()->AppUi()->RemoveFromStack( test );
|
|
465 |
|
|
466 |
CleanupStack::PopAndDestroy( KTwo );
|
|
467 |
AssertTrueL( ETrue, KTestRadioButtonSettingPage );
|
|
468 |
}
|
|
469 |
|
|
470 |
// -----------------------------------------------------------------------------
|
|
471 |
// CBCTestMixMCLGeneralCase::TestPopupSettingPageL
|
|
472 |
// -----------------------------------------------------------------------------
|
|
473 |
//
|
|
474 |
void CBCTestMixMCLGeneralCase::TestPopupSettingPageL()
|
|
475 |
{
|
|
476 |
_LIT( KTestPopupSettingPage,
|
|
477 |
"CAknPopupSettingPage::ProcessCommandL tested" );
|
|
478 |
|
|
479 |
CDesCArrayFlat* item = CCoeEnv::Static()->
|
|
480 |
ReadDesCArrayResourceL( R_BCTESTMIXMCL_LIST_ITEM_ARRAY );
|
|
481 |
CleanupStack::PushL( item );
|
|
482 |
|
|
483 |
CAknQueryValueTextArray* textArray = CAknQueryValueTextArray::NewL();
|
|
484 |
CleanupStack::PushL( textArray );
|
|
485 |
textArray->SetArray( *item );
|
|
486 |
|
|
487 |
CAknQueryValueText* queryValueText = CAknQueryValueText::NewL();
|
|
488 |
CleanupStack::PushL( queryValueText );
|
|
489 |
queryValueText->SetArrayL( textArray );
|
|
490 |
|
|
491 |
CAknPopupSettingPage* popupSettingPage = new (ELeave)
|
|
492 |
CAknPopupSettingPage( R_BCTESTMIXMCL_POPUP_SETTING_PAGE,
|
|
493 |
*queryValueText );
|
|
494 |
|
|
495 |
CleanupStack::PushL( popupSettingPage );
|
|
496 |
|
|
497 |
popupSettingPage->ConstructL();
|
|
498 |
|
|
499 |
// CSettingPageTest is used to access protected method
|
|
500 |
// CAknPopupSettingPage::ProcessCommandL
|
|
501 |
CSettingPageTest* test = reinterpret_cast<CSettingPageTest*>( popupSettingPage );
|
|
502 |
|
|
503 |
CCoeEnv::Static()->AppUi()->AddToStackL( popupSettingPage );
|
|
504 |
test->ProcessCommandL( EAknSoftkeySelect );
|
|
505 |
CCoeEnv::Static()->AppUi()->RemoveFromStack( popupSettingPage );
|
|
506 |
|
|
507 |
CleanupStack::PopAndDestroy( popupSettingPage );
|
|
508 |
CleanupStack::PopAndDestroy( queryValueText );
|
|
509 |
CleanupStack::PopAndDestroy( textArray );
|
|
510 |
CleanupStack::PopAndDestroy( item );
|
|
511 |
|
|
512 |
AssertTrueL( ETrue, KTestPopupSettingPage );
|
|
513 |
}
|
|
514 |
|
|
515 |
|
|
516 |
// ---------------------------------------------------------------------------
|
|
517 |
// CBCTestMixMCLGeneralCase::TestEditorKineticScrollingL
|
|
518 |
// ---------------------------------------------------------------------------
|
|
519 |
//
|
|
520 |
void CBCTestMixMCLGeneralCase::TestEditorKineticScrollingL()
|
|
521 |
{
|
|
522 |
CEikEdwin* editor = new ( ELeave ) CEikEdwin;
|
|
523 |
CleanupStack::PushL( editor );
|
|
524 |
editor->EnableKineticScrollingL( ETrue );
|
|
525 |
CleanupStack::PopAndDestroy( editor );
|
|
526 |
_LIT( KEdwinEnableScrolling, "CEikEdwin::EnableKineticScrollingL tested" );
|
|
527 |
AssertTrueL( ETrue, KEdwinEnableScrolling );
|
|
528 |
}
|
|
529 |
|
|
530 |
|
|
531 |
// ---------------------------------------------------------------------------
|
|
532 |
// CBCTestMixMCLGeneralCase::TestEnableKineticScrollingPhysicsL
|
|
533 |
// ---------------------------------------------------------------------------
|
|
534 |
//
|
|
535 |
void CBCTestMixMCLGeneralCase::TestEnableKineticScrollingPhysicsL()
|
|
536 |
{
|
|
537 |
CEikEdwin* editor = new ( ELeave ) CEikEdwin;
|
|
538 |
CleanupStack::PushL( editor );
|
|
539 |
|
|
540 |
CAknPhysics* physics ( NULL );
|
|
541 |
AssertTrueL ( CAknPhysics::FeatureEnabled() );
|
|
542 |
CCoeControl* control ( NULL );
|
|
543 |
control = new (ELeave) CCoeControl;
|
|
544 |
CleanupStack::PushL( control );
|
|
545 |
|
|
546 |
physics = CAknPhysics::NewL( *this, control );
|
|
547 |
CleanupStack::PushL( physics );
|
|
548 |
|
|
549 |
editor->EnableKineticScrollingL( physics );
|
|
550 |
|
|
551 |
CleanupStack::PopAndDestroy( physics );
|
|
552 |
CleanupStack::PopAndDestroy( control );
|
|
553 |
CleanupStack::PopAndDestroy( editor );
|
|
554 |
|
|
555 |
_LIT( KEdwinEnableScrollingPhysics,
|
|
556 |
"CEikEdwin::TestEnableKineticScrollingPhysicsL tested" );
|
|
557 |
AssertTrueL( ETrue, KEdwinEnableScrollingPhysics );
|
|
558 |
}
|
|
559 |
|
|
560 |
// ---------------------------------------------------------------------------
|
|
561 |
// CBCTestMixMCLGeneralCase::TestAknPhysicsSuspendPhysicsL
|
|
562 |
// ---------------------------------------------------------------------------
|
|
563 |
//
|
|
564 |
void CBCTestMixMCLGeneralCase::TestAknPhysicsSuspendPhysicsL()
|
|
565 |
{
|
|
566 |
CCoeControl* testControl = new (ELeave) CCoeControl();
|
|
567 |
CleanupStack::PushL( testControl );
|
|
568 |
CAknPhysics* physics = CAknPhysics::NewL( *this, testControl );
|
|
569 |
CleanupStack::PushL( physics );
|
|
570 |
physics->SuspendPhysics();
|
|
571 |
CleanupStack::PopAndDestroy( physics );
|
|
572 |
CleanupStack::PopAndDestroy( testControl );
|
|
573 |
_LIT( KSuspendPhysics, "CAknPhysics::SuspendPhysics tested" );
|
|
574 |
AssertTrueL( ETrue, KSuspendPhysics );
|
|
575 |
}
|
|
576 |
|
|
577 |
// ---------------------------------------------------------------------------
|
|
578 |
// CBCTestMixMCLGeneralCase::TestAknPhysicsResumePhysicsL
|
|
579 |
// ---------------------------------------------------------------------------
|
|
580 |
//
|
|
581 |
void CBCTestMixMCLGeneralCase::TestAknPhysicsResumePhysicsL()
|
|
582 |
{
|
|
583 |
CCoeControl* testControl = new (ELeave) CCoeControl();
|
|
584 |
CleanupStack::PushL( testControl );
|
|
585 |
CAknPhysics* physics = CAknPhysics::NewL( *this, testControl );
|
|
586 |
CleanupStack::PushL( physics );
|
|
587 |
physics->ResumePhysics();
|
|
588 |
CleanupStack::PopAndDestroy( physics );
|
|
589 |
CleanupStack::PopAndDestroy( testControl );
|
|
590 |
_LIT( KResumePhysics, "CAknPhysics::ResumePhysics tested" );
|
|
591 |
AssertTrueL( ETrue, KResumePhysics );
|
|
592 |
}
|
|
593 |
|
|
594 |
// ---------------------------------------------------------------------------
|
|
595 |
// CBCTestMixMCLGeneralCase::TestCbaL
|
|
596 |
// ---------------------------------------------------------------------------
|
|
597 |
//
|
|
598 |
void CBCTestMixMCLGeneralCase::TestCbaL()
|
|
599 |
{
|
|
600 |
CEikCba* cba = static_cast<CEikCba*>(
|
|
601 |
iAvkonAppUi->Cba()->ButtonGroup()->AsControl() );
|
|
602 |
cba->EnableItemSpecificSoftkey( EFalse );
|
|
603 |
cba->EnableItemSpecificSoftkey( ETrue );
|
|
604 |
_LIT( CEikCbaEnableItemSpecificSoftkey,
|
|
605 |
"CEikCba::EnableItemSpecificSoftkey tested" );
|
|
606 |
AssertTrueL( ETrue, CEikCbaEnableItemSpecificSoftkey );
|
|
607 |
}
|
|
608 |
|
|
609 |
// ---------------------------------------------------------------------------
|
|
610 |
// CBCTestMixMCLGeneralCase::TestCommonDialogsL()
|
|
611 |
// common file test
|
|
612 |
// ---------------------------------------------------------------------------
|
|
613 |
//
|
|
614 |
void CBCTestMixMCLGeneralCase::TestCommonDialogsL()
|
|
615 |
{
|
|
616 |
_LIT( KSetIncludedMediasL,
|
|
617 |
"CAknMemorySelectionSettingItemMultiDrive::SetIncludedMediasL()invoked");
|
|
618 |
|
|
619 |
TInt id = 1;
|
|
620 |
TDriveNumber selDr = EDriveC;
|
|
621 |
|
|
622 |
CAknMemorySelectionSettingItemMultiDrive* settingItem =
|
|
623 |
new ( ELeave ) CAknMemorySelectionSettingItemMultiDrive(
|
|
624 |
id, selDr );
|
|
625 |
CleanupStack::PushL( settingItem );
|
|
626 |
|
|
627 |
TInt includedMedias = AknCommonDialogsDynMem:: EMemoryTypePhone |
|
|
628 |
AknCommonDialogsDynMem:: EMemoryTypeMMC |
|
|
629 |
AknCommonDialogsDynMem:: EMemoryTypeRemote;
|
|
630 |
|
|
631 |
settingItem->SetIncludedMediasL( includedMedias );
|
|
632 |
AssertTrueL( ETrue, KSetIncludedMediasL );
|
|
633 |
|
|
634 |
includedMedias &= (~AknCommonDialogsDynMem:: EMemoryTypePhone );
|
|
635 |
settingItem->SetIncludedMediasL( includedMedias );
|
|
636 |
|
|
637 |
CleanupStack::PopAndDestroy( settingItem );
|
|
638 |
}
|
|
639 |
|
|
640 |
// ---------------------------------------------------------------------------
|
|
641 |
// CBCTestMixMCLGeneralCase::ViewPositionChanged
|
|
642 |
// ---------------------------------------------------------------------------
|
|
643 |
//
|
|
644 |
void CBCTestMixMCLGeneralCase::ViewPositionChanged(
|
|
645 |
const TPoint& /*aNewPosition*/,
|
|
646 |
TBool /*aDrawNow*/,
|
|
647 |
TUint /*aFlags*/ )
|
|
648 |
{
|
|
649 |
}
|
|
650 |
|
|
651 |
// ---------------------------------------------------------------------------
|
|
652 |
// CBCTestMixMCLGeneralCase::PhysicEmulationEnded
|
|
653 |
// ---------------------------------------------------------------------------
|
|
654 |
//
|
|
655 |
void CBCTestMixMCLGeneralCase::PhysicEmulationEnded()
|
|
656 |
{
|
|
657 |
}
|
|
658 |
|
|
659 |
// ---------------------------------------------------------------------------
|
|
660 |
// CBCTestMixMCLGeneralCase::ViewPosition
|
|
661 |
// ---------------------------------------------------------------------------
|
|
662 |
//
|
|
663 |
TPoint CBCTestMixMCLGeneralCase::ViewPosition() const
|
|
664 |
{
|
|
665 |
return TPoint( 0, 0 );
|
|
666 |
}
|
|
667 |
|
|
668 |
// -----------------------------------------------------------------------------
|
|
669 |
// CBCTestMixMCLGeneralCase::TestItemFinderL
|
|
670 |
// -----------------------------------------------------------------------------
|
|
671 |
//
|
|
672 |
void CBCTestMixMCLGeneralCase::TestItemFinderL()
|
|
673 |
{
|
|
674 |
_LIT( KSetItemFinderObserverL,
|
|
675 |
"CItemFinder::SetItemFinderObserverL() tested" );
|
|
676 |
|
|
677 |
CItemFinder* itemfinder = CItemFinder::NewL();
|
|
678 |
CleanupStack::PushL ( itemfinder );
|
|
679 |
|
|
680 |
itemfinder->SetItemFinderObserverL( this );
|
|
681 |
itemfinder->SetItemFinderObserverL( 0 );
|
|
682 |
AssertTrueL( ETrue, KSetItemFinderObserverL );
|
|
683 |
|
|
684 |
CleanupStack::PopAndDestroy( itemfinder );
|
|
685 |
}
|
|
686 |
|
|
687 |
|
|
688 |
// -----------------------------------------------------------------------------
|
|
689 |
// CBCTestMixMCLGeneralCase::TestFindItemDialogL
|
|
690 |
// -----------------------------------------------------------------------------
|
|
691 |
//
|
|
692 |
void CBCTestMixMCLGeneralCase::TestFindItemDialogL()
|
|
693 |
{
|
|
694 |
_LIT( KEnableSingleClick,
|
|
695 |
"CFindItemDialog::EnableSingleClick() tested" );
|
|
696 |
_LIT( KUrlDes, "http://www.symbian.com" );
|
|
697 |
|
|
698 |
CFindItemDialog* dialog = CFindItemDialog::NewL( KUrlDes,
|
|
699 |
CFindItemEngine::EFindItemSearchURLBin );
|
|
700 |
CleanupStack::PushL( dialog );
|
|
701 |
|
|
702 |
dialog->EnableSingleClick ( EFalse );
|
|
703 |
dialog->EnableSingleClick ( ETrue );
|
|
704 |
AssertTrueL( ETrue, KEnableSingleClick );
|
|
705 |
|
|
706 |
CleanupStack::PopAndDestroy( dialog );
|
|
707 |
}
|
|
708 |
|
|
709 |
|
|
710 |
// ---------------------------------------------------------------------------
|
|
711 |
// CBCTestMixMCLGeneralCase::HandleFindItemEventL
|
|
712 |
// ---------------------------------------------------------------------------
|
|
713 |
//
|
|
714 |
void CBCTestMixMCLGeneralCase::HandleFindItemEventL(
|
|
715 |
const CItemFinder::CFindItemExt& /*aItem*/,
|
|
716 |
MAknItemFinderObserver::TEventFlag /*aEvent*/, TUint /*aFlags*/)
|
|
717 |
{
|
|
718 |
// do nothing
|
|
719 |
}
|
|
720 |
|
|
721 |
|
|
722 |
// ---------------------------------------------------------------------------
|
|
723 |
// CBCTestMixMCLGeneralCase::TestAknButtonEnableFeedbackL
|
|
724 |
// ---------------------------------------------------------------------------
|
|
725 |
//
|
|
726 |
void CBCTestMixMCLGeneralCase::TestAknButtonEnableFeedbackL()
|
|
727 |
{
|
|
728 |
CAknButton* button = CAknButton::NewLC();
|
|
729 |
|
|
730 |
button->EnableFeedback( EFalse );
|
|
731 |
button->EnableFeedback( ETrue );
|
|
732 |
|
|
733 |
CleanupStack::PopAndDestroy ( button );
|
|
734 |
|
|
735 |
_LIT( KEnableFeedback, "CAknButton::EnableFeedback tested" );
|
|
736 |
AssertTrueL( ETrue, KEnableFeedback );
|
|
737 |
}
|
|
738 |
|
|
739 |
//end of file
|
|
740 |
|