1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tools/performance/layout/property.t Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,92 @@ 1.4 +# This Source Code Form is subject to the terms of the Mozilla Public 1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +[ ] 1.9 +[ ] use 'property.inc' 1.10 +[ ] 1.11 +[-] testcase LoadURL () appstate none 1.12 + [ ] // The first few constants are to be changed according to how your machine is setup 1.13 + [ ] // - strPerfToolsDrive is the drive letter corresponding to the script directory 1.14 + [ ] // - strViewerDrive is the drive letter where the Viewer.exe is installed 1.15 + [ ] // - strURLPath is the full path to the file that has the URLs to process 1.16 + [ ] // - strPerfToolsDir is the directory where the perf tools are installed 1.17 + [ ] // (no drive, no trailing '\') 1.18 + [ ] // - strBuildBaseDir is the directory which contains the bin-directory where viewer.exe is installed 1.19 + [ ] // (no drive, no trailing '\') i.e. \Mozilla\dist\Win32_o.obj for a build-tree 1.20 + [ ] // - strMilestoneOrPull is the milestone or date of source pull if not a milestone 1.21 + [ ] // (this is the text put into the header of the HTML table: i.e. 'Milestone M13' or 'Pulled: 1/31/00') 1.22 + [ ] // - numSlashes is the number of '/' characters in the URL up to the site name 1.23 + [ ] // (should not change unless you move the WebSites folder) 1.24 + [ ] // 1.25 + [ ] STRING strPerfToolsDrive = "s:" 1.26 + [ ] STRING strViewerDrive = "d:" 1.27 + [ ] STRING strURLPath = "s:\Mozilla\Tools\performance\layout\40-url.txt" 1.28 + [ ] STRING strPerfToolsDir = "\Mozilla\Tools\Performance\layout" 1.29 + [ ] STRING strBuildBaseDir = "\Moz-0225" 1.30 + [ ] STRING strMilestoneOrPull = "Daily:022500 " 1.31 + [ ] INTEGER numSlashes = 10 1.32 + [ ] INTEGER sleepBetweenSites = 5 1.33 + [ ] 1.34 + [ ] STRING strViewerDir = strBuildBaseDir + "\bin" 1.35 + [ ] HFILE inputFile 1.36 + [ ] STRING sLine 1.37 + [ ] STRING quotedURL 1.38 + [ ] STRING logFile = "" 1.39 + [ ] STRING site 1.40 + [ ] INTEGER NumOfSites = 0 1.41 + [ ] STRING strPerfToolsDriveCmd = strPerfToolsDrive + " <ENTER>" 1.42 + [ ] STRING strViewerDriveCmd = strViewerDrive + " <ENTER>" 1.43 + [ ] STRING strBuildIDBase = strViewerDrive + strBuildBaseDir 1.44 + [ ] STRING strLogPath = strPerfToolsDrive + strPerfToolsDir + "\logs" 1.45 + [ ] 1.46 + [ ] // make the logs directory (in case it does note exist already) 1.47 + [+] if ( !SYS_DirExists( strLogPath ) ) 1.48 + [ ] SYS_MakeDir( strLogPath ) 1.49 + [ ] // remove any ABORT.TXT file that may be around 1.50 + [+] if ( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) ) 1.51 + [ ] SYS_RemoveFile( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) 1.52 + [ ] // Copy the history file in case there are problems 1.53 + [-] if( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\history.txt" ) ) 1.54 + [ ] SYS_CopyFile( strPerfToolsDrive + strPerfToolsDir + "\History.txt", strPerfToolsDrive + strPerfToolsDir + "\History_prev.txt" ) 1.55 + [ ] // 1.56 + [ ] // Start processing 1.57 + [ ] // 1.58 + [ ] inputFile = FileOpen (strURLPath, FM_READ) 1.59 + [ ] CommandPrompt.Invoke () 1.60 + [ ] sleep (2) 1.61 + [ ] // move to the PerfTools directory 1.62 + [ ] CommandPrompt.TypeKeys (strPerfToolsDriveCmd) 1.63 + [ ] CommandPrompt.TypeKeys ("cd " + strPerfToolsDir + " <Enter>") 1.64 + [ ] // process the page-header 1.65 + [ ] CommandPrompt.TypeKeys ("perl " + strPerfToolsDrive + strPerfToolsDir +"\Header.pl {strBuildIDBase} {strMilestoneOrPull} <Enter>") 1.66 + [ ] sleep (1) 1.67 + [ ] // go through each URI and process it 1.68 + [-] while (FileReadLine (inputFile, sLine)) 1.69 + [ ] CommandPrompt.SetActive () 1.70 + [ ] site = GetField (sLine, '/', numSlashes) 1.71 + [ ] logFile = site + "-log.txt" 1.72 + [ ] logFile = strLogPath + "\" + logFile 1.73 + [ ] CommandPrompt.TypeKeys (strViewerDrive + strViewerDir + "\viewer > {logFile}<Enter>") 1.74 + [ ] sleep (5) 1.75 + [ ] Raptor.SetActive () 1.76 + [ ] Raptor.TextField1.SetText (sLine) 1.77 + [ ] Raptor.TextField1.TypeKeys ("<Enter>") 1.78 + [ ] sleep (sleepBetweenSites) 1.79 + [-] if Raptor.Exists () 1.80 + [ ] Raptor.SetActive () 1.81 + [ ] Raptor.Close () 1.82 + [+] if RaptorSecondWindow.Exists () 1.83 + [ ] RaptorSecondWindow.SetActive () 1.84 + [ ] RaptorSecondWindow.Close () 1.85 + [ ] CommandPrompt.SetActive () 1.86 + [ ] CommandPrompt.TypeKeys( "<Ctrl-C><Enter>" ) 1.87 + [ ] NumOfSites = NumOfSites + 1 1.88 + [ ] quotedURL = """" + sLine + """" 1.89 + [ ] CommandPrompt.TypeKeys ("perl "+ strPerfToolsDrive + strPerfToolsDir + "\AverageTable2.pl {site} {logFile} {NumOfSites} {strBuildIDBase} {quotedURL} <Enter>") 1.90 + [ ] sleep (2) 1.91 + [-] if ( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) ) 1.92 + [ ] break 1.93 + [ ] CommandPrompt.TypeKeys ("perl "+ strPerfToolsDrive + strPerfToolsDir + "\Footer.pl {strBuildIDBase} {strMilestoneOrPull} <Enter>") 1.94 + [ ] sleep (1) 1.95 + [ ] CommandPrompt.Close()