4 [-] testcase LoadURL () appstate none
5 [ ] // The first few constants are to be changed according to how your machine is setup
6 [ ] // - strPerfToolsDrive is the drive letter corresponding to the script directory
7 [ ] // - strViewerDrive is the drive letter where the Viewer.exe is installed
8 [ ] // - strURLPath is the full path to the file that has the URLs to process
9 [ ] // - strPerfToolsDir is the directory where the perf tools are installed
10 [ ] // (no drive, no trailing '\')
11 [ ] // - strBuildBaseDir is the directory which contains the bin-directory where viewer.exe is installed
12 [ ] // (no drive, no trailing '\') i.e. \Mozilla\dist\Win32_o.obj for a build-tree
13 [ ] // - strMilestoneOrPull is the milestone or date of source pull if not a milestone
14 [ ] // (this is the text put into the header of the HTML table: i.e. 'Milestone M13' or 'Pulled: 1/31/00')
15 [ ] // - numSlashes is the number of '/' characters in the URL up to the site name
16 [ ] // (should not change unless you move the WebSites folder)
18 [ ] STRING strPerfToolsDrive = "s:"
19 [ ] STRING strViewerDrive = "d:"
20 [ ] STRING strURLPath = "s:\Mozilla\Tools\performance\layout\40-url.txt"
21 [ ] STRING strPerfToolsDir = "\Mozilla\Tools\Performance\layout"
22 [ ] STRING strBuildBaseDir = "\Moz-0225"
23 [ ] STRING strMilestoneOrPull = "Daily:022500 "
24 [ ] INTEGER numSlashes = 10
25 [ ] INTEGER sleepBetweenSites = 5
27 [ ] STRING strViewerDir = strBuildBaseDir + "\bin"
31 [ ] STRING logFile = ""
33 [ ] INTEGER NumOfSites = 0
34 [ ] STRING strPerfToolsDriveCmd = strPerfToolsDrive + " <ENTER>"
35 [ ] STRING strViewerDriveCmd = strViewerDrive + " <ENTER>"
36 [ ] STRING strBuildIDBase = strViewerDrive + strBuildBaseDir
37 [ ] STRING strLogPath = strPerfToolsDrive + strPerfToolsDir + "\logs"
39 [ ] // make the logs directory (in case it does note exist already)
40 [+] if ( !SYS_DirExists( strLogPath ) )
41 [ ] SYS_MakeDir( strLogPath )
42 [ ] // remove any ABORT.TXT file that may be around
43 [+] if ( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) )
44 [ ] SYS_RemoveFile( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" )
45 [ ] // Copy the history file in case there are problems
46 [-] if( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\history.txt" ) )
47 [ ] SYS_CopyFile( strPerfToolsDrive + strPerfToolsDir + "\History.txt", strPerfToolsDrive + strPerfToolsDir + "\History_prev.txt" )
49 [ ] // Start processing
51 [ ] inputFile = FileOpen (strURLPath, FM_READ)
52 [ ] CommandPrompt.Invoke ()
54 [ ] // move to the PerfTools directory
55 [ ] CommandPrompt.TypeKeys (strPerfToolsDriveCmd)
56 [ ] CommandPrompt.TypeKeys ("cd " + strPerfToolsDir + " <Enter>")
57 [ ] // process the page-header
58 [ ] CommandPrompt.TypeKeys ("perl " + strPerfToolsDrive + strPerfToolsDir +"\Header.pl {strBuildIDBase} {strMilestoneOrPull} <Enter>")
60 [ ] // go through each URI and process it
61 [-] while (FileReadLine (inputFile, sLine))
62 [ ] CommandPrompt.SetActive ()
63 [ ] site = GetField (sLine, '/', numSlashes)
64 [ ] logFile = site + "-log.txt"
65 [ ] logFile = strLogPath + "\" + logFile
66 [ ] CommandPrompt.TypeKeys (strViewerDrive + strViewerDir + "\viewer > {logFile}<Enter>")
68 [ ] Raptor.SetActive ()
69 [ ] Raptor.TextField1.SetText (sLine)
70 [ ] Raptor.TextField1.TypeKeys ("<Enter>")
71 [ ] sleep (sleepBetweenSites)
72 [-] if Raptor.Exists ()
73 [ ] Raptor.SetActive ()
75 [+] if RaptorSecondWindow.Exists ()
76 [ ] RaptorSecondWindow.SetActive ()
77 [ ] RaptorSecondWindow.Close ()
78 [ ] CommandPrompt.SetActive ()
79 [ ] CommandPrompt.TypeKeys( "<Ctrl-C><Enter>" )
80 [ ] NumOfSites = NumOfSites + 1
81 [ ] quotedURL = """" + sLine + """"
82 [ ] CommandPrompt.TypeKeys ("perl "+ strPerfToolsDrive + strPerfToolsDir + "\AverageTable2.pl {site} {logFile} {NumOfSites} {strBuildIDBase} {quotedURL} <Enter>")
84 [-] if ( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) )
86 [ ] CommandPrompt.TypeKeys ("perl "+ strPerfToolsDrive + strPerfToolsDir + "\Footer.pl {strBuildIDBase} {strMilestoneOrPull} <Enter>")
88 [ ] CommandPrompt.Close()