sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // General window tests sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include "TWINDOW.H" sl@0: sl@0: const TInt ENumCornerInsets=6; sl@0: const TInt corner0[ENumCornerInsets]={0,0,0,0,0,0}; sl@0: const TInt corner1[ENumCornerInsets]={1,0,0,0,0,0}; sl@0: const TInt corner2[ENumCornerInsets]={2,1,0,0,0,0}; sl@0: const TInt corner3[ENumCornerInsets]={3,1,1,0,0,0}; sl@0: const TInt corner5[ENumCornerInsets]={5,3,2,1,1,0}; sl@0: const TInt KBaseUserEvent=61750; //0xF136 - a random number that is unlikely to be used by other applicaions for user event sending sl@0: sl@0: // sl@0: sl@0: CWinTestWindow::CWinTestWindow(TRgb aCol) : CBlankWindow(aCol) sl@0: { sl@0: } sl@0: sl@0: CWinTestWindow::~CWinTestWindow() sl@0: { sl@0: delete iChild; sl@0: } sl@0: sl@0: void CWinTestWindow::ConstructL(TPoint pos,TSize size,CTWinBase *aParent, CWindowGc &aGc, TInt aDepth) sl@0: { sl@0: iWin=RWindow(TheClient->iWs); sl@0: User::LeaveIfError(iWin.Construct(*(aParent->WinTreeNode()),ENullWsHandle)); sl@0: SetExt(pos,size); sl@0: if (aDepth<3) sl@0: { sl@0: iChild=new(ELeave) CWinTestWindow(TRgb::Gray256(iCol.Gray256()+34)); sl@0: size.iWidth-=8; sl@0: size.iHeight-=8; sl@0: iChild->ConstructL(TPoint(4,4),size,this,aGc,aDepth+1); sl@0: } sl@0: Activate(); sl@0: AssignGC(aGc); sl@0: } sl@0: sl@0: // sl@0: sl@0: CEvWindowGroup* CEvWindowGroup::NewLC(CTClient* aClient,CTWsGraphicsBase* aTest) sl@0: { sl@0: CEvWindowGroup* self=new(ELeave) CEvWindowGroup(aClient,aTest); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: return self; sl@0: } sl@0: sl@0: CEvWindowGroup::CEvWindowGroup(CTClient* aClient,CTWsGraphicsBase* aTest) : CTWindowGroup(aClient), iTest(aTest) sl@0: {} sl@0: sl@0: void CEvWindowGroup::ConstructL() sl@0: { sl@0: CTWindowGroup::ConstructL(); sl@0: iGroupWin.EnableReceiptOfFocus(EFalse); sl@0: } sl@0: sl@0: void CEvWindowGroup::SetExpectedEvent(TInt aType) sl@0: { sl@0: iTest->TEST(!iExpectingEvent); sl@0: if (iExpectingEvent) sl@0: { sl@0: _LIT(KLog,"Setting expected event of type %d, when previouse event of type %d has not arrived (GpWinId=%d)."); sl@0: iTest->LOG_MESSAGE4(KLog,aType,iExpectedEvent,iGroupWin.Identifier()); sl@0: } sl@0: iExpectedEvent=aType; sl@0: iExpectingEvent=ETrue; sl@0: } sl@0: sl@0: void CEvWindowGroup::SendEvent(TInt aType) sl@0: { sl@0: TWsEvent event; sl@0: event.SetType(aType); sl@0: iClient->iWs.SendEventToWindowGroup(iGroupWin.Identifier(),event); sl@0: SetExpectedEvent(aType); sl@0: iClient->Flush(); sl@0: } sl@0: sl@0: void CEvWindowGroup::UserEvent(TInt aEventType) sl@0: { sl@0: iTest->TEST(iExpectingEvent && iExpectedEvent==aEventType); sl@0: if (!iExpectingEvent || iExpectedEvent!=aEventType) sl@0: { sl@0: TInt id=iGroupWin.Identifier(); sl@0: if (!iExpectingEvent) sl@0: { sl@0: _LIT(KLog,"Event of type %d recieved when not expecting an event (GpWinId=%d)."); sl@0: iTest->LOG_MESSAGE3(KLog,aEventType,id); sl@0: } sl@0: else sl@0: { sl@0: _LIT(KLog,"Event of type %d when expecting an event of type %d (GpWinId=%d)."); sl@0: iTest->LOG_MESSAGE4(KLog,aEventType,iExpectingEvent,id); sl@0: } sl@0: } sl@0: iExpectingEvent=EFalse; sl@0: } sl@0: sl@0: // sl@0: sl@0: CTWindowTest::CTWindowTest(CTestStep* aStep) : CTWsGraphicsBase(aStep) sl@0: {} sl@0: sl@0: CTWindowTest::~CTWindowTest() sl@0: { sl@0: delete iWin; sl@0: } sl@0: sl@0: void CTWindowTest::ConstructL() sl@0: {} sl@0: sl@0: TInt CTWindowTest::MoveGroup(TAny* aParam) sl@0: { sl@0: RWsSession ws; sl@0: TInt err=ws.Connect(); sl@0: if (err==KErrNone) sl@0: { sl@0: TInt command=static_cast(aParam)->iCommand; sl@0: err=ws.SetWindowGroupOrdinalPosition(command&EIdMask,(command&EPosMask)>>EPosShift); sl@0: ws.Finish(); sl@0: ws.Close(); sl@0: } sl@0: return err; sl@0: } sl@0: sl@0: void CTWindowTest::CreateTestWindowL() sl@0: { sl@0: iWin=new(ELeave) CWinTestWindow(TRgb(0,0,0)); sl@0: iWin->ConstructL(TPoint(1,1),TSize(TestWin->Size().iWidth/2,TestWin->Size().iHeight/2),TheClient->iGroup,*TheClient->iGc,0); sl@0: } sl@0: sl@0: void CTWindowTest::DrawWindows(CWinTestWindow *aWin) sl@0: { sl@0: if (aWin->iChild) sl@0: DrawWindows(aWin->iChild); sl@0: aWin->Win()->BeginRedraw(); sl@0: TheGc->Activate(*aWin->Win()); sl@0: TheGc->DrawRect(TRect(aWin->Win()->Size())); sl@0: TheGc->Deactivate(); sl@0: aWin->Win()->EndRedraw(); sl@0: TheClient->iWs.Flush(); sl@0: } sl@0: sl@0: void CTWindowTest::CheckAndDestroyWindows() sl@0: { sl@0: DrawWindows(iWin); sl@0: delete iWin; sl@0: iWin=NULL; sl@0: } sl@0: sl@0: void CTWindowTest::DestroyWindowWithActiveGc() sl@0: { sl@0: iWin->Win()->BeginRedraw(); sl@0: TheGc->Activate(*iWin->Win()); sl@0: delete iWin; sl@0: TheGc->Deactivate(); sl@0: iWin=NULL; sl@0: } sl@0: sl@0: void CTWindowTest::DestroyWindowWithActiveGc2L() sl@0: { sl@0: iWin->Win()->BeginRedraw(); sl@0: TheGc->Activate(*iWin->Win()); sl@0: CWindowGc *gc1=new(ELeave) CWindowGc(TheClient->iScreen); sl@0: CWindowGc *gc2=new(ELeave) CWindowGc(TheClient->iScreen); sl@0: CWindowGc *gc3=new(ELeave) CWindowGc(TheClient->iScreen); sl@0: gc1->Construct(); sl@0: gc2->Construct(); sl@0: gc3->Construct(); sl@0: gc1->Activate(*iWin->Win()); sl@0: gc2->Activate(*iWin->Win()); sl@0: gc3->Activate(*iWin->Win()); sl@0: delete iWin; sl@0: TheGc->Deactivate(); sl@0: delete gc1; sl@0: delete gc2; sl@0: delete gc3; sl@0: iWin=NULL; sl@0: } sl@0: sl@0: LOCAL_C TInt DoPanicTest(TInt aInt, TAny *aScreenNumber) sl@0: { sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws); sl@0: User::LeaveIfError(screen->Construct((TInt)aScreenNumber)); sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(888); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: sl@0: RWindow redraw(ws); sl@0: redraw.Construct(group,88); sl@0: sl@0: RBackedUpWindow backedUp(ws); sl@0: backedUp.Construct(group,EGray16,99); sl@0: sl@0: RBlankWindow blank(ws); sl@0: blank.Construct(group,111); sl@0: sl@0: RWindowBase *base=NULL; sl@0: TInt source=aInt/10000; sl@0: TInt target=(aInt%10000)/100; sl@0: TInt panic=aInt%100; sl@0: switch(source) sl@0: { sl@0: case 0: sl@0: base= &redraw; sl@0: break; sl@0: case 1: sl@0: base= &backedUp; sl@0: break; sl@0: case 2: sl@0: base= ␣ sl@0: break; sl@0: } sl@0: switch(target) sl@0: { sl@0: case 0: sl@0: { sl@0: RWindow *win=(RWindow *)base; sl@0: switch(panic) sl@0: { sl@0: case 0: sl@0: win->BeginRedraw(); sl@0: break; sl@0: case 1: sl@0: ws.SetAutoFlush(ETrue); sl@0: win->BeginRedraw(TRect(0,0,1,1)); sl@0: ws.SetAutoFlush(EFalse); sl@0: break; sl@0: case 2: sl@0: ws.SetAutoFlush(ETrue); sl@0: win->EndRedraw(); sl@0: ws.SetAutoFlush(EFalse); sl@0: break; sl@0: case 3: sl@0: win->Invalidate(); sl@0: break; sl@0: case 4: sl@0: win->Invalidate(TRect(0,0,1,1)); sl@0: break; sl@0: case 5: sl@0: { sl@0: RRegion region; sl@0: win->GetInvalidRegion(region); sl@0: } sl@0: break; sl@0: case 6: sl@0: win->SetBackgroundColor(TRgb(0,0,0)); sl@0: break; sl@0: case 7: sl@0: return(EWsExitReasonFinished); sl@0: } sl@0: break; sl@0: } sl@0: case 1: sl@0: { sl@0: RBackedUpWindow *win=(RBackedUpWindow *)base; sl@0: switch(panic) sl@0: { sl@0: case 0: sl@0: win->BitmapHandle(); sl@0: break; sl@0: case 1: sl@0: win->UpdateScreen(); sl@0: break; sl@0: case 2: sl@0: win->UpdateScreen(TRegionFix<1>(TRect(10,10,20,20))); sl@0: break; sl@0: case 3: sl@0: win->UpdateBackupBitmap(); sl@0: break; sl@0: case 4: sl@0: win->MaintainBackup(); sl@0: break; sl@0: case 5: sl@0: return(EWsExitReasonFinished); sl@0: } sl@0: break; sl@0: } sl@0: case 2: sl@0: { sl@0: RBlankWindow *win=(RBlankWindow *)base; sl@0: switch(panic) sl@0: { sl@0: case 0: sl@0: win->SetColor(TRgb(0)); sl@0: break; sl@0: case 1: sl@0: return(EWsExitReasonFinished); sl@0: } sl@0: break; sl@0: } sl@0: } sl@0: ws.Flush(); sl@0: return(EWsExitReasonBad); // Should never get here, but it's baaddd if it does sl@0: } sl@0: sl@0: struct TWsLocalStructure sl@0: { sl@0: TInt xPos; sl@0: TInt yPos; sl@0: TInt Length; sl@0: TAny *ptr; sl@0: }; sl@0: sl@0: LOCAL_C TInt DoPanicTest2(TInt aInt, TAny *aScreenNumber) sl@0: { sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: // sl@0: CWsScreenDevice *screen=new(ELeave) CWsScreenDevice(ws); sl@0: screen->Construct((TInt)aScreenNumber); sl@0: // sl@0: RWindowGroup group(ws); sl@0: group.Construct(999); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: sl@0: RWindow win(ws); sl@0: win.Construct(group,122); sl@0: win.Activate(); sl@0: sl@0: switch(aInt) sl@0: { sl@0: case 0: sl@0: { sl@0: win.BeginRedraw(); sl@0: CWindowGc *gc; sl@0: screen->CreateContext(gc); sl@0: gc->Activate(win); sl@0: CFbsFont *font; sl@0: screen->GetNearestFontToDesignHeightInTwips((CFont *&)font,TFontSpec()); sl@0: gc->UseFont(font); sl@0: TWsLocalStructure params; sl@0: params.xPos=0; sl@0: params.yPos=0; sl@0: params.Length=1; sl@0: TPckgC pkg(params); sl@0: TPtr8 ptr(NULL,10,10); sl@0: ws.TestWriteReplyByProvidingRemoteReadAccess(gc->WsHandle(),EWsGcOpDrawTextPtr,pkg,ptr); // Bad source descriptor sl@0: } sl@0: break; sl@0: case 1: sl@0: { sl@0: TPtr8 bad(NULL,0); // Bad descriptor sl@0: ws.TestWriteReplyP(win.WsHandle(),EWsWinOpSize,NULL,0,&bad); // Bad descriptor sl@0: } sl@0: break; sl@0: case 2: sl@0: { sl@0: TSize size; sl@0: TPtr8 bad((TUint8 *)&size,4,4); // Short descriptor sl@0: ws.TestWriteReplyP(win.WsHandle(),EWsWinOpSize,NULL,0,&bad); // Short descriptor sl@0: } sl@0: break; sl@0: case 3: sl@0: win.EnablePointerMoveBuffer(); sl@0: break; sl@0: case 4: sl@0: { sl@0: RBackedUpWindow backup(ws); sl@0: backup.Construct(group,EGray16,123); sl@0: backup.Activate(); sl@0: backup.SetRequiredDisplayMode(EGray16); sl@0: } sl@0: break; sl@0: default: sl@0: return(EWsExitReasonFinished); sl@0: } sl@0: ws.Flush(); sl@0: return(EWsExitReasonBad); // Should never get here, but it's baaddd if it does sl@0: } sl@0: sl@0: LOCAL_C TInt CallWindowFuction(RWindowTreeNode* aWin,TInt aWinType,TInt aFunc,RWsSession aWs) sl@0: { sl@0: switch(aWinType) sl@0: { sl@0: case 0: //Call functions from RWindowTreeNode sl@0: { sl@0: RWindowTreeNode* win=aWin; sl@0: switch(aFunc) sl@0: { sl@0: case 0: sl@0: win->OrdinalPosition(); sl@0: break; sl@0: case 1: sl@0: win->SetOrdinalPosition(1); sl@0: break; sl@0: case 2: sl@0: win->SetOrdinalPosition(1,2); sl@0: break; sl@0: case 3: sl@0: win->FullOrdinalPosition(); sl@0: break; sl@0: case 4: sl@0: win->Parent(); sl@0: break; sl@0: case 5: sl@0: win->PrevSibling(); sl@0: break; sl@0: case 6: sl@0: win->SetFaded(0,RWindowTreeNode::EFadeIncludeChildren); sl@0: break; sl@0: case 7: sl@0: win->WindowGroupId(); sl@0: break; sl@0: //The following can be called on a window with no parent without panicking sl@0: case 8: sl@0: win->ClearPointerCursor(); sl@0: break; sl@0: case 9: sl@0: win->ClientHandle(); sl@0: break; sl@0: case 10: sl@0: win->DisableErrorMessages(); sl@0: break; sl@0: case 11: sl@0: win->DisableFocusChangeEvents(); sl@0: break; sl@0: case 12: sl@0: win->DisableGroupChangeEvents(); sl@0: break; sl@0: case 13: sl@0: win->DisableGroupListChangeEvents(); sl@0: break; sl@0: case 14: sl@0: win->DisableModifierChangedEvents(); sl@0: break; sl@0: case 15: sl@0: win->DisableOnEvents(); sl@0: break; sl@0: case 16: sl@0: win->DisableVisibilityChangeEvents(); sl@0: break; sl@0: case 17: sl@0: win->EnableErrorMessages(EEventControlAlways); sl@0: break; sl@0: case 18: sl@0: win->EnableFocusChangeEvents(); sl@0: break; sl@0: case 19: sl@0: win->EnableGroupChangeEvents(); sl@0: break; sl@0: case 20: sl@0: win->EnableGroupListChangeEvents(); sl@0: break; sl@0: case 21: sl@0: win->EnableModifierChangedEvents(0,EEventControlAlways); sl@0: break; sl@0: case 22: sl@0: win->EnableVisibilityChangeEvents(); sl@0: break; sl@0: case 23: sl@0: win->NextSibling(); sl@0: break; sl@0: case 24: sl@0: win->OrdinalPriority(); sl@0: break; sl@0: case 25: sl@0: win->SetNonFading(0); sl@0: break; sl@0: case 26: sl@0: win->SetPointerCursor(0); sl@0: break; sl@0: case 27: sl@0: win->Child(); sl@0: break; sl@0: case 28: sl@0: return(EWsExitReasonFinished); sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: case 1: //Call functions from RWindowGroup sl@0: { sl@0: RWindowGroup* win=(RWindowGroup*)aWin; sl@0: switch(aFunc) sl@0: { sl@0: case 0: sl@0: win->EnableReceiptOfFocus(ETrue); sl@0: break; sl@0: case 1: sl@0: win->AutoForeground(ETrue); sl@0: break; sl@0: case 2: sl@0: win->SetOrdinalPriorityAdjust(5); sl@0: break; sl@0: case 3: sl@0: win->CaptureKey(20,0,0); sl@0: break; sl@0: case 4: sl@0: win->CaptureKeyUpAndDowns(20,0,0); sl@0: break; sl@0: case 5: sl@0: case 6: sl@0: { sl@0: RWindowGroup group(aWs); sl@0: group.Construct(876); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: if (aFunc==5) sl@0: win->CancelCaptureKey(group.CaptureKey(20,0,0)); sl@0: else sl@0: win->CancelCaptureKeyUpAndDowns(group.CaptureKeyUpAndDowns(20,0,0)); sl@0: } sl@0: break; sl@0: case 7: sl@0: win->AddPriorityKey(20,0,0); sl@0: break; sl@0: case 8: sl@0: win->RemovePriorityKey(20,0,0); sl@0: break; sl@0: case 9: sl@0: case 10: sl@0: { sl@0: RWindowGroup group(aWs); sl@0: group.Construct(765); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: RWindow window(aWs); sl@0: window.Construct(group,79); sl@0: if (aFunc==9) sl@0: win->SetTextCursor(window,TPoint(45,46),TTextCursor()); sl@0: else sl@0: win->SetTextCursor(window,TPoint(55,66),TTextCursor(),TRect(TSize(5,8))); sl@0: } sl@0: break; sl@0: case 11: sl@0: win->CancelTextCursor(); sl@0: break; sl@0: case 12: sl@0: win->SetOwningWindowGroup(456); sl@0: break; sl@0: case 13: sl@0: win->DefaultOwningWindow(); sl@0: break; sl@0: case 14: sl@0: { sl@0: TBufC<8> text(_L("abcdef")); sl@0: win->SetName(text); sl@0: } sl@0: break; sl@0: case 15: sl@0: { sl@0: TBuf<16> text; sl@0: User::LeaveIfError(win->Name(text)); sl@0: } sl@0: break; sl@0: case 16: sl@0: win->Identifier(); sl@0: break; sl@0: case 17: sl@0: win->DisableKeyClick(ETrue); sl@0: break; sl@0: case 18: sl@0: /*{ sl@0: TPtr8 text(NULL,0); sl@0: TUid uid; sl@0: User::LeaveIfError(win->FetchMessage(uid,text)); sl@0: }*/ sl@0: win->Identifier(); sl@0: break; sl@0: case 19: sl@0: User::LeaveIfError(win->EnableScreenChangeEvents()); sl@0: break; sl@0: case 20: sl@0: win->EnableScreenChangeEvents(); sl@0: break; sl@0: case 21: sl@0: win->DisableScreenChangeEvents(); sl@0: break; sl@0: case 22: sl@0: win->SimulatePointerEvent(TRawEvent()); sl@0: break; sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: case 23: sl@0: win->SimulateAdvancedPointerEvent(TRawEvent()); sl@0: break; sl@0: case 24: sl@0: return(EWsExitReasonFinished); sl@0: #else sl@0: case 23: sl@0: return(EWsExitReasonFinished); sl@0: #endif sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: case 2: //Call functions from RWindowBase sl@0: { sl@0: RWindowBase* win=(RWindowBase*)aWin; sl@0: switch(aFunc) sl@0: { sl@0: case 0: sl@0: win->SetPosition(TPoint(7,8)); sl@0: break; sl@0: case 1: sl@0: User::LeaveIfError(win->SetSizeErr(TSize(21,22))); sl@0: break; sl@0: case 2: sl@0: User::LeaveIfError(win->SetExtentErr(TPoint(8,9),TSize(21,22))); sl@0: break; sl@0: case 3: sl@0: win->ClaimPointerGrab(); sl@0: break; sl@0: case 4: sl@0: win->SetVisible(ETrue); sl@0: break; sl@0: case 5: sl@0: win->EnableBackup(); sl@0: break; sl@0: case 6: sl@0: win->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect()); sl@0: break; sl@0: case 7: sl@0: win->PasswordWindow(EPasswordCancel); sl@0: break; sl@0: case 8: sl@0: win->FadeBehind(ETrue); sl@0: break; sl@0: //These can all be called on a window with no parent without panicking sl@0: case 9: sl@0: win->SetVisible(EFalse); sl@0: break; sl@0: case 10: sl@0: { sl@0: RWindowGroup group(aWs); sl@0: group.Construct(567); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: RWindow window(aWs); sl@0: window.Construct(group,97); sl@0: win->InquireOffset(window); sl@0: } sl@0: break; sl@0: case 11: sl@0: win->PointerFilter(0,0); sl@0: break; sl@0: case 12: sl@0: win->SetPointerGrab(ETrue); sl@0: break; sl@0: case 13: sl@0: win->SetPointerCapture(0); sl@0: break; sl@0: case 14: sl@0: win->Size(); sl@0: break; sl@0: case 15: sl@0: win->Position(); sl@0: break; sl@0: case 16: sl@0: User::LeaveIfError(win->SetCornerType(EWindowCorner5,0)); sl@0: break; sl@0: case 17: sl@0: { sl@0: TRegionFix<3> region; sl@0: User::LeaveIfError(win->SetShape(region)); sl@0: } sl@0: break; sl@0: case 18: sl@0: User::LeaveIfError(win->SetRequiredDisplayMode(EColor16)); sl@0: break; sl@0: case 19: sl@0: win->DisplayMode(); sl@0: break; sl@0: case 20: sl@0: win->CancelPointerRepeatEventRequest(); sl@0: break; sl@0: case 21: sl@0: win->AllocPointerMoveBuffer(10,0); sl@0: break; sl@0: case 22: sl@0: win->FreePointerMoveBuffer(); sl@0: break; sl@0: case 23: sl@0: win->DisablePointerMoveBuffer(); sl@0: break; sl@0: case 24: sl@0: { sl@0: TBuf8<16> buf; sl@0: win->RetrievePointerMoveBuffer(buf); sl@0: } sl@0: break; sl@0: case 25: sl@0: win->DiscardPointerMoveBuffer(); sl@0: break; sl@0: case 26: sl@0: User::LeaveIfError(win->AddKeyRect(TRect(TSize(10,10)),20,ETrue)); sl@0: break; sl@0: case 27: sl@0: win->RemoveAllKeyRects(); sl@0: break; sl@0: case 28: sl@0: win->EnablePointerMoveBuffer(); sl@0: break; sl@0: case 29: sl@0: return(EWsExitReasonFinished); sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: case 3: //Call functions from RDrawableWindow sl@0: { sl@0: RDrawableWindow* win=(RDrawableWindow*)aWin; sl@0: switch(aFunc) sl@0: { sl@0: //The following can be called on a window with no parent without panicking sl@0: case 0: sl@0: win->Scroll(TPoint(7,8)); sl@0: break; sl@0: case 1: sl@0: win->Scroll(TRect(9,10,11,12),TPoint(13,14)); sl@0: break; sl@0: case 2: sl@0: win->Scroll(TPoint(15,16),TRect(17,18,19,20)); sl@0: break; sl@0: case 3: sl@0: win->Scroll(TRect(21,22,23,24),TPoint(25,26),TRect(27,28,29,30)); sl@0: break; sl@0: case 4: sl@0: return(EWsExitReasonFinished); sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: case 4: //Call functions from RBlankWindow sl@0: { sl@0: RBlankWindow* win=(RBlankWindow*)aWin; sl@0: switch(aFunc) sl@0: { sl@0: case 0: sl@0: win->SetSize(TSize(7,8)); sl@0: break; sl@0: case 1: sl@0: win->SetExtent(TPoint(27,28),TSize(17,18)); sl@0: break; sl@0: //The following function can be called on a window with no parent without panicking sl@0: case 2: sl@0: win->SetColor(TRgb::Gray4(2)); sl@0: break; sl@0: case 3: sl@0: return(EWsExitReasonFinished); sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: case 5: //Call functions from RWindow sl@0: { sl@0: RWindow* win=(RWindow*)aWin; sl@0: switch(aFunc) sl@0: { sl@0: case 0: sl@0: win->BeginRedraw(); sl@0: break; sl@0: case 1: sl@0: aWs.SetAutoFlush(ETrue); sl@0: win->BeginRedraw(TRect(31,32,43,44)); sl@0: aWs.SetAutoFlush(EFalse); sl@0: break; sl@0: case 2: sl@0: win->SetSize(TSize(5,6)); sl@0: break; sl@0: case 3: sl@0: win->SetExtent(TPoint(25,26),TSize(15,16)); sl@0: break; sl@0: //The following can be called on a window with no parent without panicking sl@0: case 4: sl@0: win->Invalidate(); sl@0: break; sl@0: case 5: sl@0: win->Invalidate(TRect(51,52,63,64)); sl@0: break; sl@0: case 6: //These ones don't panic sl@0: aWs.SetAutoFlush(ETrue); sl@0: win->EndRedraw(); sl@0: aWs.SetAutoFlush(EFalse); sl@0: break; sl@0: case 7: sl@0: { sl@0: RRegion region; sl@0: win->GetInvalidRegion(region); sl@0: } sl@0: break; sl@0: case 8: sl@0: win->SetBackgroundColor(TRgb::Gray4(1)); sl@0: break; sl@0: case 9: sl@0: win->SetBackgroundColor(); sl@0: break; sl@0: case 10: sl@0: return(EWsExitReasonFinished); sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: case 6: //Call functions from RBackedUpWindow sl@0: { sl@0: RBackedUpWindow* win=(RBackedUpWindow*)aWin; sl@0: switch(aFunc) //None of these functions panic sl@0: { sl@0: //The following can be called on a window with no parent without panicking sl@0: case 0: sl@0: win->BitmapHandle(); sl@0: break; sl@0: case 1: sl@0: win->UpdateBackupBitmap(); sl@0: break; sl@0: case 2: sl@0: win->MaintainBackup(); sl@0: break; sl@0: case 3: sl@0: win->UpdateScreen(); sl@0: break; sl@0: case 4: sl@0: win->UpdateScreen(TRegionFix<1>(TRect(1,1,22,22))); sl@0: break; sl@0: case 5: sl@0: return(EWsExitReasonFinished); sl@0: default:; sl@0: } sl@0: } sl@0: break; sl@0: } sl@0: aWs.Flush(); sl@0: return(EWsExitReasonBad); // Should never get here, but it's baaddd if it does sl@0: } sl@0: sl@0: LOCAL_C TInt DoPanicTest3(TInt aInt, TAny *aScreenNumber) sl@0: { sl@0: TInt winType=aInt/CTWindowTest::EWinTypeFactor; sl@0: TInt func=aInt%CTWindowTest::EWinTypeFactor; sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws); sl@0: User::LeaveIfError(screen->Construct((TInt)aScreenNumber)); sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(888); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: RWindow window(ws); sl@0: window.Construct(group,789); sl@0: RWindowTreeNode* win; sl@0: if (winType==1) sl@0: win=&window; sl@0: else sl@0: win=&group; sl@0: sl@0: return CallWindowFuction(win,winType,func,ws); sl@0: } sl@0: sl@0: //PanicTestNoPanic sl@0: //This function is called from DoPanicTest4 for window functions that should run without sl@0: //panicking the user thread if its parent has been deleted. sl@0: TInt PanicTestNoPanic(RWindowTreeNode* aWin,TInt aWinType,TInt aFunc,RWsSession aWs,const TInt* const aFuncToSkip) sl@0: { sl@0: TInt funcReturn; sl@0: for(;;) sl@0: { sl@0: if (aFuncToSkip && *aFuncToSkip == aFunc) sl@0: { sl@0: aFunc++; sl@0: } sl@0: funcReturn = CallWindowFuction(aWin,aWinType,aFunc,aWs); sl@0: if (funcReturn==EWsExitReasonBad) sl@0: { sl@0: aFunc++; sl@0: } sl@0: else if (funcReturn==EWsExitReasonFinished) sl@0: { sl@0: return EWsExitReasonFinished; sl@0: } sl@0: else sl@0: { sl@0: return EWsExitReasonBad; sl@0: } sl@0: } sl@0: } sl@0: sl@0: LOCAL_C TInt DoPanicTest4(TInt aInt, TAny *aScreenNumber) sl@0: { sl@0: TInt winType=aInt/CTWindowTest::EWinTypeFactor; sl@0: TInt func=aInt%CTWindowTest::EWinTypeFactor; sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws); sl@0: User::LeaveIfError(screen->Construct((TInt)aScreenNumber)); sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(234); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: RWindow window(ws); sl@0: window.Construct(group,897); sl@0: RBackedUpWindow backedUp(ws); sl@0: backedUp.Construct(group,EGray16,98); sl@0: RBlankWindow blank(ws); sl@0: blank.Construct(group,169); sl@0: RWindowTreeNode* win=&window; sl@0: switch (winType) sl@0: { sl@0: case 0: sl@0: { sl@0: if (func > 8) //if a func 8+ had panicked, fail the test sl@0: { sl@0: return EWsExitReasonBad; sl@0: } sl@0: else if (func==8) sl@0: { sl@0: group.Close(); sl@0: return PanicTestNoPanic(win,winType,func,ws,NULL); sl@0: } sl@0: } sl@0: break; sl@0: case 2: sl@0: { sl@0: if (func>9) //if a func 9+ had panicked, fail the test sl@0: { sl@0: return EWsExitReasonBad; sl@0: } sl@0: else if (func==9) //set window visible so that SetVisible(EFalse) (func 9) would crash before fix sl@0: { sl@0: window.SetVisible(ETrue); sl@0: ws.Flush(); sl@0: group.Close(); sl@0: TInt funcToSkip = 28; //this call needs to have already successfully allocated a pointer cursor sl@0: return PanicTestNoPanic(win,winType,func,ws,&funcToSkip); sl@0: } sl@0: } sl@0: break; sl@0: case 4: sl@0: { sl@0: win=␣ sl@0: if (func>2) //if a func 2+ had panicked, fail the test sl@0: { sl@0: return EWsExitReasonBad; sl@0: } sl@0: else if (func==2) sl@0: { sl@0: group.Close(); sl@0: return PanicTestNoPanic(win,winType,func,ws,NULL); sl@0: } sl@0: } sl@0: break; sl@0: case 5: sl@0: { sl@0: if (func>6) //if a func 4+ had panicked, fail the test sl@0: { sl@0: return EWsExitReasonBad; sl@0: } sl@0: else if (func==4 || func==5) sl@0: { sl@0: if (CallWindowFuction(win,winType,func,ws)==EWsExitReasonBad) sl@0: { sl@0: func = 1; sl@0: } sl@0: else sl@0: { sl@0: return EWsExitReasonBad; sl@0: } sl@0: } sl@0: else if (func==6) sl@0: { sl@0: group.Close(); sl@0: TInt funcToSkip = 6; //Skip the call to EndRedraw in CallWindowFunction, it is not safe to call it on Window casts. sl@0: return PanicTestNoPanic(win,winType,func,ws,&funcToSkip); sl@0: } sl@0: } sl@0: break; sl@0: case 6: sl@0: { sl@0: win=&backedUp; sl@0: if (func>0) sl@0: return EWsExitReasonBad; sl@0: else //if (func==0) sl@0: { sl@0: TInt end=2; sl@0: while (func==0) sl@0: { sl@0: group.Close(); sl@0: while (CallWindowFuction(win,winType,func,ws)==EWsExitReasonBad && ++funcConstruct((TInt)aScreenNumber); sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(235); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: RWindow window(ws); sl@0: window.Construct(group,896); sl@0: CWindowGc *gc=new(ELeave) CWindowGc(scrDev); sl@0: gc->Construct(); sl@0: gc->Activate(window); sl@0: group.Close(); sl@0: switch (aTest) sl@0: { sl@0: case 0: sl@0: gc->Deactivate(); sl@0: gc->Activate(window); sl@0: break; sl@0: case 1: sl@0: gc->DrawLine(TPoint(0,0),TPoint(10,10)); sl@0: break; sl@0: default: sl@0: return(EWsExitReasonFinished); sl@0: } sl@0: ws.Flush(); sl@0: return(EWsExitReasonBad); // Should never get here, but it's baaddd if it does sl@0: } sl@0: sl@0: #if defined(_DEBUG) sl@0: LOCAL_C TInt DoPanicTest6(TInt /*aInt*/, TAny *aScreenNumber) sl@0: { sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: RWindowGroup group1(ws); sl@0: CWsScreenDevice* screen=new(ELeave) CWsScreenDevice(ws); sl@0: User::LeaveIfError(screen->Construct((TInt)aScreenNumber)); sl@0: group1.Construct(123456,ETrue,screen); sl@0: RWindowGroup group2(ws); sl@0: group2.Construct(123456,ETrue,screen); // Should panic client here sl@0: return(EWsExitReasonBad); // Should never get here sl@0: } sl@0: #endif sl@0: sl@0: void CTWindowTest::TestInvalidFunctionsL() sl@0: // sl@0: // This code casts windows to be different types and then sends messages for the 'cast' that sl@0: // should not be sent to the original type of window. These should all result in panics sl@0: // sl@0: { sl@0: static TClientPanic PanicCode[]={EWservPanicDescriptor,EWservPanicDescriptor,EWservPanicDescriptor, sl@0: EWservPanicNoPointerBuffer,EWservPanicBackupDisplayMode, sl@0: EWservPanicNoFont}; // Dummy end value to catch out overflowing the array sl@0: INFO_PRINTF1(_L("AUTO Test Invalid Functions ")); sl@0: INFO_PRINTF1(_L(" Opcode Panics")); sl@0: sl@0: for (TInt source=0;source<3;source++) sl@0: for (TInt target=0;target<3;target++) sl@0: if (source!=target) sl@0: for (TInt panic=0;;panic++) sl@0: { sl@0: TBool testFinished=EFalse; sl@0: TEST(iTest->TestWsPanicL(DoPanicTest,EWservPanicOpcode,source*10000+target*100+panic,(TAny*)iTest->iScreenNumber,&testFinished)); sl@0: if (testFinished) sl@0: break; sl@0: } sl@0: _LIT(KSet,"Various Different Panics"); sl@0: INFO_PRINTF1(KSet); sl@0: RDebug::Print(KPlatsecBegin); sl@0: for(TInt index=0;;index++) sl@0: { sl@0: TBool testFinished=EFalse; sl@0: TEST(iTest->TestWsPanicL(DoPanicTest2,PanicCode[index],index,(TAny*)iTest->iScreenNumber,&testFinished)); sl@0: if (testFinished) sl@0: break; sl@0: } sl@0: RDebug::Print(KPlatsecEnd); sl@0: iTest->CloseAllPanicWindows(); sl@0: } sl@0: sl@0: void CTWindowTest::ShadowAutoClearTest() sl@0: { sl@0: RWindowGroup group(TheClient->iWs); sl@0: group.Construct(1111); sl@0: group.EnableReceiptOfFocus(EFalse); // Stop auto group switching on close sl@0: sl@0: RWindow background(TheClient->iWs); sl@0: background.Construct(group,133); sl@0: background.SetBackgroundColor(); sl@0: background.Activate(); sl@0: sl@0: background.BeginRedraw(); sl@0: TheClient->iGc->Activate(background); sl@0: TheClient->iGc->SetBrushColor(TRgb::Gray4(1)); sl@0: TheClient->iGc->Clear(); sl@0: background.EndRedraw(); sl@0: // sl@0: RBlankWindow tab2(TheClient->iWs); sl@0: tab2.Construct(group,144); sl@0: tab2.SetExtent(TPoint(10,00),TSize(200,10)); sl@0: tab2.SetColor(TRgb::Gray256(170)); sl@0: tab2.SetShadowHeight(1); sl@0: tab2.Activate(); sl@0: RBlankWindow tab1(TheClient->iWs); sl@0: tab1.Construct(group,155); sl@0: tab1.SetExtent(TPoint(70,00),TSize(10,10)); sl@0: tab1.SetColor(TRgb::Gray256(170)); sl@0: tab1.SetShadowHeight(1); sl@0: tab1.Activate(); sl@0: RBlankWindow blank(TheClient->iWs); sl@0: blank.Construct(group,156); sl@0: blank.SetExtent(TPoint(50,10),TSize(100,100)); sl@0: blank.SetColor(TRgb::Gray256(170)); sl@0: blank.SetShadowHeight(0); sl@0: blank.Activate(); sl@0: // sl@0: tab1.Close(); sl@0: tab1.Construct(group,166); sl@0: tab1.SetExtent(TPoint(50,00),TSize(10,10)); sl@0: tab1.SetColor(TRgb::Gray256(170)); sl@0: tab1.SetShadowHeight(1); sl@0: tab1.Activate(); sl@0: blank.Close(); sl@0: RBlankWindow blank2(TheClient->iWs); sl@0: blank2.Construct(group,177); sl@0: blank2.SetColor(TRgb::Gray256(255)); sl@0: blank2.SetExtent(TPoint(10,10),TSize(100,120)); sl@0: blank2.SetShadowHeight(2); sl@0: blank2.Activate(); sl@0: TheClient->iWs.Flush(); sl@0: // sl@0: background.BeginRedraw(); sl@0: TheClient->iGc->SetBrushColor(TRgb::Gray4(1)); sl@0: TheClient->iGc->Clear(); sl@0: background.EndRedraw(); sl@0: // sl@0: tab1.Close(); sl@0: tab2.Close(); sl@0: blank2.Close(); sl@0: background.BeginRedraw(); sl@0: TheClient->iGc->Clear(); sl@0: TheClient->iGc->Deactivate(); sl@0: background.EndRedraw(); sl@0: TheClient->iWs.Finish(); sl@0: TSize size=TheClient->iScreen->SizeInPixels(); sl@0: TBool rectCompare = TheClient->iScreen->RectCompare(TRect(0,0,size.iWidth>>1,size.iHeight),TRect(size.iWidth>>1,0,(size.iWidth>>1)<<1,size.iHeight)); sl@0: TEST(rectCompare); sl@0: if(!rectCompare) sl@0: INFO_PRINTF3(_L("TheClient->iScreen->RectCompare return value - Expected: %d, Actual: %d"), ETrue, rectCompare); sl@0: background.Close(); sl@0: group.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::ClearRedraw(RWindow &aWindow, TRgb aRgb) sl@0: { sl@0: aWindow.BeginRedraw(); sl@0: TheClient->iGc->Activate(aWindow); sl@0: TheClient->iGc->SetBrushColor(aRgb); sl@0: TheClient->iGc->Clear(); sl@0: TheClient->iGc->Deactivate(); sl@0: aWindow.EndRedraw(); sl@0: } sl@0: sl@0: void CTWindowTest::CheckCorner(TCorner aCorner, const TInt *aInsetList) sl@0: { sl@0: TRect rect(TPoint(1,1),iBlankWin2->Size()); sl@0: TPoint pos; sl@0: TInt direction; sl@0: if (aCorner==ECornerTL || aCorner==ECornerTR) sl@0: { sl@0: pos.iY=rect.iTl.iY; sl@0: direction=1; sl@0: } sl@0: else sl@0: { sl@0: pos.iY=rect.iBr.iY-1; sl@0: direction= -1; sl@0: } sl@0: if (aCorner==ECornerTL || aCorner==ECornerBL) sl@0: pos.iX=rect.iTl.iX; sl@0: else sl@0: pos.iX=rect.iBr.iX-8; sl@0: TRgb rgbBuf[8]; sl@0: TPtr8 desc((TUint8 *)rgbBuf,sizeof(rgbBuf)); sl@0: for(TInt count=0;countGetScanLine(desc,pos,8,EColor16MA); sl@0: if (aCorner==ECornerTR || aCorner==ECornerBR) sl@0: { sl@0: for(TInt loop=0;loop<4;loop++) sl@0: { sl@0: TRgb tmp=rgbBuf[loop]; sl@0: rgbBuf[loop]=rgbBuf[8-1-loop]; sl@0: rgbBuf[8-1-loop]=tmp; sl@0: } sl@0: } sl@0: // We can't compare rgb value from original source against screen value in EColor64K mode as sl@0: // the color component might be truncated (EColor64K is 16-bit using format RGB565), sl@0: // ie R or B components might be reduced from 8-bit to 5-bit and G from 8-bit to 6-bit sl@0: // sl@0: // For example: RGB value of Gray4(1) is 0x555555, it is drawn to screen in RGB565 as 0x52AA, sl@0: // when it's converted back to RGB for comparison, the value becomes 0x525552 sl@0: TRgb col1=TRgb::Gray4(1); sl@0: TRgb col2=TRgb::Gray4(3); sl@0: if (iScreenDev->DisplayMode()==EColor64K) sl@0: { sl@0: col1=TRgb::Color64K(col1.Color64K()); sl@0: col2=TRgb::Color64K(col2.Color64K()); sl@0: } sl@0: TInt loop2=0; sl@0: for(;loop2BaseWin()->SetCornerType(aCornerType,aFlags); sl@0: if (!(aFlags&EWindowCornerNotTL)) sl@0: CheckCorner(ECornerTL, corners); sl@0: if (!(aFlags&EWindowCornerNotTR)) sl@0: CheckCorner(ECornerTR, corners); sl@0: if (!(aFlags&EWindowCornerNotBL)) sl@0: CheckCorner(ECornerBL, corners); sl@0: if (!(aFlags&EWindowCornerNotBR)) sl@0: CheckCorner(ECornerBR, corners); sl@0: // sl@0: if (aFlags&EWindowCornerNotTL) sl@0: CheckCorner(ECornerTL, corner0); sl@0: if (aFlags&EWindowCornerNotTR) sl@0: CheckCorner(ECornerTR, corner0); sl@0: if (aFlags&EWindowCornerNotBL) sl@0: CheckCorner(ECornerBL, corner0); sl@0: if (aFlags&EWindowCornerNotBR) sl@0: CheckCorner(ECornerBR, corner0); sl@0: } sl@0: sl@0: void CTWindowTest::doCornerTestsL() sl@0: { sl@0: iScreenDev=new(ELeave) CWsScreenDevice(TheClient->iWs); sl@0: User::LeaveIfError(iScreenDev->Construct(iTest->iScreenNumber)); sl@0: iBlankWin1=new(ELeave) CTBlankWindow(); sl@0: iBlankWin1->SetUpL(TPoint(1,1),TSize(100,50),TheClient->iGroup,*TheClient->iGc); sl@0: iBlankWin1->SetColor(TRgb::Gray4(1)); sl@0: iBlankWin2=new(ELeave) CTBlankWindow(); sl@0: iBlankWin2->SetUpL(TPoint(1,1),iBlankWin1->Size(),TheClient->iGroup,*TheClient->iGc); sl@0: iBlankWin2->SetColor(TRgb::Gray4(3)); sl@0: iBlankWin2->BaseWin()->SetShadowHeight(0); sl@0: doCornerTest(EWindowCornerSquare,0); sl@0: doCornerTest(EWindowCornerSquare,EWindowCornerNotBL); sl@0: doCornerTest(EWindowCorner1,0); // 0 + all corners missing sl@0: doCornerTest(EWindowCorner1,EWindowCornerNotTL|EWindowCornerNotTR|EWindowCornerNotBL|EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner2,0); // 0 + all sets of 3 corners missing sl@0: doCornerTest(EWindowCorner2,EWindowCornerNotTR|EWindowCornerNotBL|EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner2,EWindowCornerNotTL|EWindowCornerNotBL|EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner2,EWindowCornerNotTL|EWindowCornerNotTR|EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner2,EWindowCornerNotTL|EWindowCornerNotTR|EWindowCornerNotBL); sl@0: doCornerTest(EWindowCorner3,0); // 0 + all 4 individual corners missing sl@0: doCornerTest(EWindowCorner3,EWindowCornerNotTL); sl@0: doCornerTest(EWindowCorner3,EWindowCornerNotTR); sl@0: doCornerTest(EWindowCorner3,EWindowCornerNotBL); sl@0: doCornerTest(EWindowCorner3,EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner5,0); // 0 + all pairs of corners missing sl@0: doCornerTest(EWindowCorner5,EWindowCornerNotTL|EWindowCornerNotTR); sl@0: doCornerTest(EWindowCorner5,EWindowCornerNotTL|EWindowCornerNotBL); sl@0: doCornerTest(EWindowCorner5,EWindowCornerNotTL|EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner5,EWindowCornerNotTR|EWindowCornerNotBL); sl@0: doCornerTest(EWindowCorner5,EWindowCornerNotTR|EWindowCornerNotBR); sl@0: doCornerTest(EWindowCorner5,EWindowCornerNotBL|EWindowCornerNotBR); sl@0: } sl@0: sl@0: void CTWindowTest::CornerTests() sl@0: { sl@0: TRAP_IGNORE(doCornerTestsL()); sl@0: delete iBlankWin2; sl@0: delete iBlankWin1; sl@0: delete iScreenDev; sl@0: } sl@0: sl@0: LOCAL_C void doMegaTreeThread(TInt aScreenNumber) sl@0: { sl@0: CTrapCleanup::New(); sl@0: RWsSession ws; sl@0: ws.Connect(); sl@0: CWsScreenDevice *scrDev=new(ELeave) CWsScreenDevice(ws); sl@0: scrDev->Construct(aScreenNumber); sl@0: RWindowGroup group(ws); sl@0: group.Construct(1); sl@0: group.EnableReceiptOfFocus(EFalse); sl@0: RWindow parent(ws); sl@0: parent.Construct(group,123); sl@0: parent.Activate(); sl@0: CWindowGc *gc=new(ELeave) CWindowGc(scrDev); sl@0: gc->Construct(); sl@0: TSize max(parent.Size()); sl@0: RWindow prev=parent; sl@0: TBool horiz=EFalse; sl@0: TInt color=0; sl@0: for(TInt count=0;count<100;count++) sl@0: { sl@0: RWindow win(ws); sl@0: if (win.Construct(prev,ENullWsHandle)!=KErrNone) sl@0: break; sl@0: win.SetExtent(horiz?TPoint(1,0):TPoint(0,1),max); sl@0: win.SetBackgroundColor(TRgb::Gray4(color)); sl@0: color=(color+1)%4; sl@0: win.Activate(); sl@0: win.BeginRedraw(); sl@0: gc->Activate(win); sl@0: gc->Clear(); sl@0: gc->Deactivate(); sl@0: win.EndRedraw(); sl@0: prev=win; sl@0: horiz=!horiz; sl@0: } sl@0: parent.SetVisible(EFalse); sl@0: parent.SetVisible(ETrue); sl@0: parent.SetPosition(TPoint(-1,-1)); sl@0: parent.SetPosition(TPoint(0,0)); sl@0: parent.Close(); sl@0: ws.Close(); sl@0: } sl@0: sl@0: LOCAL_C TInt MegaTreeThread(TAny *aScreenNumber) sl@0: { sl@0: TRAPD(err,doMegaTreeThread((TInt)aScreenNumber)); sl@0: return(err); sl@0: } sl@0: sl@0: void CTWindowTest::CreateMegaTree() sl@0: { sl@0: const TUint KThreadHeapSize=0x2000; sl@0: RThread thread; sl@0: if (thread.Create(_L("MegaTree"),MegaTreeThread,KDefaultStackSize,KThreadHeapSize,KThreadHeapSize,(TAny*)iTest->iScreenNumber,EOwnerThread)==KErrNone) sl@0: { sl@0: TRequestStatus stat; sl@0: thread.Logon(stat); sl@0: thread.Resume(); sl@0: User::WaitForRequest(stat); sl@0: TEST(stat==KErrNone); sl@0: } sl@0: thread.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::TiledWindowTestL() sl@0: { sl@0: RWindow parent(TheClient->iWs); sl@0: User::LeaveIfError(parent.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&parent)); sl@0: parent.SetExtent(TPoint(10,10),TSize(50,50)); sl@0: parent.Activate(); sl@0: // sl@0: RWindow child1(TheClient->iWs); sl@0: User::LeaveIfError(child1.Construct(parent,ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child1)); sl@0: child1.SetExtent(TPoint(0,0),TSize(50,20)); sl@0: child1.Activate(); sl@0: // sl@0: RWindow child2(TheClient->iWs); sl@0: User::LeaveIfError(child2.Construct(parent,ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child2)); sl@0: child2.SetExtent(TPoint(0,20),TSize(50,30)); sl@0: child2.Activate(); sl@0: // sl@0: child1.BeginRedraw(); sl@0: TSize rect1Size(25,20); sl@0: TheGc->Activate(child1); sl@0: TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush); sl@0: TheGc->DrawRect(TRect(rect1Size)); sl@0: TheGc->DrawRect(TRect(TPoint(rect1Size.iWidth,0),rect1Size)); sl@0: TheGc->Deactivate(); sl@0: child1.EndRedraw(); sl@0: // sl@0: child2.BeginRedraw(); sl@0: TSize rect2Size(25,30); sl@0: TheGc->Activate(child2); sl@0: TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush); sl@0: TheGc->DrawRect(TRect(rect2Size)); sl@0: TheGc->DrawRect(TRect(TPoint(rect2Size.iWidth,0),rect2Size)); sl@0: TheGc->Deactivate(); sl@0: child2.EndRedraw(); sl@0: // sl@0: // Left and right halves should be identical sl@0: // sl@0: TBool rectCompare = !TheClient->iScreen->RectCompare(TRect(10,10,35,60),TRect(35,10,70,60)); sl@0: TEST(rectCompare); sl@0: if(!rectCompare) sl@0: INFO_PRINTF3(_L("TheClient->iScreen->RectCompare return value - Expected: %d, Actual: %d"), ETrue, rectCompare); sl@0: // sl@0: CleanupStack::PopAndDestroy(3); sl@0: } sl@0: sl@0: void CTWindowTest::TiledWindowTest2L() sl@0: { sl@0: TSize size(200,240); //Parent Windows sl@0: TSize childSize(TSize(size.iWidth/2,size.iHeight/2)); //Child Windows sl@0: TSize dialogueSize(50,50); sl@0: sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow parent1(TheClient->iWs); sl@0: User::LeaveIfError(parent1.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&parent1)); sl@0: parent1.SetExtent(TPoint(240,0),size); sl@0: parent1.SetColor(TRgb::Gray4(2)); sl@0: parent1.Activate(); sl@0: sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow parent2(TheClient->iWs); sl@0: User::LeaveIfError(parent2.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&parent2)); sl@0: parent2.SetExtent(TPoint(440,0),size); sl@0: parent2.SetColor(TRgb::Gray4(2)); sl@0: parent2.Activate(); sl@0: sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow child1(TheClient->iWs); sl@0: User::LeaveIfError(child1.Construct(parent1,ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child1)); sl@0: child1.SetExtent(TPoint(0,0),childSize); sl@0: child1.SetColor(TRgb::Gray4(2)); sl@0: child1.Activate(); sl@0: sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow child2(TheClient->iWs); sl@0: User::LeaveIfError(child2.Construct(parent1,ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child2)); sl@0: child2.SetExtent(TPoint(0,childSize.iHeight),childSize); sl@0: child2.SetColor(TRgb::Gray4(2)); sl@0: child2.Activate(); sl@0: sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow child3(TheClient->iWs); sl@0: User::LeaveIfError(child3.Construct(parent1,ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child3)); sl@0: child3.SetExtent(TPoint(childSize.iWidth,0),TSize(childSize.iWidth,size.iHeight)); sl@0: child3.SetColor(TRgb::Gray4(2)); sl@0: child3.Activate(); sl@0: sl@0: TPoint dialoguePos(375,93); sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow dialog1(TheClient->iWs); sl@0: User::LeaveIfError(dialog1.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&dialog1)); sl@0: dialog1.SetExtent(dialoguePos,dialogueSize); sl@0: dialog1.SetColor(TRgb::Gray4(3)); sl@0: dialog1.SetShadowHeight(4); sl@0: dialog1.Activate(); sl@0: sl@0: TheClient->iWs.SetAutoFlush(ETrue); sl@0: RBlankWindow dialog2(TheClient->iWs); sl@0: User::LeaveIfError(dialog2.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: CleanupStack::PushL(TCleanupItem(CleanUpWindow,&dialog2)); sl@0: dialog2.SetExtent(TPoint(dialoguePos.iX+size.iWidth,dialoguePos.iY),dialogueSize); sl@0: dialog2.SetColor(TRgb::Gray4(3)); sl@0: dialog2.SetShadowHeight(0); sl@0: dialog2.Activate(); sl@0: sl@0: TInt ii; sl@0: for (ii=400;ii>374;ii-=25) sl@0: dialog1.SetPosition(TPoint(ii,93)); sl@0: TheClient->iWs.SetAutoFlush(EFalse); sl@0: CleanupStack::PopAndDestroy(7); sl@0: } sl@0: sl@0: void CTWindowTest::ColorTestL() sl@0: { sl@0: if (iTest->MaxGrays() == 0) sl@0: return; sl@0: sl@0: _LIT(KSet,"AUTO Color Test "); sl@0: INFO_PRINTF1(KSet); sl@0: RWindow window(TheClient->iWs); sl@0: User::LeaveIfError(window.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: PushWindowL(&window); sl@0: window.SetExtent(TPoint(10,10),TSize(50,50)); sl@0: window.Activate(); sl@0: TInt colorMode,mode; sl@0: TInt currentMode=TheClient->iScreen->DisplayMode(); sl@0: TEST(currentMode==EGray4 || currentMode==EColor16 || currentMode==EColor256 || currentMode == EColor64K); sl@0: if(currentMode!=EGray4 && currentMode!=EColor16 && currentMode!=EColor256 && currentMode != EColor64K) sl@0: INFO_PRINTF5(_L("TheClient->iScreen->DisplayMode() return value - Expected: %d or %d or %d, Actual: %d"), EGray4, EColor16, EColor256, currentMode); sl@0: INFO_PRINTF1(_L(" Done Setup")); sl@0: for(colorMode=EGray4;colorMode log; sl@0: log.Format(KModes,colorMode,mode,currentMode); sl@0: INFO_PRINTF1(log); sl@0: } sl@0: if (mode>ERgb && colorMode==EColor64K) sl@0: break; sl@0: TEST(mode==currentMode || mode==colorMode ); sl@0: if (mode!=currentMode && mode!=colorMode) sl@0: INFO_PRINTF4(_L("window.DisplayMode() return value - Expected: %d or %d, Actual: %d"), currentMode, colorMode, mode); sl@0: INFO_PRINTF1(_L(" Loop 2")); sl@0: if (mode>currentMode) sl@0: currentMode=mode; sl@0: if (colorMode==EColor16) sl@0: window.SetSize(TSize(40,60)); sl@0: else if (colorMode==EColor4K) sl@0: window.SetSize(TSize(60,40)); sl@0: mode=TheClient->iScreen->DisplayMode(); sl@0: if(TDisplayModeUtils::NumDisplayModeColors(STATIC_CAST(TDisplayMode,currentMode))==16777216) sl@0: { sl@0: TEST(mode==CFbsDevice::DisplayMode16M()); sl@0: if (mode!=CFbsDevice::DisplayMode16M()) sl@0: INFO_PRINTF3(_L("window.DisplayMode() return value - Expected: %d, Actual: %d"), CFbsDevice::DisplayMode16M(), mode); sl@0: } sl@0: else sl@0: { sl@0: TEST(currentMode==mode || currentMode==colorMode); sl@0: if (currentMode!=mode && currentMode!=colorMode) sl@0: INFO_PRINTF3(_L("TheClient->iScreen->DisplayMode() return value return value - Expected: %d , Actual: %d"), currentMode, mode); sl@0: } sl@0: } sl@0: INFO_PRINTF1(_L(" Done First Loop")); sl@0: TInt color,gray; sl@0: TDisplayMode defMode=TheClient->iWs.GetDefModeMaxNumColors(color,gray); sl@0: TInt screenNo =TheClient->iScreen->GetScreenNumber(); sl@0: TDisplayMode defModeForScreen=TheClient->iWs.GetDefModeMaxNumColors(screenNo,color,gray); sl@0: TEST(defMode==defModeForScreen); sl@0: if (defMode!=defModeForScreen) sl@0: INFO_PRINTF3(_L("TheClient->iScreen->DisplayMode() return value return value - Expected: %d , Actual: %d"), defMode, defModeForScreen); sl@0: if (color==16777216 && gray==256) sl@0: { sl@0: TEST(defMode==EGray4 || defMode==EColor256 || defMode==EColor64K); //WINS sl@0: if (defMode!=EGray4 && defMode!=EColor256 && defMode != EColor64K) sl@0: INFO_PRINTF4(_L("TheClient->iWs.GetDefModeMaxNumColors(color,gray) return value return value - Expected: %d or %d, Actual: %d"), EGray4, EColor256, defMode); sl@0: } sl@0: else sl@0: { sl@0: if (color==0 && gray==16) sl@0: { sl@0: TEST(defMode==EGray4); //S5 family sl@0: if (defMode!=EGray4) sl@0: INFO_PRINTF3(_L("TheClient->iScreen->DisplayMode() return value return value - Expected: %d , Actual: %d"), EGray4, defMode); sl@0: } sl@0: else sl@0: { sl@0: TLogMessageText buf; sl@0: _LIT(KColorSettings,"##Data Most Colors=%d, Most Greys=%d, DefMode=%d"); sl@0: buf.Format(KColorSettings,color,gray,defMode); sl@0: TheClient->iWs.LogMessage(buf); sl@0: TheClient->iWs.Flush(); sl@0: TEST(defMode==EGray4 || defMode==EColor256); sl@0: if (defMode!=EGray4 && defMode!=EColor256) sl@0: INFO_PRINTF4(_L("TheClient->iWs.GetDefModeMaxNumColors(color,gray) return value return value - Expected: %d or %d, Actual: %d"), EGray4, EColor256, defMode); sl@0: } sl@0: } sl@0: CArrayFixFlat *colorModes=new(ELeave) CArrayFixFlat(1); sl@0: CleanupStack::PushL(colorModes); sl@0: User::LeaveIfError(TheClient->iWs.GetColorModeList(screenNo,colorModes)); sl@0: TDisplayMode mostColor=ENone; sl@0: TDisplayMode lastGray=ENone; sl@0: TDisplayMode dispMode; sl@0: TInt ii; sl@0: TInt colorModes16M = 0; sl@0: INFO_PRINTF1(_L(" Done Setup 2")); sl@0: for (ii=0;iiCount();ii++) sl@0: { sl@0: dispMode=(TDisplayMode)(*colorModes)[ii]; sl@0: TEST(dispMode!=ERgb); sl@0: if (dispMode==ERgb) sl@0: INFO_PRINTF3(_L("(TDisplayMode)(*colorModes)[i] return value - Not Expected: %d , Actual: %d"), ERgb, dispMode); sl@0: TEST(dispMode!=ENone); sl@0: if (dispMode==ENone) sl@0: INFO_PRINTF3(_L("(TDisplayMode)(*colorModes)[i] return value - Not Expected: %d , Actual: %d"), ENone, dispMode); sl@0: if (dispMode<=EGray256) sl@0: lastGray=dispMode; sl@0: else sl@0: mostColor=dispMode; sl@0: if(dispMode == EColor16M || dispMode == EColor16MU || dispMode == EColor16MA) sl@0: colorModes16M++; sl@0: } sl@0: TEST(mostColor!=ERgb); sl@0: if (mostColor==ERgb) sl@0: INFO_PRINTF3(_L("mostColor - Not Expected: %d , Actual: %d"), ERgb, mostColor); sl@0: TEST(colorModes16M <= 1); sl@0: if (colorModes16M > 1) sl@0: INFO_PRINTF3(_L("Number of times color Modes 16M - less than or equal to: %d , Actual: %d"), 1, colorModes16M); sl@0: #if defined(__WINS__) sl@0: TEST(colorModes16M == 1); sl@0: if (colorModes16M != 1) sl@0: INFO_PRINTF3(_L("Number of times color Modes 16M on wins - equal to: %d , Actual: %d"), 1, colorModes16M); sl@0: #endif sl@0: TInt retVal; sl@0: if (color==0) sl@0: { sl@0: TEST(mostColor==ENone); sl@0: if (mostColor!=ENone) sl@0: INFO_PRINTF3(_L("Most color - equal to: %d , Actual: %d"), ENone ,mostColor); sl@0: } sl@0: else sl@0: { sl@0: retVal = TDisplayModeUtils::NumDisplayModeColors(mostColor); sl@0: TEST(color==retVal); sl@0: if (color!=retVal) sl@0: INFO_PRINTF3(_L("TDisplayModeUtils::NumDisplayModeColors(mostColor) return value - equal to: %d , Actual: %d"), TDisplayModeUtils::NumDisplayModeColors(mostColor), retVal); sl@0: } sl@0: if (gray==0) sl@0: { sl@0: TEST(lastGray==ENone); sl@0: if (lastGray!=ENone) sl@0: INFO_PRINTF3(_L("LastGray - equal to: %d , Actual: %d"), ENone, lastGray); sl@0: } sl@0: else sl@0: { sl@0: retVal = TDisplayModeUtils::NumDisplayModeColors(lastGray); sl@0: TEST(gray==retVal); sl@0: if(gray!=retVal) sl@0: INFO_PRINTF3(_L("Gray - equal to: %d , Actual: %d"), retVal, gray); sl@0: } sl@0: retVal = TDisplayModeUtils::NumDisplayModeColors(ENone); sl@0: TEST(retVal==0); sl@0: if (retVal!=0) sl@0: INFO_PRINTF3(_L("TDisplayModeUtils::NumDisplayModeColors(ENone) return value - equal to: %d , Actual: %d"), 0, retVal); sl@0: CleanupStack::PopAndDestroy(2); //window and mode-array sl@0: } sl@0: sl@0: void CTWindowTest::TestInvalidFunctions2L() sl@0: // sl@0: // This code casts windows to group windows and vice-versa and then sends messages for the 'cast' that sl@0: // should not be sent to the original type of window. These should all result in panics sl@0: // sl@0: { sl@0: for (TInt winType=1;winType<7;++winType) //Skip type 0 (RWindowTreeNode) sl@0: for (TInt panic=0;;panic++) sl@0: { sl@0: TBool testFinished=EFalse; sl@0: TEST(iTest->TestWsPanicL(DoPanicTest3,EWservPanicOpcode,EWinTypeFactor*winType+panic,(TAny*)iTest->iScreenNumber,&testFinished)); sl@0: if (testFinished) sl@0: break; sl@0: } sl@0: iTest->CloseAllPanicWindows(); sl@0: } sl@0: sl@0: void CTWindowTest::TestDeletedParentPanics1L() sl@0: { sl@0: for (TInt winType=0;winType<7;++winType) sl@0: { sl@0: if (winType==1) //Skip type 1 (RWindowGroup) sl@0: ++winType; sl@0: for (TInt panic=0;;panic++) sl@0: { sl@0: TBool testFinished=EFalse; sl@0: TEST(iTest->TestWsPanicL(DoPanicTest4,EWservPanicParentDeleted,EWinTypeFactor*winType+panic,(TAny*)iTest->iScreenNumber,&testFinished)); sl@0: if (testFinished) sl@0: break; sl@0: } sl@0: } sl@0: iTest->CloseAllPanicWindows(); sl@0: } sl@0: sl@0: void CTWindowTest::TestDeletedParentPanics2L() sl@0: { sl@0: for (TInt panic=0;;panic++) sl@0: { sl@0: TBool testFinished=EFalse; sl@0: TEST(iTest->TestWsPanicL(DoPanicTest5,EWservPanicParentDeleted,panic,(TAny*)iTest->iScreenNumber,&testFinished)); sl@0: if (testFinished) sl@0: break; sl@0: } sl@0: iTest->CloseAllPanicWindows(); sl@0: } sl@0: sl@0: void CTWindowTest::Bug1L() sl@0: // sl@0: // Test a defect found with WSERV 099 that caused a full Eikon ROM to crash before even the splach screen appeared sl@0: // sl@0: { sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: // use correct screen sl@0: CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws); sl@0: CleanupStack::PushL(screen); sl@0: User::LeaveIfError(screen->Construct(iTest->iScreenNumber)); sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(344); sl@0: group.EnableReceiptOfFocus(EFalse); //Not done by Eikon, but needed to stop shell window comming to front. sl@0: RBlankWindow blank(ws); sl@0: blank.Construct(group,345); sl@0: blank.SetOrdinalPosition(0,1000); sl@0: blank.Activate(); sl@0: RWindow window(ws); sl@0: window.Construct(group,346); sl@0: sl@0: //Must delete this window to tidy up sl@0: window.Close(); sl@0: blank.Close(); sl@0: group.Close(); sl@0: sl@0: CleanupStack::PopAndDestroy(screen); sl@0: ws.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::TestWindowDelete() sl@0: { sl@0: TInt handles = 344; sl@0: TInt err = KErrNone; sl@0: TInt loop = 0; sl@0: TInt allocFailRate = 0; sl@0: sl@0: RWindowGroup group(TheClient->iWs); sl@0: RWindow parent1(TheClient->iWs); sl@0: RWindow child1(TheClient->iWs); sl@0: RWindow testWindow(TheClient->iWs); sl@0: sl@0: while (loop < 5) sl@0: { sl@0: err = group.Construct(++handles, EFalse); sl@0: if (err == KErrNone) sl@0: { sl@0: TheClient->iWs.HeapSetFail(RHeap::EDeterministic, allocFailRate); sl@0: sl@0: //Create parent 1 sl@0: err = parent1.Construct(group,++handles); sl@0: if (err == KErrNone) sl@0: { sl@0: parent1.SetExtent(TPoint(10,10),TSize(50,50)); sl@0: parent1.Activate(); sl@0: } sl@0: } sl@0: //Create child 1 sl@0: if (err == KErrNone) sl@0: { sl@0: err = child1.Construct(parent1,++handles); sl@0: if (err == KErrNone) sl@0: { sl@0: child1.SetExtent(TPoint(),TSize(50,20)); sl@0: child1.Activate(); sl@0: } sl@0: //Only delete the parent 1, but not the child 1 sl@0: parent1.Close(); sl@0: } sl@0: sl@0: if (err == KErrNone) sl@0: { sl@0: //Create testWindow sl@0: err = testWindow.Construct(group,++handles); sl@0: if (err == KErrNone) sl@0: { sl@0: testWindow.SetExtent(TPoint(0,20),TSize(50,30)); sl@0: testWindow.Activate(); sl@0: } sl@0: } sl@0: TheClient->iWs.HeapSetFail(RAllocator::ENone, 0); sl@0: sl@0: child1.Close(); sl@0: testWindow.Close(); sl@0: group.Close(); sl@0: ++allocFailRate; sl@0: loop = (err == KErrNone) ? loop + 1 : 0; sl@0: } sl@0: } sl@0: void CTWindowTest::Bug2L() sl@0: // sl@0: // Test a defect ... sl@0: // sl@0: { sl@0: TSize offset(20,20); sl@0: TRect screen(TheClient->iScreen->SizeInPixels()-offset); sl@0: TRgb color; sl@0: RWsSession ws1; sl@0: User::LeaveIfError(ws1.Connect()); sl@0: ws1.SetAutoFlush(ETrue); sl@0: sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* scr1 = new (ELeave) CWsScreenDevice(ws1); sl@0: CleanupStack::PushL(scr1); sl@0: User::LeaveIfError(scr1->Construct(iTest->iScreenNumber)); sl@0: sl@0: RWsSession ws2; sl@0: User::LeaveIfError(ws2.Connect()); sl@0: ws2.SetAutoFlush(ETrue); sl@0: sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* scr2 = new (ELeave) CWsScreenDevice(ws2); sl@0: CleanupStack::PushL(scr2); sl@0: User::LeaveIfError(scr2->Construct(iTest->iScreenNumber)); sl@0: sl@0: RWindowGroup group1a(ws1); sl@0: group1a.Construct(344); sl@0: group1a.EnableReceiptOfFocus(EFalse); sl@0: group1a.SetOrdinalPosition(0,5); sl@0: RBlankWindow blank1a(ws1); sl@0: blank1a.Construct(group1a,345); sl@0: color=TRgb::Gray4(0); sl@0: blank1a.SetColor(color); sl@0: blank1a.SetExtent(screen.iTl,screen.Size()); sl@0: blank1a.EnableBackup(); sl@0: blank1a.Activate(); sl@0: sl@0: RWindowGroup group2(ws2); sl@0: group2.Construct(342); sl@0: group2.EnableReceiptOfFocus(EFalse); sl@0: group2.SetOrdinalPosition(0,5); sl@0: RBlankWindow blank2(ws2); sl@0: blank2.Construct(group2,347); sl@0: color=TRgb::Gray4(1); sl@0: blank2.SetColor(color); sl@0: blank2.SetExtent(screen.iTl+TSize(20,0),screen.Size()); sl@0: blank2.EnableBackup(); sl@0: blank2.Activate(); sl@0: sl@0: RWindowGroup group1b(ws1); sl@0: group1b.Construct(343); sl@0: //group1b.EnableReceiptOfFocus(EFalse); sl@0: group1b.SetOrdinalPosition(0,5); sl@0: RBlankWindow blank1b(ws1); sl@0: blank1b.Construct(group1b,346); sl@0: color=TRgb::Gray4(2); sl@0: blank1b.SetColor(color); sl@0: blank1b.SetExtent(screen.iTl+offset,screen.Size()); sl@0: blank1b.EnableBackup(); sl@0: blank1b.Activate(); sl@0: sl@0: group1b.Close(); sl@0: blank1a.Close(); sl@0: blank1b.Close(); sl@0: blank2.Close(); sl@0: group1a.Close(); sl@0: group2.Close(); sl@0: sl@0: CleanupStack::PopAndDestroy(2,scr1); sl@0: ws1.Close(); sl@0: ws2.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::Bug3L() sl@0: // sl@0: // Actiate then make visible and backup behind window caused panic. sl@0: // sl@0: { sl@0: TSize offset(20,20); sl@0: TRect screen(TheClient->iScreen->SizeInPixels()-offset); sl@0: TRgb color; sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: ws.SetAutoFlush(ETrue); sl@0: sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* scr = new (ELeave) CWsScreenDevice(ws); sl@0: CleanupStack::PushL(scr); sl@0: User::LeaveIfError(scr->Construct(iTest->iScreenNumber)); sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(348); sl@0: group.EnableReceiptOfFocus(EFalse); sl@0: RBlankWindow blank1(ws); sl@0: blank1.Construct(group,341); sl@0: color=TRgb::Gray4(1); sl@0: blank1.SetColor(color); sl@0: blank1.SetExtent(screen.iTl,screen.Size()); sl@0: blank1.EnableBackup(); sl@0: blank1.SetVisible(EFalse); sl@0: blank1.Activate(); sl@0: blank1.SetVisible(ETrue); sl@0: RBlankWindow blank2(ws); sl@0: blank2.Construct(group,342); sl@0: color=TRgb::Gray4(2); sl@0: blank2.SetColor(color); sl@0: blank2.SetExtent(screen.iTl,screen.Size()); sl@0: blank2.EnableBackup(); sl@0: blank2.SetVisible(EFalse); sl@0: blank2.SetVisible(ETrue); sl@0: blank2.Activate(); sl@0: group.Close(); sl@0: blank1.Close(); sl@0: blank2.Close(); sl@0: sl@0: CleanupStack::PopAndDestroy(scr); sl@0: ws.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::ErrorCodesL() sl@0: { sl@0: RWsSession ws; sl@0: User::LeaveIfError(ws.Connect()); sl@0: // use correct screen sl@0: // sl@0: CWsScreenDevice* scr = new (ELeave) CWsScreenDevice(ws); sl@0: CleanupStack::PushL(scr); sl@0: User::LeaveIfError(scr->Construct(iTest->iScreenNumber)); sl@0: sl@0: sl@0: RWindowGroup group(ws); sl@0: group.Construct(349); sl@0: group.EnableReceiptOfFocus(EFalse); sl@0: RWindow window(TheClient->iWs); sl@0: User::LeaveIfError(window.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle)); sl@0: TInt retVal = window.MoveToGroup(22222); sl@0: TEST(retVal==KErrNotFound); sl@0: if (retVal!=KErrNotFound) sl@0: INFO_PRINTF3(_L("window.MoveToGroup(22222) return value - equal to: %d , Actual: %d"), KErrNotFound, retVal); sl@0: retVal = window.MoveToGroup(group.Identifier()); sl@0: TEST(retVal==KErrNotFound); sl@0: if (retVal!=KErrNotFound) sl@0: INFO_PRINTF3(_L("window.MoveToGroup(group.Identifier()) return value - equal to: %d , Actual: %d"), KErrNotFound, retVal); sl@0: window.Close(); sl@0: group.Close(); sl@0: sl@0: CleanupStack::PopAndDestroy(scr); sl@0: ws.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::BackColorBugL() sl@0: // sl@0: // Test a defect with window being drawn with the wrong background color when they are moved on the screen sl@0: // sl@0: { sl@0: TSize scrSize(TheClient->iScreen->SizeInPixels()); sl@0: TSize checkSize(12,10); //X-Size needs to be multiple of 4 due to BITGDI change/defect sl@0: CBlankWindow* win; sl@0: win=new(ELeave) CBlankWindow(TRgb(16,16,240)); sl@0: CleanupStack::PushL(win); sl@0: win->SetUpL(TPoint(5,5),scrSize-TSize(10,10),TheClient->iGroup,*TheClient->iGc); sl@0: TInt mode=win->BaseWin()->SetRequiredDisplayMode(EColor256); sl@0: const TDisplayMode actualMode=reinterpret_cast(mode); sl@0: if (!TDisplayModeUtils::IsDisplayModeColor(actualMode) || TDisplayModeUtils::NumDisplayModeColors(actualMode)<256) sl@0: { sl@0: CleanupStack::PopAndDestroy(win); sl@0: return; sl@0: } sl@0: win->RealDraw(ETrue); sl@0: win->Win()->SetBackgroundColor(TRgb(64,224,64)); sl@0: CBlankWindow* win3; sl@0: win3=new(ELeave) CBlankWindow(TRgb::Gray16(8)); sl@0: CleanupStack::PushL(win3); sl@0: win3->SetUpL(TPoint(12,12),checkSize,TheClient->iGroup,*TheClient->iGc); sl@0: win3->BaseWin()->SetRequiredDisplayMode(EColor256); sl@0: CBlankWindow* win2; sl@0: win2=new(ELeave) CBlankWindow(TRgb(240,16,16)); sl@0: CleanupStack::PushL(win2); sl@0: win2->SetUpL(TPoint(10,scrSize.iHeight/2),TSize(scrSize.iWidth/3,scrSize.iHeight/2-10),TheClient->iGroup,*TheClient->iGc); sl@0: win2->BaseWin()->SetRequiredDisplayMode(EColor256); sl@0: win2->RealDraw(EFalse); sl@0: sl@0: win2->Win()->SetBackgroundColor(TRgb::Gray16(8)); sl@0: win2->SetExt(TPoint(scrSize.iWidth/4,30),TSize(scrSize.iWidth/2,2*scrSize.iHeight/3)); sl@0: TheClient->iWs.Finish(); sl@0: TheClient->WaitForRedrawsToFinish(); sl@0: if (!CheckRect(win2,win3,TRect(checkSize))) sl@0: { sl@0: _LIT(KLog,"After window is moved and resizes it doesn't matches the other window"); sl@0: LOG_MESSAGE(KLog); sl@0: //Code to save a screen shot useful if this test fails sl@0: /*_LIT(KTest,"E:\\logs\\testexecute\\Window%d"); sl@0: TBuf<64> buf; sl@0: buf.Format(KTest,iTest->iState); sl@0: TInt err=iTest->SaveScreen(buf); sl@0: _LIT(KLogSave,"Saved screenshot to file %S, (err=%d)"); sl@0: LOG_MESSAGE3(KLogSave,&buf,err);*/ sl@0: } sl@0: TheClient->WaitForRedrawsToFinish(); sl@0: CleanupStack::PopAndDestroy(3,win); sl@0: } sl@0: sl@0: void CTWindowTest::FocusChangedL() sl@0: // sl@0: // Test that the focus change is available when the redraw is sl@0: // it should be available before, but it isn't always possible to test that sl@0: // sl@0: { sl@0: _LIT(KThreadName,"MoveGroup"); sl@0: _LIT(KEventWaiting,"Event Waiting when none expected."); sl@0: TInt command; sl@0: iThreadParam.iScreenNumber=iTest->iScreenNumber; sl@0: iFirstFunction=TThreadStartUp(CTWindowTest::MoveGroup,&iThreadParam); sl@0: TRequestStatus status; sl@0: TSize scrSize(TheClient->iScreen->SizeInPixels()); sl@0: CTWindowGroup* group1=new(ELeave) CTWindowGroup(TheClient); sl@0: group1->ConstructL(); sl@0: CleanupStack::PushL(group1); sl@0: TInt winId1=group1->GroupWin()->Identifier(); sl@0: CBlankWindow* win1=new(ELeave) CBlankWindow(TRgb::Gray4(1)); sl@0: CleanupStack::PushL(win1); sl@0: win1->SetUpL(TPoint(1,1),TSize(2*scrSize.iWidth/3,2*scrSize.iHeight/3),group1,*TheClient->iGc); sl@0: win1->RealDraw(ETrue); sl@0: win1->Win()->SetBackgroundColor(TRgb::Gray4(3)); sl@0: CTWindowGroup* group2=new(ELeave) CTWindowGroup(TheClient); sl@0: group2->ConstructL(); sl@0: CleanupStack::PushL(group2); sl@0: TInt winId2=group2->GroupWin()->Identifier(); sl@0: CBlankWindow* win2=new(ELeave) CBlankWindow(TRgb::Gray4(2)); sl@0: CleanupStack::PushL(win2); sl@0: win2->SetUpL(TPoint(scrSize.iWidth/3-5,scrSize.iHeight/3-5),TSize(2*scrSize.iWidth/3,2*scrSize.iHeight/3),group2,*TheClient->iGc); sl@0: win2->RealDraw(ETrue); sl@0: win2->Win()->SetBackgroundColor(TRgb::Gray4(0)); sl@0: sl@0: TheClient->WaitForRedrawsToFinish(); sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: command=winId1; sl@0: iThreadParam.iCommand=command; sl@0: TBool noEventWaiting=!TheClient->IsEventWaiting(); sl@0: TEST(noEventWaiting); sl@0: if (!noEventWaiting) sl@0: LOG_MESSAGE(KEventWaiting); sl@0: _LIT(KTest1,"FocusChangedL: 1st test completed"); sl@0: LOG_MESSAGE(KTest1); sl@0: CProcess* iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status); sl@0: User::WaitForRequest(status); sl@0: delete iMoveGroup; sl@0: TEST(TheClient->WaitForEvent()); sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: sl@0: command=winId2; sl@0: iThreadParam.iCommand=command; sl@0: TheClient->WaitForRedrawsToFinish(); sl@0: noEventWaiting=!TheClient->IsEventWaiting(); sl@0: TEST(noEventWaiting); sl@0: if (!noEventWaiting) sl@0: LOG_MESSAGE(KEventWaiting); sl@0: _LIT(KTest2,"FocusChangedL: 2nd test completed"); sl@0: LOG_MESSAGE(KTest2); sl@0: iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status); sl@0: User::WaitForRequest(status); sl@0: delete iMoveGroup; sl@0: TEST(TheClient->WaitForEvent()); sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: sl@0: command=winId2|(1<WaitForRedrawsToFinish(); sl@0: noEventWaiting=!TheClient->IsEventWaiting(); sl@0: TEST(noEventWaiting); sl@0: if (!noEventWaiting) sl@0: LOG_MESSAGE(KEventWaiting); sl@0: _LIT(KTest3,"FocusChangedL: 3rd test completed"); sl@0: LOG_MESSAGE(KTest3); sl@0: iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status); sl@0: User::WaitForRequest(status); sl@0: delete iMoveGroup; sl@0: TEST(TheClient->WaitForEvent()); sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: sl@0: command=winId1|(1<WaitForRedrawsToFinish(); sl@0: noEventWaiting=!TheClient->IsEventWaiting(); sl@0: TEST(noEventWaiting); sl@0: if (!noEventWaiting) sl@0: LOG_MESSAGE(KEventWaiting); sl@0: _LIT(KTest4,"FocusChangedL: 4th test completed"); sl@0: LOG_MESSAGE(KTest4); sl@0: iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status); sl@0: User::WaitForRequest(status); sl@0: delete iMoveGroup; sl@0: TEST(TheClient->WaitForEvent()); sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: sl@0: TheClient->WaitForRedrawsToFinish(); sl@0: noEventWaiting=!TheClient->IsEventWaiting(); sl@0: TEST(noEventWaiting); sl@0: if (!noEventWaiting) sl@0: LOG_MESSAGE(KEventWaiting); sl@0: _LIT(KTest5,"FocusChangedL: 5th and last test completed"); sl@0: LOG_MESSAGE(KTest5); sl@0: CleanupStack::PopAndDestroy(2,group2); sl@0: TheClient->Flush(); sl@0: TEST(TheClient->WaitForEvent()); sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: CleanupStack::PopAndDestroy(2,group1); sl@0: } sl@0: sl@0: #define ALT_PRI 78 sl@0: void CTWindowTest::EventsToAllL() sl@0: { sl@0: CTClient* client1=new(ELeave) CTClient; sl@0: CleanupStack::PushL(client1); sl@0: client1->SetScreenNumber(iTest->iScreenNumber); sl@0: client1->ConstructL(); sl@0: CTClient* client2=new(ELeave) CTClient; sl@0: CleanupStack::PushL(client2); sl@0: client2->SetScreenNumber(iTest->iScreenNumber); sl@0: client2->ConstructL(); sl@0: CEvWindowGroup* group1a=CEvWindowGroup::NewLC(client1,this); sl@0: CEvWindowGroup* group1b=CEvWindowGroup::NewLC(client1,this); sl@0: CEvWindowGroup* group2a=CEvWindowGroup::NewLC(client2,this); sl@0: CEvWindowGroup* group2b=CEvWindowGroup::NewLC(client2,this); sl@0: /*_LIT(KLog,"Window Group Id's: %d,%d,%d,%d"); sl@0: LOG_MESSAGE5(KLog,group1a->GroupWin()->Identifier(),group1b->GroupWin()->Identifier(),group2a->GroupWin()->Identifier(),group2b->GroupWin()->Identifier());*/ sl@0: group1a->SendEvent(KBaseUserEvent+1); sl@0: group2b->SendEvent(KBaseUserEvent+2); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: TWsEvent event; sl@0: // Assigned random value because before PREQ1226, TWsevent's data wasn't zero initialised. sl@0: // In techview, following function sl@0: // void CEikServAppUi::HandleSystemEventL(const TWsEvent& aEvent) sl@0: // was relaying on TWsevent's data not be zero sl@0: *(event.Int()) = 0XCCCCCCCC; sl@0: event.SetType(KBaseUserEvent+3); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+3); sl@0: group1b->SetExpectedEvent(KBaseUserEvent+3); sl@0: group2a->SetExpectedEvent(KBaseUserEvent+3); sl@0: group2b->SetExpectedEvent(KBaseUserEvent+3); sl@0: TheClient->iWs.SendEventToAllWindowGroups(event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent+4); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+4); sl@0: group1b->SetExpectedEvent(KBaseUserEvent+4); sl@0: group2a->SetExpectedEvent(KBaseUserEvent+4); sl@0: group2b->SetExpectedEvent(KBaseUserEvent+4); sl@0: TheClient->iWs.SendEventToAllWindowGroups(event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent+5); sl@0: //group1a->SetExpectedEvent(KBaseUserEvent+5); sl@0: group1b->SetExpectedEvent(KBaseUserEvent+5); sl@0: //group2a->SetExpectedEvent(KBaseUserEvent+5); sl@0: group2b->SetExpectedEvent(KBaseUserEvent+5); sl@0: TheClient->iWs.SendEventToOneWindowGroupsPerClient(event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: group1a->WinTreeNode()->SetOrdinalPosition(0); sl@0: client1->Flush(); sl@0: event.SetType(KBaseUserEvent+6); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+6); sl@0: group2b->SetExpectedEvent(KBaseUserEvent+6); sl@0: TheClient->iWs.SendEventToOneWindowGroupsPerClient(event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: group2b->WinTreeNode()->SetOrdinalPosition(6); sl@0: client2->Flush(); sl@0: event.SetType(KBaseUserEvent+7); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+7); sl@0: group2a->SetExpectedEvent(KBaseUserEvent+7); sl@0: TheClient->iWs.SendEventToOneWindowGroupsPerClient(event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent+8); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+8); sl@0: group1b->SetExpectedEvent(KBaseUserEvent+8); sl@0: group2a->SetExpectedEvent(KBaseUserEvent+8); sl@0: group2b->SetExpectedEvent(KBaseUserEvent+8); sl@0: TheClient->iWs.SendEventToAllWindowGroups(0,event); sl@0: group1a->WinTreeNode()->SetOrdinalPosition(0,ALT_PRI); sl@0: client1->Flush(); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent+9); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+9); sl@0: TheClient->iWs.SendEventToAllWindowGroups(ALT_PRI,event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: group2b->WinTreeNode()->SetOrdinalPosition(0,ALT_PRI); sl@0: client2->Flush(); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent+10); sl@0: group1a->SetExpectedEvent(KBaseUserEvent+10); sl@0: group2b->SetExpectedEvent(KBaseUserEvent+10); sl@0: TheClient->iWs.SendEventToAllWindowGroups(ALT_PRI,event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent+11); sl@0: group1b->SetExpectedEvent(KBaseUserEvent+11); sl@0: group2a->SetExpectedEvent(KBaseUserEvent+11); sl@0: TheClient->iWs.SendEventToAllWindowGroups(0,event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: event.SetType(KBaseUserEvent); sl@0: group1a->SetExpectedEvent(KBaseUserEvent); sl@0: group1b->SetExpectedEvent(KBaseUserEvent); sl@0: group2a->SetExpectedEvent(KBaseUserEvent); sl@0: group2b->SetExpectedEvent(KBaseUserEvent); sl@0: TheClient->iWs.SendEventToAllWindowGroups(event); sl@0: client1->WaitForAllEventProcessingToFinish(); sl@0: client2->WaitForAllEventProcessingToFinish(); sl@0: CleanupStack::PopAndDestroy(6,client1); sl@0: } sl@0: sl@0: void DestroyWindow(TAny* aWindow) sl@0: { sl@0: static_cast(aWindow)->Destroy(); sl@0: } sl@0: sl@0: void CTWindowTest::GroupIdL() sl@0: { sl@0: const TInt numWindows=10; sl@0: RWindowGroup group(TheClient->iWs); sl@0: CleanupClosePushL(group); sl@0: User::LeaveIfError(group.Construct(ENullWsHandle)); sl@0: TInt id=group.Identifier(); sl@0: RWindowTreeNode* prevWindow=&group; sl@0: TInt ii; sl@0: for (ii=0;iiiWs); sl@0: CleanupStack::PushL(TCleanupItem(&DestroyWindow,window)); sl@0: User::LeaveIfError(window->Construct(*prevWindow,ENullWsHandle)); sl@0: TInt retVal = window->WindowGroupId(); sl@0: TEST(retVal==id); sl@0: if (retVal!=id) sl@0: INFO_PRINTF3(_L("window->WindowGroupId() return value - equal to: %d , Actual: %d"), id, retVal); sl@0: prevWindow=window; sl@0: } sl@0: CleanupStack::PopAndDestroy(numWindows+1); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0495 sl@0: sl@0: @SYMDEF PDEF131541 sl@0: sl@0: @SYMTestCaseDesc Sending Events using one of the functions SendEventToWindowGroup, SendEventToAllWindowGroups (x2) sl@0: and SendEventToOneWindowGroupsPerClient when an event queue is full returns an error sl@0: sl@0: @SYMTestPriority Low sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Call the functions repeatly many times and check that an error gets returned eventually sl@0: sl@0: @SYMTestExpectedResults Functions return the error KErrNoMemory sl@0: */ sl@0: const TInt numTest=75; //Must be at least 33 sl@0: void CTWindowTest::SaturateSendEvent() sl@0: { sl@0: const TInt id=TheClient->iGroup->GroupWin()->Identifier(); sl@0: TWsEvent event; sl@0: event.SetType(KBaseUserEvent); sl@0: TInt ii; sl@0: sl@0: TInt err=KErrNone; sl@0: for (ii=0; ii<=numTest && err==KErrNone;) sl@0: { sl@0: ++ii; sl@0: err=TheClient->iWs.SendEventToWindowGroup(id,event); sl@0: } sl@0: TEST(err==KErrNoMemory); sl@0: if (err!=KErrNoMemory) sl@0: { sl@0: _LIT(KLog,"After %d/%d iterations SendEventToWindowGroup returned the error %d"); sl@0: LOG_MESSAGE4(KLog,ii,numTest,err); sl@0: } sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: sl@0: err=KErrNone; sl@0: for (ii=0; ii<=numTest && err==KErrNone;) sl@0: { sl@0: ++ii; sl@0: err=TheClient->iWs.SendEventToAllWindowGroups(event); sl@0: } sl@0: TEST(err==KErrNoMemory); sl@0: if (err!=KErrNoMemory) sl@0: { sl@0: _LIT(KLog,"After %d/%d iterations SendEventToAllWindowGroups returned the error %d"); sl@0: LOG_MESSAGE4(KLog,ii,numTest,err); sl@0: } sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: User::After(1000000); //1sec, give other sessions a chance to respond to the events sl@0: sl@0: err=KErrNone; sl@0: for (ii=0; ii<=numTest && err==KErrNone;) sl@0: { sl@0: ++ii; sl@0: err=TheClient->iWs.SendEventToAllWindowGroups(0,event); sl@0: } sl@0: TEST(err==KErrNoMemory); sl@0: if (err!=KErrNoMemory) sl@0: { sl@0: _LIT(KLog,"After %d/%d iterations SendEventToAllWindowGroups_Priority0 returned the error %d"); sl@0: LOG_MESSAGE4(KLog,ii,numTest,err); sl@0: } sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: User::After(1000000); //1sec, give other sessions a chance to respond to the events sl@0: sl@0: err=KErrNone; sl@0: for (ii=0; ii<=numTest && err==KErrNone;) sl@0: { sl@0: ++ii; sl@0: err=TheClient->iWs.SendEventToOneWindowGroupsPerClient(event); sl@0: } sl@0: TEST(err==KErrNoMemory); sl@0: if (err!=KErrNoMemory) sl@0: { sl@0: _LIT(KLog,"After %d/%d iterations SendEventToOneWindowGroupsPerClient returned the error %d"); sl@0: LOG_MESSAGE4(KLog,ii,numTest,err); sl@0: } sl@0: TheClient->WaitForAllEventProcessingToFinish(); sl@0: User::After(1000000); //1sec, give other sessions a chance to respond to the events sl@0: } sl@0: sl@0: void CTWindowTest::TestNotSupportedFunctionality() sl@0: { sl@0: TInt err = KErrNone; sl@0: TSize windowSize = TSize(10,10); sl@0: TSize testSize = TSize(); sl@0: sl@0: RWindowGroup group(TheClient->iWs); sl@0: RWindow window(TheClient->iWs); sl@0: sl@0: err = group.Construct((TUint32)&group, EFalse); sl@0: TEST(err==KErrNone); sl@0: err = window.Construct(group,(TUint32)&window); sl@0: TEST(err==KErrNone); sl@0: sl@0: window.SetExtent(TPoint(0,0),windowSize); sl@0: window.Activate(); sl@0: sl@0: testSize = window.Size(); sl@0: TEST((testSize.iWidth==windowSize.iWidth) && (testSize.iHeight==windowSize.iHeight)); sl@0: sl@0: testSize = window.Size(); sl@0: TEST((testSize.iWidth==windowSize.iWidth) && (testSize.iHeight==windowSize.iHeight)); sl@0: sl@0: window.Close(); sl@0: group.Close(); sl@0: } sl@0: sl@0: void CTWindowTest::RunTestCaseL(TInt /*aCurTestCase*/) sl@0: { sl@0: _LIT(KTest1,"Window"); sl@0: _LIT(KTest2,"DestroyWindowWithActiveGc"); sl@0: _LIT(KTest3,"Shadow/NoAutoClear"); sl@0: _LIT(KTest4,"Corner Tests"); sl@0: _LIT(KTest5,"Invalid Window Functions"); sl@0: _LIT(KTest7,"Mega-Tree"); sl@0: _LIT(KTest8,"Tiled Window One"); sl@0: _LIT(KTest9,"Tiled Window Two"); sl@0: _LIT(KTest10,"Color Test"); sl@0: _LIT(KTest11,"Invalid Window Functions2"); sl@0: _LIT(KTest12,"Defect 1"); sl@0: _LIT(KTest13,"Defect 2"); sl@0: _LIT(KTest14,"Parent Deleted 1"); sl@0: _LIT(KTest15,"Parent Deleted 2"); sl@0: _LIT(KTest16,"Defect 3"); sl@0: _LIT(KTest17,"Background Color"); sl@0: _LIT(KTest18,"Focus Changed"); sl@0: _LIT(KTest21,"Events To All"); sl@0: _LIT(KTest22,"Error Codes"); sl@0: _LIT(KTest23,"Group Id"); sl@0: _LIT(KTest24,"DeleteParentWindowOnly"); sl@0: #if defined(_DEBUG) sl@0: _LIT(KTest25,"DuplicateWindowHandles"); sl@0: #else sl@0: _LIT(KTest25skipped,"DuplicateWindowHandles skipped"); sl@0: #endif sl@0: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName); sl@0: sl@0: _LIT(KTest26,"Saturate SendEvent"); sl@0: _LIT(KTest27,"Not Supported Functionality"); sl@0: sl@0: switch(++iTest->iState) sl@0: { sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0029 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test window can be created and destroyed correctly sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Creates and destroys a window sl@0: sl@0: @SYMTestExpectedResults Window is created and destroyed without error sl@0: */ sl@0: case 1: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0029")); sl@0: iTest->LogSubTest(KTest1); sl@0: CreateTestWindowL(); sl@0: CheckAndDestroyWindows(); sl@0: //iState=17; sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0030 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Creates and destroys window with an active gc sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Create and destroy a window with an active gc sl@0: sl@0: @SYMTestExpectedResults Window is created and destroyed without error sl@0: */ sl@0: case 2: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0030")); sl@0: iTest->LogSubTest(KTest2); sl@0: CreateTestWindowL(); sl@0: DestroyWindowWithActiveGc(); sl@0: CreateTestWindowL(); sl@0: DestroyWindowWithActiveGc2L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0031 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test that shadow is not automatically cleared when sl@0: drawing a window sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Draw windows and check that the shadow is not automatically sl@0: cleared sl@0: sl@0: @SYMTestExpectedResults Screen comparison returns that the shadow was not cleared sl@0: */ sl@0: case 3: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0031")); sl@0: //window shadowing is no longer supported. keep the test to make sure clients can still call the methods sl@0: iTest->LogSubTest(KTest3); sl@0: ShadowAutoClearTest(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0032 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test the drawing of different types of corner of sl@0: a window sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Draw a window with different types of corner sl@0: sl@0: @SYMTestExpectedResults The window is drawn correctly for each corner type sl@0: */ sl@0: case 4: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0032")); sl@0: iTest->LogSubTest(KTest4); sl@0: CornerTests(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0033 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test for panics when window is sent wrong requests sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Send wrong requests to windows and deal with panic sl@0: sl@0: @SYMTestExpectedResults The windows panic as expected sl@0: */ sl@0: case 5: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0033")); sl@0: iTest->LogSubTest(KTest5); sl@0: TestInvalidFunctionsL(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0035 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Draw 100 windows from a thread sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Draw 100 windows from the same thread sl@0: sl@0: @SYMTestExpectedResults The windows are all drawn without error sl@0: */ sl@0: case 6: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0035")); sl@0: iTest->LogSubTest(KTest7); sl@0: CreateMegaTree(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0036 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Check that windows can be drawn in a tiled format sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Draw two windows in a tiled format and check they sl@0: are identical sl@0: sl@0: @SYMTestExpectedResults The tiled windows are identical sl@0: */ sl@0: case 7: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0036")); sl@0: sl@0: iTest->LogSubTest(KTest8); sl@0: TiledWindowTestL(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0037 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Check that windows and dialogs can be drawn in a sl@0: tiled format sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Draw windows and dialogs in a tiled format sl@0: sl@0: @SYMTestExpectedResults The windows and dialogs are drawn correctly sl@0: */ sl@0: case 8: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0037")); sl@0: iTest->LogSubTest(KTest9); sl@0: TiledWindowTest2L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0038 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Check drawing into a window with different sl@0: colour set ups sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Draw in a window using different colour sl@0: configurations sl@0: sl@0: @SYMTestExpectedResults The different colours are drawn correctly sl@0: */ sl@0: case 9: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0038")); sl@0: iTest->LogSubTest(KTest10); sl@0: ColorTestL(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0039 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test for panics when window is sent wrong requests sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Send wrong requests to windows and deal with panic sl@0: sl@0: @SYMTestExpectedResults The windows panic as expected sl@0: */ sl@0: case 10: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0039")); sl@0: iTest->LogSubTest(KTest11); sl@0: TestInvalidFunctions2L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0040 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test for a defect that causes ROM to crash sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Test a defect is not present which causes the ROM sl@0: to crash sl@0: sl@0: @SYMTestExpectedResults The defect is not present sl@0: */ sl@0: case 11: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0040")); sl@0: iTest->LogSubTest(KTest12); sl@0: Bug1L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0041 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test a previous defect has not returned sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Exercise the code the defect was discovered in sl@0: sl@0: @SYMTestExpectedResults The defect is not present sl@0: */ sl@0: case 12: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0041")); sl@0: iTest->LogSubTest(KTest13); sl@0: Bug2L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0042 sl@0: sl@0: @SYMDEF DEF081259 sl@0: DEF115543 sl@0: sl@0: @SYMTestCaseDesc Test that when a parent window is deleted a panic sl@0: occurs sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Delete a parent window and check for a panic sl@0: NOTE: DEF115543 has corrected GRAPHICS-WSERV-0042, and added a lot sl@0: more window functions. sl@0: sl@0: @SYMTestExpectedResults All functions either: sl@0: Panic the owner thread with EWservPanicParentDeleted or sl@0: Get performed without accessing any NULL iParent pointers in the WSERV thread sl@0: */ sl@0: case 13: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0042")); sl@0: iTest->LogSubTest(KTest14); sl@0: TestDeletedParentPanics1L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0043 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test that when a parent window is deleted a panic sl@0: occurs sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Delete a parent window and check for a panic sl@0: sl@0: @SYMTestExpectedResults The panic occurs as expected sl@0: */ sl@0: case 14: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0043")); sl@0: iTest->LogSubTest(KTest15); sl@0: TestDeletedParentPanics2L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0044 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Check that activate then make visible and backup sl@0: behind a window does not panic. sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Activate then make visible and backup sl@0: behind a window sl@0: sl@0: @SYMTestExpectedResults No panic occurs sl@0: */ sl@0: case 15: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0044")); sl@0: iTest->LogSubTest(KTest16); sl@0: Bug3L(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0045 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test window being drawn with the correct background sl@0: color when they are moved on the screen sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Move window on the screen and check it is drawn with sl@0: the correct background colour sl@0: sl@0: @SYMTestExpectedResults The background coloour is correct sl@0: */ sl@0: case 16: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0045")); sl@0: iTest->LogSubTest(KTest17); sl@0: BackColorBugL(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0046 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test that the focus change is available after redraw sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Redraw and check the focus change is available sl@0: sl@0: @SYMTestExpectedResults The focus change is available sl@0: */ sl@0: case 17: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0046")); sl@0: iTest->LogSubTest(KTest18); sl@0: FocusChangedL(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0048 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test that events can be sent to a number of window sl@0: groups simultaneously sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Send events to a number of window groups and check sl@0: that they all receive them sl@0: sl@0: @SYMTestExpectedResults The events and sent to the window groups correctly sl@0: */ sl@0: case 18: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0048")); sl@0: iTest->LogSubTest(KTest21); sl@0: EventsToAllL(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0049 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Test error code when incorrectly moving a window to sl@0: a group. sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Try to move a window to a group and check the error sl@0: codes sl@0: sl@0: @SYMTestExpectedResults The correct error codes are returned sl@0: */ sl@0: case 19: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0049")); sl@0: iTest->LogSubTest(KTest22); sl@0: ErrorCodesL(); sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0050 sl@0: sl@0: @SYMDEF DEF081259 sl@0: sl@0: @SYMTestCaseDesc Check that the correct group id is assigned to a sl@0: chain of windows sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Create a chain of windows in the same group and check sl@0: the all have the same group id sl@0: sl@0: @SYMTestExpectedResults The windows all have the same group id sl@0: */ sl@0: case 20: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0050")); sl@0: iTest->LogSubTest(KTest23); sl@0: GroupIdL(); sl@0: break; sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0461 sl@0: sl@0: @SYMDEF PDEF114190 sl@0: sl@0: @SYMTestCaseDesc Test window redraw queue cleanup when window is deleted in low memory conditions sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Have a loop which increases the number of allocations in the server thread before failure; sl@0: Within the loop: sl@0: 1) Create a parent window and a child window of the parent; sl@0: 2) Delete the parent window only, but not the child window; sl@0: 3) Create a testWindow. This new window gets added to the redraw queue which will force it sl@0: reordering. This would crash WSERV due to this defect because the orphaned window (which is sl@0: the previous child window) is still in the redraw queue sl@0: 4) Delete all the windows involved; sl@0: sl@0: @SYMTestExpectedResults The window redraw queue should be cleaned up when the first window is deleted; sl@0: WSERV should not crash. The test should pass. sl@0: */ sl@0: case 21: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0461")); sl@0: iTest->LogSubTest(KTest24); sl@0: TestWindowDelete(); sl@0: break; sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0463 sl@0: sl@0: @SYMDEF DEF115601 sl@0: sl@0: @SYMTestCaseDesc Two RWindowGroup objects using same window client handle cause Emulator crash sl@0: sl@0: @SYMTestPriority Medium sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Create two window groups with the same handle. sl@0: sl@0: @SYMTestExpectedResults WSERV should panic the client thread with the code EWservPanicDuplicateHandle sl@0: and then destroy the window groups without crashing WSERV sl@0: */ sl@0: case 22: sl@0: #if defined(_DEBUG) sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0463")); sl@0: iTest->LogSubTest(KTest25); sl@0: TEST(iTest->TestWsPanicL(DoPanicTest6,EWservPanicDuplicateHandle,0,(TAny*)iTest->iScreenNumber,NULL)); sl@0: iTest->CloseAllPanicWindows(); sl@0: #else sl@0: iTest->LogSubTest(KTest25skipped); //Client side panic will only occur in debug builds of WServ sl@0: #endif sl@0: break; sl@0: case 23: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0495")); sl@0: iTest->LogSubTest(KTest26); sl@0: SaturateSendEvent(); sl@0: break; sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-WSERV-0655 sl@0: sl@0: @SYMDEF ou1cimx1#329309 sl@0: sl@0: @SYMTestCaseDesc Fix native orientation functionality not supported sl@0: sl@0: @SYMTestPriority Medium sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions Call fucntions related to fix native orientation on a window sl@0: sl@0: @SYMTestExpectedResults Fix native orientation functionality not supported sl@0: */ sl@0: case 24: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0655")); sl@0: iTest->LogSubTest(KTest27); sl@0: TestNotSupportedFunctionality(); sl@0: break; sl@0: default: sl@0: ((CTWindowTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName); sl@0: ((CTWindowTestStep*)iStep)->CloseTMSGraphicsStep(); sl@0: TestComplete(); sl@0: break; sl@0: } sl@0: ((CTWindowTestStep*)iStep)->RecordTestResultL(); sl@0: } sl@0: sl@0: __WS_CONSTRUCT_STEP__(WindowTest)