os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/Te_EComPluginReDiscoverPerfTestStep.cpp
Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Te_EComPluginReDiscoverPerfTest.cpp
15 // Implements the performance loggr for ECOM
24 #include "Te_EComPluginReDiscoverPerfTestStep.h"
27 #include <startup.hrh>
28 #include <ecom/ecom.h>
29 #include "Interface.h"
30 #include "EcomTestUtils.h"
32 #ifdef __ECOM_SERVER_PERFORMANCE__
33 const TInt KOneSecond = 1000000;
35 const TReal KNotifierRunLTimeLimitH2RAM = 2; // mSec
36 const TReal KTimerRunLScanTwoRSCsOnOneDriveLimitH2RAM = 80; // mSec
37 const TReal KTimerRunLScanZeroRSCOnOneDriveLimitH2RAM = 40; // mSec
39 const TReal KNotifierRunLTimeLimitH4RAM = 1; // mSec
40 const TReal KTimerRunLScanTwoRSCsOnOneDriveLimitH4RAM = 40; // mSec
41 const TReal KTimerRunLScanZeroRSCOnOneDriveLimitH4RAM = 20; // mSec
43 const TReal KNotifierRunLTimeLimitH4NAND = 6; // mSec
44 const TReal KTimerRunLScanTwoRSCsOnOneDriveLimitH4NAND = 50; // mSec
45 const TReal KTimerRunLScanZeroRSCOnOneDriveLimitH4NAND = 20; // mSec
47 const TReal KNotifierRunLTimeLimitH6RAM = 1; // mSec
48 const TReal KTimerRunLScanTwoRSCsOnOneDriveLimitH6RAM = 20; // mSec
49 const TReal KTimerRunLScanZeroRSCOnOneDriveLimitH6RAM = 8; // mSec
51 const TReal KNotifierRunLTimeLimitH6NAND = 4; // mSec
52 const TReal KTimerRunLScanTwoRSCsOnOneDriveLimitH6NAND = 25; // mSec
53 const TReal KTimerRunLScanZeroRSCOnOneDriveLimitH6NAND = 8; // mSec
55 // The default benchmark checking threshold are defined as zero, for emulator platform.
56 // The values will be changed for H2 or H4 OR H6 boards.
57 // See CEComPluginReDiscoverPerfTest::SetBenchmarks()
58 static TReal NotifierRunLTimeLimit = 0;
59 static TReal TimerRunLScanTwoRSCsOnOneDriveLimit = 0;
60 static TReal TimerRunLScanZeroRSCOnOneDriveLimit = 0;
62 _LIT(KRamOnlyEComCR629Example2RSC, "Z:\\RAMOnly\\EComCR629Example2.rsc");
63 _LIT(KEComExample12RSCOnZ, "Z:\\RAMOnly\\EComExample12.rsc");
64 _LIT(KEComExample12RSC1OnC, "C:\\Resource\\Plugins\\EComExample12_1.rsc");
65 _LIT(KEComExample12RSC2OnC, "C:\\Resource\\Plugins\\EComExample12_2.rsc");
66 _LIT(KEComRscDirName, "\\Resource\\Plugins");
67 _LIT(KEComCR629RSCFileName, "\\Resource\\Plugins\\EComCR629Example1_");
68 _LIT(KEComRSCFileExt, ".rsc");
69 _LIT(KEComAllRSCFilesName, "\\Resource\\Plugins\\*.rsc");
70 #endif //__ECOM_SERVER_PERFORMANCE__
72 CEComPluginReDiscoverPerfTest::CEComPluginReDiscoverPerfTest() : CEComPerfTestBase(KEComPluginReDiscoverPerfTest)
76 CEComPluginReDiscoverPerfTest::~CEComPluginReDiscoverPerfTest()
80 #ifdef __ECOM_SERVER_PERFORMANCE__
82 Set different benchmark thresholds for H2 or H4 or H6 boards.
83 Emulator tests will not disable benchmark checking, so don't need to set values for it.
85 void CEComPluginReDiscoverPerfTest::SetBenchmarksL()
87 THardwareConfiguration hardware_configuration = EComTestUtils::GetHardwareConfiguration();
88 switch (hardware_configuration)
91 NotifierRunLTimeLimit = KNotifierRunLTimeLimitH2RAM;
92 TimerRunLScanTwoRSCsOnOneDriveLimit = KTimerRunLScanTwoRSCsOnOneDriveLimitH2RAM;
93 TimerRunLScanZeroRSCOnOneDriveLimit = KTimerRunLScanZeroRSCOnOneDriveLimitH2RAM;
94 INFO_PRINTF1(_L("Hardware configuration: H2 RAM"));
98 INFO_PRINTF1(_L("Hardware configuration: H2 NAND"));
99 INFO_PRINTF1(_L("***Performance testing on H2 NAND is not supported!***"));
100 SetTestStepResult(EFail);
103 case EPlatformH2NANDDP:
104 INFO_PRINTF1(_L("Hardware configuration: H2 NAND DP"));
105 INFO_PRINTF1(_L("***Performance testing on H2 NAND DP is not supported!***"));
106 SetTestStepResult(EFail);
110 NotifierRunLTimeLimit = KNotifierRunLTimeLimitH4RAM;
111 TimerRunLScanTwoRSCsOnOneDriveLimit = KTimerRunLScanTwoRSCsOnOneDriveLimitH4RAM;
112 TimerRunLScanZeroRSCOnOneDriveLimit = KTimerRunLScanZeroRSCOnOneDriveLimitH4RAM;
113 INFO_PRINTF1(_L("Hardware configuration: H4 RAM"));
116 case EPlatformH4NAND:
117 NotifierRunLTimeLimit = KNotifierRunLTimeLimitH4NAND;
118 TimerRunLScanTwoRSCsOnOneDriveLimit = KTimerRunLScanTwoRSCsOnOneDriveLimitH4NAND;
119 TimerRunLScanZeroRSCOnOneDriveLimit = KTimerRunLScanZeroRSCOnOneDriveLimitH4NAND;
120 INFO_PRINTF1(_L("Hardware configuration: H4 NAND"));
123 case EPlatformH4NANDDP:
124 INFO_PRINTF1(_L("Hardware configuration: H4 NAND DP"));
128 NotifierRunLTimeLimit = KNotifierRunLTimeLimitH6RAM;
129 TimerRunLScanTwoRSCsOnOneDriveLimit = KTimerRunLScanTwoRSCsOnOneDriveLimitH6RAM;
130 TimerRunLScanZeroRSCOnOneDriveLimit = KTimerRunLScanZeroRSCOnOneDriveLimitH6RAM;
131 INFO_PRINTF1(_L("Hardware configuration: H6 RAM"));
134 case EPlatformH6NAND:
135 NotifierRunLTimeLimit = KNotifierRunLTimeLimitH6NAND;
136 TimerRunLScanTwoRSCsOnOneDriveLimit = KTimerRunLScanTwoRSCsOnOneDriveLimitH6NAND;
137 TimerRunLScanZeroRSCOnOneDriveLimit = KTimerRunLScanZeroRSCOnOneDriveLimitH6NAND;
138 INFO_PRINTF1(_L("Hardware configuration: H6 NAND"));
141 case EPlatformH6NANDDP:
142 INFO_PRINTF1(_L("Hardware configuration: H6 NAND DP"));
145 case EPlatformWINSCW:
146 INFO_PRINTF1(_L("Hardware configuration: WINSCW"));
150 SetTestStepResult(EFail);
151 INFO_PRINTF1(_L("***Unrecognized platform!***"));
156 TBool CEComPluginReDiscoverPerfTest::CheckTimeResults(TReal aTimeLimit, RArray<TEComPerfRealTimeResult>& aTimeResults)
158 TInt count = aTimeResults.Count();
162 switch(aTimeResults[0].iType)
164 case ECDiscovererNotifierRunL:
166 for(TInt idx = 0; idx < count; ++idx)
168 TReal elapsedTime = aTimeResults[idx].iEndTime - aTimeResults[idx].iStartTime;
169 INFO_PRINTF2(_L("Notifier RunL gets called for drive: %d"), aTimeResults[idx].iInfo);
170 CheckPerformance(elapsedTime, aTimeLimit, _L("Notifier RunL"));
174 case ECDiscovererTimerRunL:
176 // Check timer runl only ran once
179 INFO_PRINTF1(_L("Timer RunL ran more than once!\n"));
184 const TEComPerfRealTimeResult& timeResult = aTimeResults[0];
185 TReal elapsedTime = aTimeResults[0].iEndTime - aTimeResults[0].iStartTime;
186 CheckPerformance(elapsedTime, aTimeLimit, _L("Timer RunL"));
192 INFO_PRINTF1(_L("Unrecognizable type for checking performance!\n"));
198 else // No time result retrieved
200 INFO_PRINTF1(_L("No time result Retrieved!\n"));
205 void CEComPluginReDiscoverPerfTest::CopyPluginCR629TestRSCOnDrive(TUint aDriveNum, TInt aNumOfCopies)
210 TDriveUnit aDrive(aDriveNum);
211 TBuf<256> resourceFileName;
212 for(TInt num = 1; num<= aNumOfCopies; num++ )
214 resourceFileName.Zero();
215 resourceFileName.Append(aDrive.Name());
216 resourceFileName.Append(KEComCR629RSCFileName);
217 resourceFileName.AppendNum(num);
218 resourceFileName.Append(KEComRSCFileExt);
219 TRAP(err, EComTestUtils::FileManCopyFileL(KRamOnlyEComCR629Example2RSC, resourceFileName));
220 TEST(err ==KErrNone);
225 INFO_PRINTF1(_L("Number of file copies should be greater than 0!\n"));
229 void CEComPluginReDiscoverPerfTest::DeleteRSCFilesOnDrive(TUint aDriveNum)
232 TDriveUnit aDrive(aDriveNum);
234 TBuf<256> resourceFileName;
235 resourceFileName.Append(aDrive.Name());
236 resourceFileName.Append(KEComAllRSCFilesName);
237 TRAP(err, EComTestUtils::FileManDeleteFileL(resourceFileName));
240 void CEComPluginReDiscoverPerfTest::DeleteRSCFolderOnDrive(TUint aDriveNum)
243 TDriveUnit aDrive(aDriveNum);
245 TBuf<256> resourceFileName;
246 resourceFileName.Append(aDrive.Name());
247 resourceFileName.Append(KEComAllRSCFilesName);
248 TRAP(err, EComTestUtils::FileManDeleteFileL(resourceFileName));
250 TBuf<256> resourceDirName;
251 resourceDirName.Append(aDrive.Name());
252 resourceDirName.Append(KEComRscDirName);
253 TRAP(err, EComTestUtils::FileManDeleteDirL(resourceDirName));
256 #endif //__ECOM_SERVER_PERFORMANCE__
259 Test cases covered in the test step:
260 1. Multiple notification processing on single drive (C:)
262 1.1 Rediscovery on adding RSC files
263 Performance check on Notifier RunL
264 Functionality check on Notifier RunL
265 Performance check on Timer RunL
266 Functionality check on RediscoveryScanDirectoryL
268 1.2 Rediscovery on deleting RSC files
270 1.3 Rediscovery on adding RSC PlugIn3 files. It does the performance test
271 for parsing new registry data.
274 2. Multiple notification processing on multiple drives (C: and X: or E:)
276 2.1 Rediscovery on adding RSC files
279 2.2 Rediscovery on deleting RSC filles
282 3. MMC Remounting tests on drive E:
284 3.1 Before: has plugins
288 3.2 Before: has plugins
289 After: has no plugins
292 3.3 Before: has no plugins
296 3.4 Before: has no plugins
297 After: has no plugins
300 @pre For hardware test, MMC (E:) drive should be available.
301 @return EPass if the test succeeds and the measured times pass the checks
304 TVerdict CEComPluginReDiscoverPerfTest::doTestStepL()
306 #ifdef __ECOM_SERVER_PERFORMANCE__
307 // Set benchmark threshold for different hardware platform, default values are 0s, for emulator.
310 //1. Multiple notification processing on single drive (C:)
311 INFO_PRINTF1(_L("1. Multiple notification processing on single drive (C:)"));
313 //1.1 Testing rediscovery performance on adding RSC files on C:
314 INFO_PRINTF1(_L("1.1 Testing rediscovery on adding RSC files onto drive C:"));
316 DeleteRSCFilesOnDrive(EDriveC);
317 User::After(KOneSecond * 3);
318 REComPerfTimeRecords timeRecords;
320 // Clean up time records on server.
321 TRAPD(err, timeRecords.ResetRecordsOnServerL());
324 CopyPluginCR629TestRSCOnDrive(EDriveC, 2);
325 User::After(KOneSecond * 3);
327 // Now get all time records from server
328 TRAP(err, timeRecords.OpenL());
330 TEST(timeRecords.Count() > 0);
332 RArray<TEComPerfRealTimeResult> timeResults;
333 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
335 // Test notifications were triggered and check performance of RunL of Notifiers
336 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
339 RArray<TInt> timeResultsInfos;
340 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
342 // Test notifications ONLY triggered on C: drive
343 TEST(timeResultsInfos.Count()==1);
344 TEST(timeResultsInfos[0] == EDriveC);
345 timeResultsInfos.Reset();
347 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
349 // Test Timer RunL ran only once and check performance.
350 TEST(CheckTimeResults(TimerRunLScanTwoRSCsOnOneDriveLimit, timeResults));
353 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
355 // Test directory scanning has and ONLY performed on C: drive
356 TEST(timeResultsInfos.Count()==1);
357 TEST(timeResultsInfos[0] == EDriveC);
358 timeResultsInfos.Reset();
360 //1.2 Testing rediscovery performance on deleting RSC files
361 INFO_PRINTF1(_L("1.2 Testing rediscovery on removing RSC files from drive C:"));
362 // Clean up time records on server.
363 TRAP(err, timeRecords.ResetRecordsOnServerL());
366 DeleteRSCFilesOnDrive(EDriveC);
367 User::After(KOneSecond * 3);
369 // Now get all time records from server.
370 TRAP(err, timeRecords.OpenL());
372 TEST(timeRecords.Count() > 0);
374 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
376 // Test notifications were triggered and check performance of RunL of Notifiers
377 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
380 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
382 // Test notifications ONLY triggered on C: drive
383 TEST(timeResultsInfos.Count()==1);
384 TEST(timeResultsInfos[0] == EDriveC);
385 timeResultsInfos.Reset();
387 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
389 // Test Timer RunL ran only once and check performance.
390 TEST(CheckTimeResults(TimerRunLScanZeroRSCOnOneDriveLimit, timeResults));
393 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
395 // Test directory scanning has and ONLY performed on C: drive
396 TEST(timeResultsInfos.Count()==1);
397 TEST(timeResultsInfos[0] == EDriveC);
398 timeResultsInfos.Reset();
400 //1.3 Testing rediscovery performance on adding RSC PLUGIN3 files on C:
401 INFO_PRINTF1(_L("1.3 Testing rediscovery on adding RSC PLUGIN3 files onto drive C:"));
403 DeleteRSCFilesOnDrive(EDriveC);
404 User::After(KOneSecond * 3);
406 // Clean up time records on server.
407 TRAP(err, timeRecords.ResetRecordsOnServerL());
410 // Adding RSC PLUGIN3 file twice
411 TRAP(err, EComTestUtils::FileManCopyFileL(KEComExample12RSCOnZ, KEComExample12RSC1OnC));
413 TRAP(err, EComTestUtils::FileManCopyFileL(KEComExample12RSCOnZ, KEComExample12RSC2OnC));
415 User::After(KOneSecond * 3);
417 // Now get all time records from server
418 TRAP(err, timeRecords.OpenL());
420 TEST(timeRecords.Count() > 0);
422 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
424 // Test notifications were triggered and check performance of RunL of Notifiers
425 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
428 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
430 // Test notifications ONLY triggered on C: drive
431 TEST(timeResultsInfos.Count()==1);
432 TEST(timeResultsInfos[0] == EDriveC);
433 timeResultsInfos.Reset();
435 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
437 // Test Timer RunL ran only once and check performance.
438 TEST(CheckTimeResults(TimerRunLScanTwoRSCsOnOneDriveLimit, timeResults));
441 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
443 // Test directory scanning has and ONLY performed on C: drive
444 TEST(timeResultsInfos.Count()==1);
445 TEST(timeResultsInfos[0] == EDriveC);
446 timeResultsInfos.Reset();
447 // Delete the RSC files
448 TRAP(err, EComTestUtils::FileManDeleteFileL(KEComExample12RSC1OnC));
449 TRAP(err, EComTestUtils::FileManDeleteFileL(KEComExample12RSC2OnC));
450 User::After(KOneSecond * 3);
452 //2. Multiple notification processing on multiple drives (C: and X: or E:)
454 TEST(fs.Connect()==KErrNone);
456 //2.1 Testing rediscovery performance on adding RSC files on multiple drives
457 // Clean up time records on server.
458 TRAP(err, timeRecords.ResetRecordsOnServerL());
461 CopyPluginCR629TestRSCOnDrive(EDriveC, 2);
462 #if defined(__WINSCW__) // C: and X: on emulator
463 INFO_PRINTF1(_L("2. Multiple notification processing on multiple drives (C: and X:)"));
464 INFO_PRINTF1(_L("2.1 Testing rediscovery on adding RSC files onto drive C: and X:"));
465 CopyPluginCR629TestRSCOnDrive(EDriveX, 2);
466 #else // C: and E: on hardware
467 INFO_PRINTF1(_L("2. Multiple notification processing on multiple drives (C: and E:)"));
468 INFO_PRINTF1(_L("2.1 Testing rediscovery on adding RSC files onto drive C: and E:"));
470 // Check the availability of E: drive and MMC card.
471 TDriveList drivelist;
472 TEST(fs.DriveList(drivelist)==KErrNone);
473 if (!(drivelist[EDriveE]))
475 SetTestStepResult(EFail);
476 INFO_PRINTF1(_L("*** Drive E: is not available for hardware tests! ***"));
477 DeleteRSCFilesOnDrive(EDriveC);
478 return TestStepResult();
481 TDriveInfo aDriveInfo;
482 TEST(fs.Drive(aDriveInfo, EDriveE)==KErrNone);
483 if (aDriveInfo.iType != EMediaHardDisk)
485 SetTestStepResult(EFail);
486 INFO_PRINTF1(_L("*** MMC card is not available for hardware tests! ***"));
487 DeleteRSCFilesOnDrive(EDriveC);
488 return TestStepResult();
492 CopyPluginCR629TestRSCOnDrive(EDriveE, 2);
494 User::After(KOneSecond * 3);
496 // Now get all time records from server.
497 TRAP(err, timeRecords.OpenL());
499 TEST(timeRecords.Count() > 0);
501 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
503 // Test notifications were triggered and check performance of RunL of Notifiers
504 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
507 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
509 // Test notifications ONLY triggered on C: and X: (or E:) drive
510 TEST(timeResultsInfos.Count()==2);
511 TEST(timeResultsInfos.Find(EDriveC)!=KErrNotFound);
512 #if defined(__WINSCW__)
513 TEST(timeResultsInfos.Find(EDriveX)!=KErrNotFound);
515 TEST(timeResultsInfos.Find(EDriveE)!=KErrNotFound);
517 timeResultsInfos.Reset();
519 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
521 // Test Timer RunL ran only once and check performance.
522 TEST(CheckTimeResults(TimerRunLScanTwoRSCsOnOneDriveLimit * 2, timeResults));
525 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
527 // Test directory scanning has and ONLY performed on C: and X: (or E:) drive
528 TEST(timeResultsInfos.Count()==2);
529 TEST(timeResultsInfos.Find(EDriveC)!=KErrNotFound);
530 #if defined(__WINSCW__)
531 TEST(timeResultsInfos.Find(EDriveX)!=KErrNotFound);
533 TEST(timeResultsInfos.Find(EDriveE)!=KErrNotFound);
535 timeResultsInfos.Reset();
538 //2.2 Testing rediscovery performance on deleting RSC files on multiple drives
539 // Clean up time records on server.
540 TRAP(err, timeRecords.ResetRecordsOnServerL());
543 DeleteRSCFilesOnDrive(EDriveC);
544 #if defined(__WINSCW__) // C: and X: on emulator
545 INFO_PRINTF1(_L("2.2 Testing rediscovery on removing RSC files from drive C: and X:"));
546 DeleteRSCFolderOnDrive(EDriveX);
547 #else // C: and E: on hardware
548 INFO_PRINTF1(_L("2.2 Testing rediscovery on removing RSC files from drive C: and E:"));
549 DeleteRSCFolderOnDrive(EDriveE);
551 User::After(KOneSecond * 3);
553 // Now get all time records from server.
554 TRAP(err, timeRecords.OpenL());
556 TEST(timeRecords.Count() > 0);
558 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
560 // Test notifications were triggered and check performance of RunL of Notifiers
561 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
564 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
566 // Test notifications ONLY triggered on C: and X: (or E:) drive
567 TEST(timeResultsInfos.Count()==2);
568 TEST(timeResultsInfos.Find(EDriveC)!=KErrNotFound);
569 #if defined(__WINSCW__)
570 TEST(timeResultsInfos.Find(EDriveX)!=KErrNotFound);
572 TEST(timeResultsInfos.Find(EDriveE)!=KErrNotFound);
574 timeResultsInfos.Reset();
576 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
578 // Test Timer RunL ran only once and check performance.
579 TEST(CheckTimeResults(TimerRunLScanZeroRSCOnOneDriveLimit * 2, timeResults));
582 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
584 // Test directory scanning has and ONLY performed on C: and X: (or E:) drive
585 TEST(timeResultsInfos.Count()==2);
586 TEST(timeResultsInfos.Find(EDriveC)!=KErrNotFound);
587 #if defined(__WINSCW__)
588 TEST(timeResultsInfos.Find(EDriveX)!=KErrNotFound);
590 TEST(timeResultsInfos.Find(EDriveE)!=KErrNotFound);
592 timeResultsInfos.Reset();
595 //3. MMC Remounting tests on drive E:
596 INFO_PRINTF1(_L("3. MMC Remounting tests on drive E:"));
597 #if defined(__WINSCW__)
598 // Tests only run on hardware.
599 INFO_PRINTF1(_L("This test can only run on hardware, please see test results of hardware for further information."));
601 CopyPluginCR629TestRSCOnDrive(EDriveE, 2);
602 User::After(KOneSecond * 3);
604 //3.1 before remounting: has plugins
605 // after remounting: has plugins
606 INFO_PRINTF1(_L("3.1 Before Remount: has plugins; After Remount: has plugins"));
607 // Clean up time records on server.
608 TRAP(err, timeRecords.ResetRecordsOnServerL());
611 TEST(fs.RemountDrive(EDriveE)==KErrNone);
612 User::After(KOneSecond * 3);
614 // Now get all time records from server.
615 TRAP(err, timeRecords.OpenL());
617 TEST(timeRecords.Count() > 0);
619 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
621 // Test notifications were triggered and check performance of RunL of Notifiers
622 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
625 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
626 // Test notifications ONLY triggered on E: drive
627 TEST(timeResultsInfos.Count()==1);
628 TEST(timeResultsInfos[0] == EDriveE);
629 timeResultsInfos.Reset();
631 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
633 // Test Timer RunL ran only once and check performance.
634 TEST(CheckTimeResults(TimerRunLScanTwoRSCsOnOneDriveLimit, timeResults));
637 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
639 // Test directory scanning has and ONLY performed on E: drive
640 TEST(timeResultsInfos.Count()==1);
641 TEST(timeResultsInfos[0] == EDriveE);
642 timeResultsInfos.Reset();
644 //3.2 before remounting: has plugins
645 // after remounting: has no plugins
646 INFO_PRINTF1(_L("3.2 Before Remount: has plugins; After Remount: has no plugins"));
647 // Clean up time records on server.
648 TRAP(err, timeRecords.ResetRecordsOnServerL());
651 DeleteRSCFolderOnDrive(EDriveE);
652 TEST(fs.RemountDrive(EDriveE)==KErrNone);
653 User::After(KOneSecond * 3);
655 // Now get all time records from server.
656 TRAP(err, timeRecords.OpenL());
658 TEST(timeRecords.Count() > 0);
660 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
662 // Test notifications were triggered and check performance of RunL of Notifiers
663 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
666 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
668 // Test notifications ONLY triggered for E: drive
669 TEST(timeResultsInfos.Count()==1);
670 TEST(timeResultsInfos[0] == EDriveE);
671 timeResultsInfos.Reset();
673 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
675 // Test Timer RunL ran only once and check performance.
676 TEST(CheckTimeResults(TimerRunLScanZeroRSCOnOneDriveLimit, timeResults));
679 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
681 // Test directory scanning has and ONLY performed on E: drive
682 TEST(timeResultsInfos.Count()==1);
683 TEST(timeResultsInfos[0] == EDriveE);
684 timeResultsInfos.Reset();
686 //3.3 before remounting: has no plugins
687 // after remounting: has plugins
688 INFO_PRINTF1(_L("3.3 Before Remount: has no plugins; After Remount: has plugins"));
689 // Clean up time records on server.
690 TRAP(err, timeRecords.ResetRecordsOnServerL());
693 CopyPluginCR629TestRSCOnDrive(EDriveE, 2);
694 TEST(fs.RemountDrive(EDriveE)==KErrNone);
695 User::After(KOneSecond * 3);
697 // Now get all time records from server.
698 TRAP(err, timeRecords.OpenL());
700 TEST(timeRecords.Count() > 0);
702 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
704 // Test notifications were triggered and check performance of RunL of Notifiers
705 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
708 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
710 // Test notifications ONLY triggered for E: drive
711 TEST(timeResultsInfos.Count()==1);
712 TEST(timeResultsInfos[0] == EDriveE);
713 timeResultsInfos.Reset();
715 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
717 // Test Timer RunL ran only once and check performance.
718 TEST(CheckTimeResults(TimerRunLScanTwoRSCsOnOneDriveLimit, timeResults));
721 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
723 // Test directory scanning has and ONLY performed on E: drive
724 TEST(timeResultsInfos.Count()==1);
725 TEST(timeResultsInfos[0] == EDriveE);
726 timeResultsInfos.Reset();
728 DeleteRSCFolderOnDrive(EDriveE);
729 User::After(KOneSecond * 3);
731 //3.4 before remounting: has no plugin
732 // after remounting: has no plugin
733 INFO_PRINTF1(_L("3.4 Before Remount: has no plugins; After Remount: has no plugins"));
734 // Clean up time records on server.
735 TRAP(err, timeRecords.ResetRecordsOnServerL());
738 TEST(fs.RemountDrive(EDriveE)==KErrNone);
739 User::After(KOneSecond * 3);
741 // Now get all time records from server.
742 TRAP(err, timeRecords.OpenL());
744 TEST(timeRecords.Count() > 0);
746 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererNotifierRunL, timeResults));
748 // Test notifications were triggered and check performance of RunL of Notifiers
749 TEST(CheckTimeResults(NotifierRunLTimeLimit, timeResults));
752 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererNotifierRunL, timeResultsInfos));
754 // Test notifications ONLY triggered for E: drive
755 TEST(timeResultsInfos.Count()==1);
756 TEST(timeResultsInfos[0] == EDriveE);
757 timeResultsInfos.Reset();
759 TRAP(err, timeRecords.RetrieveResultsByTypeL(ECDiscovererTimerRunL, timeResults));
761 // Test Timer RunL ran only once and check performance.
762 TEST(CheckTimeResults(TimerRunLScanZeroRSCOnOneDriveLimit, timeResults));
765 TRAP(err, timeRecords.RetrieveResultsInfoByTypeL(ECDiscovererRediscoveryScanDirectoryL, timeResultsInfos));
767 // Test directory scanning has NOT performed
768 TEST(timeResultsInfos.Count()==0);
769 timeResultsInfos.Reset();
774 DeleteRSCFilesOnDrive(EDriveC);
775 DeleteRSCFolderOnDrive(EDriveX);
776 DeleteRSCFolderOnDrive(EDriveE);
778 MacroNotDefinedError();
779 #endif // __ECOM_SERVER_PERFORMANCE__
781 return TestStepResult();