Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 [ ]
6 [ ] use 'property.inc'
7 [ ]
8 [-] testcase LoadURL () appstate none
9 [ ] // The first few constants are to be changed according to how your machine is setup
10 [ ] // - strPerfToolsDrive is the drive letter corresponding to the script directory
11 [ ] // - strViewerDrive is the drive letter where the Viewer.exe is installed
12 [ ] // - strURLPath is the full path to the file that has the URLs to process
13 [ ] // - strPerfToolsDir is the directory where the perf tools are installed
14 [ ] // (no drive, no trailing '\')
15 [ ] // - strBuildBaseDir is the directory which contains the bin-directory where viewer.exe is installed
16 [ ] // (no drive, no trailing '\') i.e. \Mozilla\dist\Win32_o.obj for a build-tree
17 [ ] // - strMilestoneOrPull is the milestone or date of source pull if not a milestone
18 [ ] // (this is the text put into the header of the HTML table: i.e. 'Milestone M13' or 'Pulled: 1/31/00')
19 [ ] // - numSlashes is the number of '/' characters in the URL up to the site name
20 [ ] // (should not change unless you move the WebSites folder)
21 [ ] //
22 [ ] STRING strPerfToolsDrive = "s:"
23 [ ] STRING strViewerDrive = "d:"
24 [ ] STRING strURLPath = "s:\Mozilla\Tools\performance\layout\40-url.txt"
25 [ ] STRING strPerfToolsDir = "\Mozilla\Tools\Performance\layout"
26 [ ] STRING strBuildBaseDir = "\Moz-0225"
27 [ ] STRING strMilestoneOrPull = "Daily:022500 "
28 [ ] INTEGER numSlashes = 10
29 [ ] INTEGER sleepBetweenSites = 5
30 [ ]
31 [ ] STRING strViewerDir = strBuildBaseDir + "\bin"
32 [ ] HFILE inputFile
33 [ ] STRING sLine
34 [ ] STRING quotedURL
35 [ ] STRING logFile = ""
36 [ ] STRING site
37 [ ] INTEGER NumOfSites = 0
38 [ ] STRING strPerfToolsDriveCmd = strPerfToolsDrive + " <ENTER>"
39 [ ] STRING strViewerDriveCmd = strViewerDrive + " <ENTER>"
40 [ ] STRING strBuildIDBase = strViewerDrive + strBuildBaseDir
41 [ ] STRING strLogPath = strPerfToolsDrive + strPerfToolsDir + "\logs"
42 [ ]
43 [ ] // make the logs directory (in case it does note exist already)
44 [+] if ( !SYS_DirExists( strLogPath ) )
45 [ ] SYS_MakeDir( strLogPath )
46 [ ] // remove any ABORT.TXT file that may be around
47 [+] if ( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) )
48 [ ] SYS_RemoveFile( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" )
49 [ ] // Copy the history file in case there are problems
50 [-] if( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\history.txt" ) )
51 [ ] SYS_CopyFile( strPerfToolsDrive + strPerfToolsDir + "\History.txt", strPerfToolsDrive + strPerfToolsDir + "\History_prev.txt" )
52 [ ] //
53 [ ] // Start processing
54 [ ] //
55 [ ] inputFile = FileOpen (strURLPath, FM_READ)
56 [ ] CommandPrompt.Invoke ()
57 [ ] sleep (2)
58 [ ] // move to the PerfTools directory
59 [ ] CommandPrompt.TypeKeys (strPerfToolsDriveCmd)
60 [ ] CommandPrompt.TypeKeys ("cd " + strPerfToolsDir + " <Enter>")
61 [ ] // process the page-header
62 [ ] CommandPrompt.TypeKeys ("perl " + strPerfToolsDrive + strPerfToolsDir +"\Header.pl {strBuildIDBase} {strMilestoneOrPull} <Enter>")
63 [ ] sleep (1)
64 [ ] // go through each URI and process it
65 [-] while (FileReadLine (inputFile, sLine))
66 [ ] CommandPrompt.SetActive ()
67 [ ] site = GetField (sLine, '/', numSlashes)
68 [ ] logFile = site + "-log.txt"
69 [ ] logFile = strLogPath + "\" + logFile
70 [ ] CommandPrompt.TypeKeys (strViewerDrive + strViewerDir + "\viewer > {logFile}<Enter>")
71 [ ] sleep (5)
72 [ ] Raptor.SetActive ()
73 [ ] Raptor.TextField1.SetText (sLine)
74 [ ] Raptor.TextField1.TypeKeys ("<Enter>")
75 [ ] sleep (sleepBetweenSites)
76 [-] if Raptor.Exists ()
77 [ ] Raptor.SetActive ()
78 [ ] Raptor.Close ()
79 [+] if RaptorSecondWindow.Exists ()
80 [ ] RaptorSecondWindow.SetActive ()
81 [ ] RaptorSecondWindow.Close ()
82 [ ] CommandPrompt.SetActive ()
83 [ ] CommandPrompt.TypeKeys( "<Ctrl-C><Enter>" )
84 [ ] NumOfSites = NumOfSites + 1
85 [ ] quotedURL = """" + sLine + """"
86 [ ] CommandPrompt.TypeKeys ("perl "+ strPerfToolsDrive + strPerfToolsDir + "\AverageTable2.pl {site} {logFile} {NumOfSites} {strBuildIDBase} {quotedURL} <Enter>")
87 [ ] sleep (2)
88 [-] if ( SYS_FileExists( strPerfToolsDrive + strPerfToolsDir + "\abort.txt" ) )
89 [ ] break
90 [ ] CommandPrompt.TypeKeys ("perl "+ strPerfToolsDrive + strPerfToolsDir + "\Footer.pl {strBuildIDBase} {strMilestoneOrPull} <Enter>")
91 [ ] sleep (1)
92 [ ] CommandPrompt.Close()