1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TMODCHG.CPP Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,511 @@
1.4 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Coverted from TMan test code (TMMODCHG.CPP) August 2000
1.18 +// Test modifier changed message
1.19 +//
1.20 +//
1.21 +
1.22 +/**
1.23 + @file
1.24 + @test
1.25 + @internalComponent - Internal Symbian test code
1.26 +*/
1.27 +
1.28 +#include "TMODCHG.H"
1.29 +
1.30 +#define LOGGING on //Uncoment this line to get extra logging
1.31 +
1.32 +struct TModifierChangedTestsParams
1.33 + {
1.34 + TText *txt; // Text message telling user what to do
1.35 + TUint changed;
1.36 + TUint state;
1.37 + TUint stateMask;
1.38 + };
1.39 +
1.40 +LOCAL_D TModifierChangedTestsParams ModifierChangedTests[]={
1.41 + {(TText *)_S("Press Caps"),EModifierCapsLock,EModifierCapsLock,EModifierCapsLock},
1.42 + {(TText *)_S("Press Caps (again)"),EModifierCapsLock,0,EModifierCapsLock},
1.43 + {(TText *)_S("Press left shift"),EModifierShift|EModifierLeftShift,EModifierShift|EModifierLeftShift,EModifierShift|EModifierLeftShift},
1.44 + {(TText *)_S("Release left shift"),EModifierShift|EModifierLeftShift,0,EModifierShift|EModifierLeftShift},
1.45 + {(TText *)_S("Press right shift"),EModifierShift|EModifierRightShift,EModifierShift|EModifierRightShift,EModifierShift|EModifierRightShift},
1.46 + {(TText *)_S("Release right shift"),EModifierShift|EModifierRightShift,0,EModifierShift|EModifierRightShift},
1.47 + {(TText *)_S("Press (left) func"),EModifierFunc|EModifierLeftFunc,EModifierFunc|EModifierLeftFunc,EModifierFunc|EModifierLeftFunc},
1.48 + {(TText *)_S("Release (left) func"),EModifierFunc|EModifierLeftFunc,0,EModifierFunc|EModifierLeftFunc},
1.49 + {(TText *)_S("Press (left) control"),EModifierCtrl|EModifierLeftCtrl,EModifierCtrl|EModifierLeftCtrl,EModifierCtrl|EModifierLeftCtrl},
1.50 + {(TText *)_S("Release (left) control"),EModifierCtrl|EModifierLeftCtrl,0,EModifierCtrl|EModifierLeftCtrl},
1.51 + };
1.52 +
1.53 +// list of ModifierEvents that should be monitored
1.54 +LOCAL_D TInt ModifierChangedEvents=EModifierShift|EModifierLeftShift|EModifierRightShift|
1.55 + EModifierCapsLock|EModifierFunc|EModifierLeftFunc|EModifierCtrl|EModifierLeftCtrl;
1.56 +
1.57 +const TInt numTests=sizeof(ModifierChangedTests)/sizeof(ModifierChangedTests[0]);
1.58 +
1.59 +
1.60 +//
1.61 +// CTEventWindowGroup class //
1.62 +//
1.63 +
1.64 +CTEventWindowGroup::CTEventWindowGroup(CTClient *aClient, CTModifiersChanged *aTest) : CTWindowGroup(aClient), iTest(aTest)
1.65 + {}
1.66 +
1.67 +void CTEventWindowGroup::ConstructL()
1.68 + {
1.69 + CTWindowGroup::ConstructL();
1.70 + iGroupWin.EnableModifierChangedEvents(ModifierChangedEvents,EEventControlAlways);
1.71 + }
1.72 +
1.73 +void CTEventWindowGroup::ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged, const TTime &)
1.74 + {
1.75 + iTest->TestModifiersState(aModifiersChanged); // tests if event is correct
1.76 + }
1.77 +
1.78 +void CTEventWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &)
1.79 + {
1.80 + if (aKey.iCode==EKeyEscape || (aKey.iCode==' ' && iTest->iModSetTest))
1.81 + iTest->EndTest(); // not really needed, because timer cancels long running tests
1.82 + }
1.83 +
1.84 +//
1.85 +// CMCWindow, class //
1.86 +//
1.87 +
1.88 +CMCWindow::CMCWindow(CTModifiersChanged *aTest) : CTWin(), iTest(aTest)
1.89 + {
1.90 + iBack=TRgb::Gray256(230);
1.91 + }
1.92 +
1.93 +void CMCWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
1.94 + {
1.95 + ConstructExtLD(*parent,pos,size);
1.96 + iWin.SetBackgroundColor(iBack);
1.97 + Activate();
1.98 + AssignGC(aGc);
1.99 + iLineHeight=iFont->HeightInPixels()*5/4;
1.100 + iFontAscent=iFont->AscentInPixels();
1.101 + iXpos1=4;
1.102 + iXpos2=iXpos1+12*iFont->TextWidthInPixels(_L("M"));
1.103 + }
1.104 +
1.105 +void CMCWindow::DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers)
1.106 + {
1.107 + iYpos+=iLineHeight;
1.108 + iGc->DrawText(aDes, TPoint(iXpos1,iYpos));
1.109 + iGc->DrawText(aModifier&iSettableModifiers ? _L("Yes"):_L("No"), TPoint(iXpos2,iYpos));
1.110 + }
1.111 +
1.112 +void CMCWindow::Draw()
1.113 + {
1.114 + iGc->Clear();
1.115 + if (iTest->iModSetTest)
1.116 + {
1.117 + iYpos=iFontAscent+3;
1.118 + TBuf<32> buf;
1.119 + buf.Format(TRefByValue<const TDesC>(_L("Settable? [0x%4x]")), iTest->iSettable);
1.120 + iGc->DrawText(_L("Modifier"), TPoint(iXpos1,iYpos));
1.121 + iGc->DrawText(buf, TPoint(iXpos2,iYpos));
1.122 + DrawModSetLine(_L("Shift"),EModifierShift,iTest->iSettable);
1.123 + DrawModSetLine(_L("Left Shift"),EModifierLeftShift,iTest->iSettable);
1.124 + DrawModSetLine(_L("Func"),EModifierFunc,iTest->iSettable);
1.125 + DrawModSetLine(_L("Caps"),EModifierCapsLock,iTest->iSettable);
1.126 + DrawModSetLine(_L("NumLock"),EModifierNumLock,iTest->iSettable);
1.127 + DrawModSetLine(_L("Double Click"),EModifierDoubleClick,iTest->iSettable);
1.128 + }
1.129 + else
1.130 + iGc->DrawText(TPtrC(ModifierChangedTests[iTest->SubState()].txt), TPoint(10,20));
1.131 + }
1.132 +
1.133 +//
1.134 +
1.135 +CTModifiersChanged::CTModifiersChanged(CTestStep* aStep): CTWsGraphicsBase(aStep),
1.136 + iSkipFirstModifierEvents(EFalse), iSubSchedulerRunning(EFalse)
1.137 + {
1.138 + }
1.139 +
1.140 +CTModifiersChanged::~CTModifiersChanged()
1.141 + {
1.142 + delete iTimeOut;
1.143 + delete iWin;
1.144 + delete iEventGroup;
1.145 + }
1.146 +
1.147 +void CTModifiersChanged::ConstructL()
1.148 + {
1.149 + iTimeOut=new(ELeave) CTimeOut();
1.150 + iTimeOut->ConstructL();
1.151 + iWin=new(ELeave) CMCWindow(this);
1.152 + iWin->SetUpL(TPoint(10,10),TSize(240,200),Client()->iGroup, *Client()->iGc);
1.153 + }
1.154 +
1.155 +TInt CTModifiersChanged::TimeOut(TAny* aTest) // static
1.156 + {
1.157 + static_cast<CTModifiersChanged*>(aTest)->TimeOut();
1.158 + return(KErrNone);
1.159 + }
1.160 +
1.161 +void CTModifiersChanged::TimeOut()
1.162 + {
1.163 + #if defined(LOGGING)
1.164 + _LIT(KLogTimeOut,"Test timed out after %d secs.");
1.165 + LOG_MESSAGE2(KLogTimeOut,KTimeOutAfter/1000000);
1.166 + #endif
1.167 + EndTest();
1.168 + }
1.169 +
1.170 +void CTModifiersChanged::EndTest()
1.171 + {
1.172 + TEST(EFalse); // test failed (timeout or manually cancelled)
1.173 + if (iModSetTest)
1.174 + {
1.175 + iModSetTest=EFalse;
1.176 + iWin->Invalidate();
1.177 + }
1.178 + _LIT(KLogEndTest,"EndTest - State %d - SubState %d");
1.179 + LOG_MESSAGE3(KLogEndTest,iTest->iState,iSubState);
1.180 + if (iSubSchedulerRunning)
1.181 + {
1.182 + iSubSchedulerRunning = EFalse;
1.183 + CActiveScheduler::Stop(); // stop the sub-scheduler, so test-framework can execute the next test
1.184 + }
1.185 + }
1.186 +
1.187 +TInt CTModifiersChanged::SubState() const
1.188 + {
1.189 + return(iSubState);
1.190 + }
1.191 +
1.192 +void CTModifiersChanged::IncSubState()
1.193 + {
1.194 + if (iSubState<numTests-1)
1.195 + {
1.196 + iSubState++;
1.197 + iWin->Invalidate();
1.198 + TheClient->WaitForRedrawsToFinish();
1.199 + SendEvents();
1.200 + }
1.201 + else if (iSubState>=numTests-1) // test finished successfully
1.202 + {
1.203 + if (iSubSchedulerRunning)
1.204 + {
1.205 + iSubSchedulerRunning = EFalse;
1.206 + CActiveScheduler::Stop(); // stop the sub-scheduler, so test-framework can execute the next test
1.207 + }
1.208 + }
1.209 + }
1.210 +
1.211 +void CTModifiersChanged::TestModifiersState(const TModifiersChangedEvent &aModifiersChanged)
1.212 + {
1.213 + if (iTest->iState==1) // only if currently in test 1 (add another if for further tests)
1.214 + {
1.215 + TInt getMods=Client()->iWs.GetModifierState(); // double check the modifiers
1.216 + #if defined(LOGGING)
1.217 + if (iSkipFirstModifierEvents)
1.218 + {
1.219 + _LIT(KLogIgnored,"### This Event is part of the initial setup and is ignored for the test. ###");
1.220 + LOG_MESSAGE(KLogIgnored);
1.221 + }
1.222 + TLogMessageText buf;
1.223 + _LIT(KLog1,"##MC1 SS=%x Test-Modifiers=0x%x Test-Changed=0x%x Test-Mask=0x%x");
1.224 + buf.Format(KLog1,iSubState,ModifierChangedTests[iSubState].state,ModifierChangedTests[iSubState].changed,ModifierChangedTests[iSubState].stateMask);
1.225 + LOG_MESSAGE(buf);
1.226 + _LIT(KLog2,"##MC2 Event-Modifiers=0x%x Event-Changed=0x%x Get-Modifiers=0x%x");
1.227 + buf.Format(KLog2,aModifiersChanged.iModifiers,aModifiersChanged.iChangedModifiers,getMods);
1.228 + LOG_MESSAGE(buf);
1.229 + _LIT(KLog3,"##MC3 Changed: (Event) 0x%x==0x%x (Test)");
1.230 + buf.Format(KLog3,aModifiersChanged.iChangedModifiers,ModifierChangedTests[iSubState].changed);
1.231 + LOG_MESSAGE(buf);
1.232 + _LIT(KLog4,"##MC4 Modifier (with mask): (Event) 0x%x==0x%x (Test)");
1.233 + buf.Format(KLog4,aModifiersChanged.iModifiers&ModifierChangedTests[iSubState].stateMask,ModifierChangedTests[iSubState].state);
1.234 + LOG_MESSAGE(buf);
1.235 + _LIT(KLog5,"##MC5 Modifier (with mask): (Get) 0x%x==0x%x (Test)");
1.236 + buf.Format(KLog5,getMods&ModifierChangedTests[iSubState].stateMask,ModifierChangedTests[iSubState].state);
1.237 + LOG_MESSAGE(buf);
1.238 + #endif
1.239 + if (iSkipFirstModifierEvents) // skip the events caused by the initialization
1.240 + {
1.241 + if(--iSkipCounter<=0)
1.242 + {
1.243 + iSkipFirstModifierEvents = EFalse;
1.244 + }
1.245 + }
1.246 + else
1.247 + {
1.248 + if (aModifiersChanged.iChangedModifiers==ModifierChangedTests[iSubState].changed &&
1.249 + (aModifiersChanged.iModifiers&ModifierChangedTests[iSubState].stateMask)==ModifierChangedTests[iSubState].state &&
1.250 + (getMods&ModifierChangedTests[iSubState].stateMask)==ModifierChangedTests[iSubState].state)
1.251 + {
1.252 + IncSubState(); // subtest is successfull
1.253 + }
1.254 + else
1.255 + {
1.256 + TEST(EFalse); // subtest failed
1.257 + _LIT(KLogTestFailed,"Modifier Change test failed.");
1.258 + LOG_MESSAGE(KLogTestFailed);
1.259 + }
1.260 + }
1.261 + } // if test 1
1.262 + }
1.263 +
1.264 +void CTModifiersChanged::BadParams()
1.265 + {
1.266 + }
1.267 +
1.268 +/**
1.269 + * Resets all the modifiers after the test is finished. Make sure that all keys used in the
1.270 + * test are in the up-state.
1.271 + */
1.272 +void CTModifiersChanged::ResetModifiers()
1.273 + {
1.274 + _LIT(KLogResetModifiersError,"Error %d occured while turning off modifier 0x%x");
1.275 + TInt err;
1.276 + if ((err = Client()->iWs.SetModifierState(EModifierCapsLock,ETurnOffModifier)) != KErrNone)
1.277 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierCapsLock);
1.278 + if ((err = Client()->iWs.SetModifierState(EModifierShift,ETurnOffModifier)) != KErrNone)
1.279 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierShift);
1.280 + if ((err = Client()->iWs.SetModifierState(EModifierLeftShift,ETurnOffModifier)) != KErrNone)
1.281 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierLeftShift);
1.282 + if ((err = Client()->iWs.SetModifierState(EModifierRightShift,ETurnOffModifier)) != KErrNone)
1.283 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierRightShift);
1.284 + if ((err = Client()->iWs.SetModifierState(EModifierFunc,ETurnOffModifier)) != KErrNone)
1.285 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierFunc);
1.286 + if ((err = Client()->iWs.SetModifierState(EModifierLeftFunc,ETurnOffModifier)) != KErrNone)
1.287 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierLeftFunc);
1.288 + if ((err = Client()->iWs.SetModifierState(EModifierCtrl,ETurnOffModifier)) != KErrNone)
1.289 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierCtrl);
1.290 + if ((err = Client()->iWs.SetModifierState(EModifierLeftCtrl,ETurnOffModifier)) != KErrNone)
1.291 + LOG_MESSAGE3(KLogResetModifiersError,err, EModifierLeftCtrl);
1.292 + }
1.293 +
1.294 +/**
1.295 + * Initialises the Modifier state. All tested modifiers must be in the up-state before the
1.296 + * test starts. The number of sent key simulations needed for initialization is recorded.
1.297 + * Each key simulation during initialization causes a ModifierChanged event which should be
1.298 + * ignored because it's not part of the actual test.
1.299 + */
1.300 +void CTModifiersChanged::ModifierChangedEventsL()
1.301 + {
1.302 + iEventGroup=new(ELeave) CTEventWindowGroup(Client(), this);
1.303 + iEventGroup->ConstructL();
1.304 + TInt modifiers=Client()->iWs.GetModifierState();
1.305 +
1.306 + if ((ModifierChangedEvents&modifiers)>0) // reset modifiers if they are in the down-state
1.307 + {
1.308 + iSkipFirstModifierEvents = ETrue;
1.309 + if ((modifiers&EModifierCapsLock)>0)
1.310 + {
1.311 + iTest->SimulateKeyDownUp(EStdKeyCapsLock);
1.312 + ++iSkipCounter;
1.313 + modifiers=Client()->iWs.GetModifierState();
1.314 + }
1.315 + if ((modifiers&EModifierLeftShift)>0)
1.316 + {
1.317 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
1.318 + ++iSkipCounter;
1.319 + modifiers=Client()->iWs.GetModifierState();
1.320 + }
1.321 + if ((modifiers&EModifierRightShift)>0)
1.322 + {
1.323 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyRightShift);
1.324 + ++iSkipCounter;
1.325 + modifiers=Client()->iWs.GetModifierState();
1.326 + }
1.327 + if ((modifiers&EModifierLeftFunc)>0)
1.328 + {
1.329 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
1.330 + ++iSkipCounter;
1.331 + modifiers=Client()->iWs.GetModifierState();
1.332 + }
1.333 + if ((modifiers&EModifierLeftCtrl)>0)
1.334 + {
1.335 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
1.336 + ++iSkipCounter;
1.337 + }
1.338 + }
1.339 + modifiers=Client()->iWs.GetModifierState();
1.340 + _LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
1.341 + LOG_MESSAGE2(KLog,modifiers);
1.342 + }
1.343 +
1.344 +void CTModifiersChanged::CheckModifier(TEventModifier aModifier)
1.345 + {
1.346 + TBool retVal;
1.347 + TInt oldMods=Client()->iWs.GetModifierState();
1.348 + Client()->iWs.SetModifierState(aModifier,EToggleModifier);
1.349 + TInt getMods=Client()->iWs.GetModifierState();
1.350 + if (oldMods!=getMods)
1.351 + {
1.352 + _LIT(KLogOff,"Attempted to turn off modifiers 0x%x, 0x%x still on");
1.353 + _LIT(KLogOn,"Attempted to turn on modifiers 0x%x, 0x%x still off");
1.354 + iSettable|=aModifier;
1.355 + Client()->iWs.SetModifierState(aModifier,ETurnOffModifier);
1.356 + getMods=Client()->iWs.GetModifierState();
1.357 + retVal=!(getMods&aModifier);
1.358 + TEST(retVal);
1.359 + if (!retVal)
1.360 + LOG_MESSAGE3(KLogOff,aModifier,getMods&aModifier);
1.361 + Client()->iWs.SetModifierState(aModifier,ETurnOnModifier);
1.362 + getMods=Client()->iWs.GetModifierState();
1.363 + retVal=getMods&aModifier;
1.364 + TEST(retVal);
1.365 + if (!retVal)
1.366 + LOG_MESSAGE3(KLogOn,aModifier,getMods&aModifier);
1.367 + Client()->iWs.SetModifierState(aModifier,ETurnOffModifier);
1.368 + getMods=Client()->iWs.GetModifierState();
1.369 + retVal=!(getMods&aModifier);
1.370 + TEST(retVal);
1.371 + if (!retVal)
1.372 + LOG_MESSAGE3(KLogOff,aModifier,getMods&aModifier);
1.373 + if (oldMods&aModifier)
1.374 + Client()->iWs.SetModifierState(aModifier,ETurnOnModifier);
1.375 + }
1.376 + else
1.377 + {
1.378 + Client()->iWs.SetModifierState(aModifier,ETurnOffModifier);
1.379 + retVal=oldMods==Client()->iWs.GetModifierState();
1.380 + TEST(retVal);
1.381 + if (!retVal)
1.382 + {
1.383 + _LIT(KLog,"Attempted to turn off modifiers 0x%x, suceeded when it should have failed");
1.384 + LOG_MESSAGE2(KLog,aModifier);
1.385 + }
1.386 + Client()->iWs.SetModifierState(aModifier,ETurnOnModifier);
1.387 + retVal=oldMods==Client()->iWs.GetModifierState();
1.388 + TEST(retVal);
1.389 + if (!retVal)
1.390 + {
1.391 + _LIT(KLog,"Attempted to turn on modifiers 0x%x, suceeded when it should have failed");
1.392 + LOG_MESSAGE2(KLog,aModifier);
1.393 + }
1.394 + }
1.395 + }
1.396 +
1.397 +void CTModifiersChanged::SetModifiers()
1.398 + {
1.399 + iModSetTest=ETrue;
1.400 + for(TInt mod=1;mod!=0;mod<<=1)
1.401 + CheckModifier((TEventModifier)mod);
1.402 + iWin->Invalidate();
1.403 + Client()->iWs.Flush();
1.404 + }
1.405 +
1.406 +void CTModifiersChanged::SendEvents()
1.407 + {
1.408 + iTest->LogSubState(iSubState);
1.409 + switch (iSubState)
1.410 + {
1.411 + case 0:
1.412 + iTest->SimulateKeyDownUp(EStdKeyCapsLock);
1.413 + break;
1.414 + case 1:
1.415 + iTest->SimulateKeyDownUp(EStdKeyCapsLock);
1.416 + break;
1.417 + case 2:
1.418 + iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);
1.419 + break;
1.420 + case 3:
1.421 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
1.422 + break;
1.423 + case 4:
1.424 + iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyRightShift);
1.425 + break;
1.426 + case 5:
1.427 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyRightShift);
1.428 + break;
1.429 + case 6:
1.430 + iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftFunc);
1.431 + break;
1.432 + case 7:
1.433 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
1.434 + break;
1.435 + case 8:
1.436 + iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftCtrl);
1.437 + break;
1.438 + case 9:
1.439 + iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
1.440 + break;
1.441 + default:
1.442 + TEST(EFalse);
1.443 + return;
1.444 + }
1.445 + TheClient->iWs.Flush();
1.446 + }
1.447 +
1.448 +void CTModifiersChanged::RunTestCaseL(TInt /*aCurTestCase*/)
1.449 + {
1.450 + _LIT(KModChange,"Modifier Change");
1.451 + _LIT(KTestErrors,"Bad Parameter");
1.452 + ((CTModifiersChangedStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
1.453 + switch(++iTest->iState)
1.454 + {
1.455 +/**
1.456 +@SYMTestCaseID GRAPHICS-WSERV-0239
1.457 +
1.458 +@SYMDEF DEF081259
1.459 +
1.460 +@SYMTestCaseDesc Test modifier changed message
1.461 +
1.462 +@SYMTestPriority High
1.463 +
1.464 +@SYMTestStatus Implemented
1.465 +
1.466 +@SYMTestActions Test that modifier changed message functions correctly
1.467 +
1.468 +@SYMTestExpectedResults The message functions correctly
1.469 +*/
1.470 + case 1:
1.471 + ((CTModifiersChangedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0239"));
1.472 + iTest->LogSubTest(KModChange);
1.473 + ModifierChangedEventsL();
1.474 + // start a timer to cancel the sub-scheduler
1.475 + iTimeOut->Start(KTimeOutAfter,TCallBack(CTModifiersChanged::TimeOut,this));
1.476 + SendEvents();
1.477 + iSubSchedulerRunning = ETrue;
1.478 + CActiveScheduler::Start(); // sub-scheduler blocks this AO (test-framework) until completion
1.479 + iTimeOut->Cancel();
1.480 + ((CTModifiersChangedStep*)iStep)->RecordTestResultL();
1.481 + ((CTModifiersChangedStep*)iStep)->CloseTMSGraphicsStep();
1.482 + break;
1.483 +/**
1.484 +@SYMTestCaseID GRAPHICS-WSERV-0240
1.485 +
1.486 +@SYMDEF DEF081259
1.487 +
1.488 +@SYMTestCaseDesc Test bad parameters for modifier changed message
1.489 +
1.490 +@SYMTestPriority High
1.491 +
1.492 +@SYMTestStatus Implemented
1.493 +
1.494 +@SYMTestActions Test using bad parameters for a modifier changed message
1.495 +
1.496 +@SYMTestExpectedResults Responds correctly when bad parameters are used
1.497 +*/
1.498 + case 2:
1.499 + ((CTModifiersChangedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0240"));
1.500 + iTest->LogSubTest(KTestErrors);
1.501 + BadParams();
1.502 + ((CTModifiersChangedStep*)iStep)->RecordTestResultL();
1.503 + break;
1.504 + default:
1.505 + ResetModifiers(); // reset modifiers, so further tests are not influenced
1.506 + ((CTModifiersChangedStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
1.507 + ((CTModifiersChangedStep*)iStep)->CloseTMSGraphicsStep();
1.508 + TestComplete();
1.509 + }
1.510 +
1.511 +
1.512 + }
1.513 +
1.514 +__WS_CONSTRUCT_STEP__(ModifiersChanged)