Changeset 14648 for S60/trunk/S60WebUi
- Timestamp:
- 05/31/06 11:11:08 (3 years ago)
- Location:
- S60/trunk/S60WebUi/WebUi
- Files:
-
- 7 modified
-
data/WebUi.rss (modified) (1 diff)
-
inc/WebUi.hrh (modified) (1 diff)
-
inc/WebUiAutomatedTests.h (modified) (7 diffs)
-
src/WebUiAutomatedTests.cpp (modified) (29 diffs)
-
src/WebUiLoadObserver.cpp (modified) (2 diffs)
-
src/WebUiSettings.cpp (modified) (3 diffs)
-
src/WebUiWindowContainer.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
S60/trunk/S60WebUi/WebUi/data/WebUi.rss
r14549 r14648 146 146 items = 147 147 { 148 MENU_ITEM { command = ECmdRunNext Test; txt = "Run next test"; },149 MENU_ITEM { command = ECmdRunFirst Test; txt = "Run first test"; },150 MENU_ITEM { command = ECmdRun TestByIndex; txt = "Runtest by index"; },151 MENU_ITEM { command = ECmdRunAll Tests; txt = "Run alltests"; },148 MENU_ITEM { command = ECmdRunNextLayoutTest; txt = "Run next layout test"; }, 149 MENU_ITEM { command = ECmdRunFirstLayoutTest; txt = "Run first layout test"; }, 150 MENU_ITEM { command = ECmdRunLayoutTestByIndex; txt = "Run layout test by index"; }, 151 MENU_ITEM { command = ECmdRunAllLayoutTests; txt = "Run all layout tests"; }, 152 152 MENU_ITEM { command = ECmdListAllTests; txt = "List all tests"; } 153 153 }; -
S60/trunk/S60WebUi/WebUi/inc/WebUi.hrh
r14549 r14648 82 82 ECmdCloseAll, 83 83 ECmdRunAllTests, 84 ECmdRunFirstTest, 85 ECmdRunNextTest, 86 ECmdListAllTests, 87 ECmdRunTestByIndex 84 ECmdRunAllLayoutTests, 85 ECmdRunFirstLayoutTest, 86 ECmdRunNextLayoutTest, 87 ECmdRunLayoutTestByIndex, 88 ECmdListAllTests 88 89 }; 89 90 -
S60/trunk/S60WebUi/WebUi/inc/WebUiAutomatedTests.h
r14549 r14648 10 10 * All rights reserved. 11 11 * 12 * Redistribution and use in source and binary forms, with or without13 * modification, are permitted provided that the following conditions14 * are met:12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 15 * 16 16 * * Redistributions of source code must retain the above copyright … … 24 24 * from this software without specific prior written permission. 25 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH37 * DAMAGE.26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 37 * DAMAGE. 38 38 * 39 39 * Please see file patentlicense.txt for further grants. … … 56 56 // the automated tests. 57 57 // Layout test commands 58 _LIT(KRunAllTests, "runalltests"); 58 59 _LIT(KRunAllLayoutTests, "runalllayouttests"); 59 60 _LIT(KRunFirstLayoutTest, "runfirstlayouttest"); … … 114 115 CWebUiAutomatedTests( CBrCtlInterface* aEngine ); 115 116 116 /**117 /** 117 118 * ConstructL 118 119 * EPOC default constructor. … … 131 132 * @return TInt 132 133 */ 133 TInt DoAutomatedTestsActionL( TDesC& aActionString );134 TInt DoAutomatedTestsActionL( const TDesC& aActionString ); 134 135 135 136 /** … … 192 193 193 194 private: // new methods 195 196 /** 197 * RunAllTestsL 198 * @since 3.1 199 * @param none 200 * @return TInt 201 */ 202 TInt RunAllTestsL(); 203 194 204 /** 195 205 * RunAllLayoutTestsL … … 257 267 TInt LoadTestUrlsL( const TDesC& aDirectory, 258 268 const TDesC& aExtension ); 269 270 /** 271 * PrepPerformanceResultsFileL 272 * @since 3.1 273 * @return void 274 */ 275 void PrepPerformanceResultsFileL(); 259 276 260 277 /** -
S60/trunk/S60WebUi/WebUi/src/WebUiAutomatedTests.cpp
r14549 r14648 10 10 * All rights reserved. 11 11 * 12 * Redistribution and use in source and binary forms, with or without13 * modification, are permitted provided that the following conditions14 * are met:12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 15 * 16 16 * * Redistributions of source code must retain the above copyright … … 24 24 * from this software without specific prior written permission. 25 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH37 * DAMAGE.26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 37 * DAMAGE. 38 38 * 39 39 * Please see file patentlicense.txt for further grants. … … 76 76 77 77 // These strings are used to create the html test result files (ie Content) 78 _LIT8(KPagesLoadedContent, "<html>\r\n<head>\r\n<title> Automated Test Results</title>\r\n</head>\r\n<body bgcolor=\"lightgreen\">\r\n");79 _LIT8(KLayoutResultsContent, "<html>\r\n<head>\r\n<title>Layout Test Results</title>\r\n</head>\r\n<body >\r\n");80 _LIT8(KPerfResultContent, "<html>\r\n<head>\r\n<title>Performance Test Results</title>\r\n</head>\r\n<body >\r\n");81 _LIT8(KTestPageListContent, "<html>\r\n<head>\r\n<title> AutomatedTest Page List</title>\r\n</head>\r\n<body bgcolor=\"cyan\">\r\n");78 _LIT8(KPagesLoadedContent, "<html>\r\n<head>\r\n<title>Test Page Loaded</title>\r\n</head>\r\n<body bgcolor=\"lightgreen\">\r\n"); 79 _LIT8(KLayoutResultsContent, "<html>\r\n<head>\r\n<title>Layout Test Results</title>\r\n</head>\r\n<body bgcolor=\"red\">\r\n"); 80 _LIT8(KPerfResultContent, "<html>\r\n<head>\r\n<title>Performance Test Results</title>\r\n</head>\r\n<body bgcolor=\"pink\">\r\n"); 81 _LIT8(KTestPageListContent, "<html>\r\n<head>\r\n<title>Test Page List</title>\r\n</head>\r\n<body bgcolor=\"cyan\">\r\n"); 82 82 _LIT8(KBR, "<br>\r\n"); 83 83 _LIT8(KNBSP, " "); 84 _LIT8(KFileName, "<hr>\r\nFile: "); 85 _LIT8(KLayoutCompleteTime, "Layout complete time: "); 86 _LIT8(KDocumentCompleteTime, "Document complete time: "); 84 _LIT8(KLayoutCompleteTime, "Layout complete time"); 85 _LIT8(KDocumentCompleteTime, "Document complete time"); 87 86 _LIT8(KMicroSecs, " microsecs"); 88 87 _LIT8(KTableStart, "\r\n<table border=\"1\"><tr><th>Index</th><th>Path and Filename</th></tr>"); 89 88 _LIT8(KIndexTDEntry, "\r\n<tr><td> "); 89 _LIT8(KIndexCenterTDEntry, "\r\n<tr><td align=\"center\"> "); 90 90 _LIT8(KFileTDEntry, " </td><td> "); 91 _LIT8(KEndTDEntry, " </td>< tr>\r\n");92 _LIT8(KTableEnding, " </table>\r\n");91 _LIT8(KEndTDEntry, " </td></tr>"); 92 _LIT8(KTableEnding, "\r\n</table>\r\n"); 93 93 _LIT8(KCurrentPageLoading, "<br>\r\nCurrent page loading<br>"); 94 94 _LIT8(KTotalNumPages, "<b>Total number of test pages:</b> "); … … 145 145 RFs rfs; 146 146 TInt err = rfs.Connect(); 147 if ( !err)147 if ( err == KErrNone ) 148 148 { 149 149 rfs.MkDirAll( KTestingResultsDir ); … … 180 180 // --------------------------------------------------------- 181 181 // 182 TInt CWebUiAutomatedTests::DoAutomatedTestsActionL( TDesC& aActionString )182 TInt CWebUiAutomatedTests::DoAutomatedTestsActionL( const TDesC& aActionString ) 183 183 { 184 184 TInt err( KErrNotFound ); 185 185 186 if ( aActionString.Find( KRunAllTests ) != KErrNotFound ) 187 { 188 // This will run all of the tests from beginning until completed 189 err = RunAllTestsL(); 190 } 186 191 if ( aActionString.Find( KRunAllLayoutTests ) != KErrNotFound ) 187 192 { 188 // This will run all of the tests from beginning until completed193 // This will run all of the layout tests from beginning until completed 189 194 err = RunAllLayoutTestsL(); 190 195 } 191 196 else if ( aActionString.Find( KRunFirstLayoutTest ) != KErrNotFound ) 192 197 { 193 // This will run the first test case, iPageIndex = 0198 // This will run the first layout test case, iPageIndex = 0 194 199 err = RunFirstLayoutTestL(); 195 200 } 196 201 else if ( aActionString.Find( KRunNextLayoutTest ) != KErrNotFound ) 197 202 { 198 // This will run the next test case, using current iPageIndex203 // This will run the next layout test case, using current iPageIndex 199 204 err = RunNextLayoutTestL(); 200 205 } … … 207 212 else if ( aActionString.Find( KRunLayoutTestByIndex ) != KErrNotFound ) 208 213 { 214 // This will run the layout test case, using a specified iPageIndex 209 215 err = RunLayoutTestByIndexL(); 210 216 } 211 217 else if ( aActionString.Find( KRunPerformanceTests ) != KErrNotFound ) 212 218 { 219 // This will run the next layout test case, using current iPageIndex 213 220 err = RunAllPerformanceTestsL(); 214 221 } … … 218 225 219 226 // --------------------------------------------------------- 220 // CWebUiAutomatedTests::RunLayoutTestsL 227 // CWebUiAutomatedTests::RunAllTestsL 228 // Run all of the test cases until complete. This loads all 229 // of the test cases urls into iUrlArray. This method will run 230 // both the layout render tree and performance tests. It is currently 231 // called by the launcher (ATF script). 232 // --------------------------------------------------------- 233 // 234 TInt CWebUiAutomatedTests::RunAllTestsL() 235 { 236 TInt err( KErrNone ); 237 238 // If we haven't already, get the test pages url 239 if ( iUrlArray->Count() == 0 ) 240 { 241 err = LoadTestUrlsL( KLayoutTestsDir(), KHtmlTestFiles() ); 242 } 243 244 // If we found layout test pages, start loading 245 if ( err == KErrNone && iUrlArray->Count() ) 246 { 247 // If we found test pages, prep the performance results file. 248 PrepPerformanceResultsFileL(); 249 250 // Set Layout test mode, ie run layout tests 251 iLayoutTestMode = ETrue; 252 // Set Performance test mode, ie run performance tests 253 iPerformanceTestMode = ETrue; 254 // Set run all tests, ie run all test cases until complete 255 iRunAllTests = ETrue; 256 // Set the test page index to run the first page 257 iPageIndex = 0; 258 259 LoadTestPageL(); 260 } 261 262 return err; 263 } 264 265 // --------------------------------------------------------- 266 // CWebUiAutomatedTests::RunAllLayoutTestsL 221 267 // Run all of the layout test cases until complete. This loads all 222 268 // of the test cases urls into iUrlArray. … … 234 280 235 281 // If we found layout test pages, start loading 236 if ( !err && iUrlArray->Count() ) 237 { 282 if ( err == KErrNone && iUrlArray->Count() ) 283 { 284 // Set our testing mode 238 285 iLayoutTestMode = ETrue; 239 286 iRunAllTests = ETrue; 287 288 // Set our testing page index 289 iPageIndex = 0; 240 290 LoadTestPageL(); 241 291 } … … 261 311 262 312 // If we found layout test pages, start loading 263 if ( !err && iUrlArray->Count() ) 264 { 313 if ( err == KErrNone && iUrlArray->Count() ) 314 { 315 // Set our testing mode 265 316 iLayoutTestMode = ETrue; 266 317 iRunAllTests = EFalse; 318 319 // Set our testing page index 267 320 iPageIndex = 0; 268 321 LoadTestPageL(); … … 286 339 { 287 340 err = LoadTestUrlsL( KLayoutTestsDir(), KHtmlTestFiles() ); 341 // We are doing this for the first time, the increment below will 342 // make iPageIndex=0 (first test case) 343 iPageIndex = -1; 288 344 } 289 345 290 346 // If we found layout test pages, start loading 291 if ( !err && iUrlArray->Count() ) 292 { 347 if ( err == KErrNone && iUrlArray->Count() ) 348 { 349 // Set our testing mode 293 350 iLayoutTestMode = ETrue; 294 351 iRunAllTests = EFalse; 352 353 // Set our next testing page index 354 ++iPageIndex; 295 355 LoadTestPageL(); 296 356 } … … 317 377 318 378 // If we found layout test pages, start loading test page using index 319 if ( !err&& iUrlArray->Count() )379 if ( err == KErrNone && iUrlArray->Count() ) 320 380 { 321 381 // Get the index of the test page we want to load … … 345 405 } 346 406 347 // We have a valid index, so use it 348 iPageIndex = pageIndex; 407 // Set our testing mode 349 408 iLayoutTestMode = ETrue; 350 409 iRunAllTests = EFalse; 410 411 // We have a valid testing page index, use it 412 iPageIndex = pageIndex; 351 413 LoadTestPageL(); 352 414 } … … 365 427 // developer can go to thier developement machine file system and review 366 428 // the delta's introduced and make any code changes necessary to correct 367 // the layout (render tree). 429 // the layout (render tree). See ATF script. 368 430 369 431 return KErrNone; … … 385 447 } 386 448 387 // If we found test pages, prep the results file and start loading 388 if ( !err && iUrlArray->Count() ) 389 { 390 // Get the total number of test pages 391 HBufC8* numTestsRun = HBufC8::NewLC( KMaxBufferSize ); 392 ++cleanupCount; 393 numTestsRun->Des().AppendNum( iUrlArray->Count() ); 394 395 // Add the number of test line 396 TInt numTestsLen( KTotalNumPages().Length() + numTestsRun->Des().Length() + 397 KBR().Length() + KHtmlEnding().Length() ); 398 TInt htmlLen( KPerfResultContent().Length() + numTestsLen ); 399 400 // Don't put this pointer on cleanup stack 401 delete iHtmlFileBuffer; 402 iHtmlFileBuffer = NULL; 403 iHtmlFileBuffer = HBufC8::NewL( htmlLen ); 404 405 // Prepare the beginning of performance results buffer (html page) 406 TPtr8 perfResultsPtr( iHtmlFileBuffer->Des() ); 407 perfResultsPtr.Copy( KPerfResultContent() ); 408 perfResultsPtr.Append( KTotalNumPages() ); 409 perfResultsPtr.Append( *numTestsRun ); 410 perfResultsPtr.Append( KBR() ); 411 perfResultsPtr.Append( KHtmlEnding() ); 412 449 // If we found test pages, prep the performance results file 450 // and start loading 451 if ( err == KErrNone && iUrlArray->Count() ) 452 { 453 // If we found test pages, prep the performance results file. 454 PrepPerformanceResultsFileL(); 455 456 // Set our test mode 413 457 iPerformanceTestMode = ETrue; 414 458 iRunAllTests = ETrue; 459 415 460 LoadTestPageL(); 416 461 } … … 460 505 CDir* currentDirEntries = NULL; 461 506 462 do463 {507 do 508 { 464 509 delete currentDirEntries; 465 510 dirScan->NextL( currentDirEntries ); … … 495 540 } 496 541 } 497 } while ( currentDirEntries );542 } while ( currentDirEntries ); 498 543 499 544 // Clean up our memory … … 510 555 511 556 // --------------------------------------------------------- 557 // CWebUiAutomatedTests::PrepPerformanceResultsFileL 558 // Prepare the initial content for the performance results file. 559 // --------------------------------------------------------- 560 // 561 void CWebUiAutomatedTests::PrepPerformanceResultsFileL() 562 { 563 // Get the total number of test pages. 564 HBufC8* numTestsRun = HBufC8::NewLC( KMaxBufferSize ); 565 numTestsRun->Des().AppendNum( iUrlArray->Count() ); 566 567 // Add the number of test line 568 TInt htmlLen( KPerfResultContent().Length() + KTotalNumPages().Length() + 569 numTestsRun->Length() + KBR().Length() + 570 KTableStart().Length() ); 571 572 // Don't put this pointer on cleanup stack 573 delete iHtmlFileBuffer; 574 iHtmlFileBuffer = NULL; 575 iHtmlFileBuffer = HBufC8::NewL( htmlLen ); 576 577 // Prepare the beginning of performance results buffer (html page) 578 TPtr8 perfResultsPtr( iHtmlFileBuffer->Des() ); 579 perfResultsPtr.Copy( KPerfResultContent() ); 580 perfResultsPtr.Append( KTotalNumPages() ); 581 perfResultsPtr.Append( *numTestsRun ); 582 perfResultsPtr.Append( KBR() ); 583 perfResultsPtr.Append( KTableStart() ); 584 585 // Clean up memory 586 CleanupStack::PopAndDestroy( 1 ); // numTestsRun 587 } 588 589 // --------------------------------------------------------- 512 590 // CWebUiAutomatedTests::DumpLayoutResults 513 591 // --------------------------------------------------------- … … 530 608 TPerformanceTimes& aPerformance ) 531 609 { 532 if ( !iHtmlFileBuffer ) 533 { 534 // We don't have a performance test results buffer 610 if ( !iHtmlFileBuffer || iPageIndex < 0 || iPageIndex >= iUrlArray->Count() ) 611 { 612 // We don't have a performance test results buffer, or page index 613 // is out of range, i.e. we are at the end of the url array 535 614 return; 536 615 } … … 540 619 TInt cleanupCount( 0 ); 541 620 542 // Get the path and filename of the last url loaded (Convert 16->8bit) 543 TPtr filename( iUrlArray->At( iPageIndex-1 )->Des() ); 544 HBufC8* filename8 = HBufC8::NewLC( filename.Length() ); 545 ++cleanupCount; 546 filename8->Des().Copy( filename ); 547 548 // Get the time to layout document 621 // Create the index and path filename line. 622 // Get the index of current test page running. 623 HBufC8* currentPageIndex = HBufC8::NewLC( KMaxBufferSize ); 624 ++cleanupCount; 625 currentPageIndex->Des().AppendNum( iPageIndex ); 626 627 // Get the path filename of the current test page loading (Convert 16->8bit) 628 TPtr currentFile( iUrlArray->At( iPageIndex )->Des() ); 629 HBufC8* currentFilename8 = HBufC8::NewLC( currentFile.Length() ); 630 ++cleanupCount; 631 currentFilename8->Des().Copy( currentFile ); 632 633 // Remove the file scheme from the current filename 634 TInt parseLen( currentFilename8->Des().Length() - 635 KFileScheme().Length() ); 636 TPtrC8 filename8( currentFilename8->Des().Right( parseLen ) ); 637 638 TInt fileLen( KIndexCenterTDEntry().Length() + 639 currentPageIndex->Des().Length() + KFileTDEntry().Length() + 640 filename8.Length() + KEndTDEntry().Length() ); 641 642 HBufC8* fileEntry = HBufC8::NewLC( fileLen ); 643 ++cleanupCount; 644 TPtr8 fileEntryPtr( fileEntry->Des() ); 645 fileEntryPtr.Copy( KIndexCenterTDEntry() ); 646 fileEntryPtr.Append( *currentPageIndex ); 647 fileEntryPtr.Append( KFileTDEntry() ); 648 fileEntryPtr.Append( filename8 ); 649 fileEntryPtr.Append( KEndTDEntry() ); 650 651 // Create the layout complete time line 549 652 timeDelta = aPerformance.timeLayoutComplete.Int64(); 550 653 HBufC8* layoutTime = HBufC8::NewLC( KMaxBufferSize ); … … 552 655 layoutTime->Des().AppendNum( timeDelta ); 553 656 554 // Get the time to complete document 657 TInt layoutLen( KIndexTDEntry().Length() + KLayoutCompleteTime().Length() + 658 KFileTDEntry().Length() + layoutTime->Des().Length() + 659 KMicroSecs().Length() + KEndTDEntry().Length() ); 660 661 HBufC8* layoutEntry = HBufC8::NewLC( layoutLen ); 662 ++cleanupCount; 663 TPtr8 layoutEntryPtr( layoutEntry->Des() ); 664 layoutEntryPtr.Copy( KIndexTDEntry() ); 665 layoutEntryPtr.Append( KLayoutCompleteTime() ); 666 layoutEntryPtr.Append( KFileTDEntry() ); 667 layoutEntryPtr.Append( *layoutTime ); 668 layoutEntryPtr.Append( KMicroSecs() ); 669 layoutEntryPtr.Append( KEndTDEntry() ); 670 671 // Create the Document complete time line 555 672 timeDelta = aPerformance.timeDocumentComplete.Int64(); 556 673 HBufC8* completeTime = HBufC8::NewLC( KMaxBufferSize ); … … 558 675 completeTime->Des().AppendNum( timeDelta ); 559 676 560 // Add the filename line 561 TInt fileLen( KFileName().Length() + filename8->Des().Length() + 562 KBR().Length() ); 563 564 HBufC8* fileEntry = HBufC8::NewLC( fileLen ); 565 ++cleanupCount; 566 TPtr8 fileEntryPtr( fileEntry->Des() ); 567 fileEntryPtr.Append( KFileName() ); 568 fileEntryPtr.Append( *filename8 ); 569 fileEntryPtr.Append( KBR() ); 570 571 // Add the layout complete time line 572 TInt layoutLen( KLayoutCompleteTime().Length() + 573 layoutTime->Des().Length() + KMicroSecs().Length() + 574 KBR().Length() ); 575 576 HBufC8* layoutEntry = HBufC8::NewLC( layoutLen ); 577 ++cleanupCount; 578 TPtr8 layoutEntryPtr( layoutEntry->Des() ); 579 layoutEntryPtr.Append( KLayoutCompleteTime() ); 580 layoutEntryPtr.Append( *layoutTime ); 581 layoutEntryPtr.Append( KMicroSecs() ); 582 layoutEntryPtr.Append( KBR() ); 583 584 // Add the document complete time line 585 TInt completeLen( KDocumentCompleteTime().Length() + 586 completeTime->Des().Length() + KMicroSecs().Length() + 587 KBR().Length() ); 677 TInt completeLen( KIndexTDEntry().Length() + KDocumentCompleteTime().Length() + 678 KFileTDEntry().Length() + completeTime->Des().Length() + 679 KMicroSecs().Length() + KEndTDEntry().Length() ); 588 680 589 681 HBufC8* completeEntry = HBufC8::NewLC( completeLen ); 590 682 ++cleanupCount; 591 683 TPtr8 completeEntryPtr( completeEntry->Des() ); 684 completeEntryPtr.Copy( KIndexTDEntry() ); 592 685 completeEntryPtr.Append( KDocumentCompleteTime() ); 686 completeEntryPtr.Append( KFileTDEntry() ); 593 687 completeEntryPtr.Append( *completeTime ); 594 688 completeEntryPtr.Append( KMicroSecs() ); 595 completeEntryPtr.Append( K BR() );596 597 // Expand the results buffer to hold the new entr y689 completeEntryPtr.Append( KEndTDEntry() ); 690 691 // Expand the results buffer to hold the new entries 598 692 TInt newLen( iHtmlFileBuffer->Des().Length() + fileLen + 599 693 layoutLen + completeLen ); … … 603 697 HBufC8* tempResult = HBufC8::NewL( newLen ); 604 698 TPtr8 tempResultPtr( tempResult->Des() ); 605 tempResultPtr. Append( iHtmlFileBuffer->Des() );699 tempResultPtr.Copy( iHtmlFileBuffer->Des() ); 606 700 tempResultPtr.Append( *fileEntry ); 607 701 tempResultPtr.Append( *layoutEntry ); … … 656 750 657 751 TInt err = resultFile.Replace( fs, KLayoutResultFile, EFileWrite ); 658 if ( !err)752 if ( err == KErrNone ) 659 753 { 660 754 resultFile.Write( layoutEntry->Des() ); … … <