Bug 458256. Use LoadLibraryW instead of LoadLibrary (patch by DougT). r+sr=vlad
[wine-gecko.git] / tools / tests / LoadUrl.pl
blob29599794cbbdd7b0806a1e3639b30a80fc8b07aa
1 #!/usr/bin/perl
3 $viewer_path = &ParseArgs();
5 if (defined($OSNAME)) {
6 $ostype = "unix";
8 else {
9 $ostype = "win32";
12 #Win32 Autoconfig
14 if ($ostype eq "win32") {
16 $viewer = $viewer_path . "\viewer.exe";
17 print $viewer_path . "\\viewer.exe" . "\n";
18 if (-e $viewer_path . "\\viewer.exe") {
19 system ($viewer_path . '\\viewer.exe -v -d 15 -f url.txt > result.txt');
21 else {
22 die $viewer_path . "viewer doesn't exist! Check your path.\n";
26 #=================================================================
28 #Linux Autoconfig
30 if ($ostype eq "unix") {
32 $viewer = $viewer_path . "/viewer";
33 if (-e $viewer_path . "/viewer") {
34 $ENV{'MOZILLA_HOME'}=$viewer_path;
35 $ENV{'LD_LIBRARY_PATH'}=$viewer_path;
36 system ($viewer_path . '/viewer -v -d 9 -f ./url.txt > result.txt');
38 else {
39 die $viewer_path . "/viewer doesn't exist! Check your path.\n";
42 #=================================================================
44 open (ANALYSIS_FILE, '>analysis.html') || die ("can't open file jim");
45 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time);
46 %weekday= (
47 "1", "$day",
48 '2', 'Tuesday',
49 '3', 'Wednesday',
50 '4', 'Thursday',
51 '5', 'Friday',
52 '6', 'Saturday',
53 '7', 'Sunday',
55 if ($hour > 12)
57 $hour = $hour - 12;
59 $mon += 1;
60 print "Content-type:text/html\n\n";
61 print (ANALYSIS_FILE "<HTML><HEAD><TITLE> Load URl's Analysis File </TITLE></HEAD>\n");
62 print (ANALYSIS_FILE "<BODY>\n");
63 print (ANALYSIS_FILE "<H2><CENTER> Load URL's Analysis File </CENTER></H2>\n");
64 print (ANALYSIS_FILE "<BR>\n");
65 print (ANALYSIS_FILE "<BR>\n");
66 print (ANALYSIS_FILE "<HR>\n");
67 print (ANALYSIS_FILE "<BR>\n");
68 print (ANALYSIS_FILE "<B><CENTER>\n");
69 print (ANALYSIS_FILE "Day Date Year and Time when Program started: ");
70 print (ANALYSIS_FILE "</B></CENTER>\n");
71 print (ANALYSIS_FILE "<BR>\n");
72 print (ANALYSIS_FILE "<B><CENTER>\n");
73 print (ANALYSIS_FILE "$weekday{$wday} $mon/$mday/19$year $hour:$min:$sec");
74 print (ANALYSIS_FILE "</B></CENTER>\n");
75 print (ANALYSIS_FILE "<BR>\n");
76 print (ANALYSIS_FILE "<BR>\n");
77 print (ANALYSIS_FILE "<HR>\n");
79 open (IN_FILE, '<result.txt');
80 open (OUT_FILE, '>loaded.txt');
81 open (URL_FILE, '<Url.txt');
82 open (NOMATCH_FILE, '>notloaded.txt');
84 $ThisLine;
85 @Url_List = (0..24,0..1);
86 $count=0;
87 while (<URL_FILE>)
89 $ThisLine = $_;
90 chomp ($ThisLine);
91 #push (@Url_List, "$ThisLine 0");
92 @Url_List[$count]->[0] = $ThisLine;
93 @Url_List[$count]->[1] = 0;
94 #print "@Url_List[$count]->[0] ";
95 #print "@Url_List[$count]->[1] \n";
96 $count++;
98 while (<IN_FILE>)
100 $ThisLine = $_;
101 if (/done loading/)
103 print (OUT_FILE "$ThisLine");
106 close (OUT_FILE);
108 open (OUT_FILE, '<loaded.txt');
110 $ThisLine = "";
111 $NumItems = @Url_List;
112 $ThisItem;
113 $InList;
114 while (<OUT_FILE>)
116 $ThisLine = $_;
117 for ($i = 0; $i < $NumItems-1; $i += 1)
119 $InList = @Url_List[$i]->[0];
120 if ($ThisLine =~ /$InList/)
122 #print @Url_List[$i]->[0];
123 #print "\n";
124 @Url_List[$i]->[1] = 1;
128 for ($i = 0; $i < $NumItems-1; $i += 1)
130 if (@Url_List[$i]->[1] == 0)
132 print (NOMATCH_FILE "@Url_List[$i]->[0]\n");
135 close (OUT_FILE);
136 close (NOMATCH_FILE);
138 open (OUT_FILE, '<loaded.txt');
139 open (NOMATCH_FILE, '<notloaded.txt');
141 $LoadItems;
142 $NotLoadItems;
144 while (<OUT_FILE>)
146 $LoadItems += 1;
149 while (<NOMATCH_FILE>)
151 $NotLoadItems += 1;
154 close (OUT_FILE);
155 close (NOMATCH_FILE);
157 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time);
158 %weekday= (
159 "1", "$day",
160 '2', 'Tuesday',
161 '3', 'Wednesday',
162 '4', 'Thursday',
163 '5', 'Friday',
164 '6', 'Saturday',
165 '7', 'Sunday',
167 if ($hour > 12)
169 $hour = $hour - 12;
171 $mon += 1;
173 print (ANALYSIS_FILE "<BR>\n");
174 print (ANALYSIS_FILE "<B><CENTER>\n");
175 print (ANALYSIS_FILE "Day Date Year and Time when Program stopped: ");
176 print (ANALYSIS_FILE "</B></CENTER>\n");
177 print (ANALYSIS_FILE "<BR>\n");
178 print (ANALYSIS_FILE "<B><CENTER>\n");
179 print (ANALYSIS_FILE "$weekday{$wday} $mon/$mday/19$year $hour:$min:$sec");
180 print (ANALYSIS_FILE "</B></CENTER>\n");
181 print (ANALYSIS_FILE "<BR>\n");
182 print (ANALYSIS_FILE "<BR>\n");
183 print (ANALYSIS_FILE "<HR>\n");
184 print (ANALYSIS_FILE "<BR>\n");
185 print (ANALYSIS_FILE "<B>\n");
186 print (ANALYSIS_FILE "Number of URL's NOT loaded = ");
187 print (ANALYSIS_FILE "$NotLoadItems\n");
188 print (ANALYSIS_FILE "</B>\n");
189 print (ANALYSIS_FILE "<BR>\n");
190 print (ANALYSIS_FILE "<BR>\n");
192 open (OUT_FILE, '<loaded.txt');
193 open (NOMATCH_FILE, '<notloaded.txt');
195 while (<NOMATCH_FILE>)
197 $ThisLine = $_;
198 print (ANALYSIS_FILE "<A HREF='$ThisLine'>$ThisLine</A>\n");
199 print (ANALYSIS_FILE "<BR>\n");
202 print (ANALYSIS_FILE "<BR>\n");
203 print (ANALYSIS_FILE "<B>\n");
204 print (ANALYSIS_FILE "Number of URL's loaded = ");
205 print (ANALYSIS_FILE "$LoadItems\n");
206 print (ANALYSIS_FILE "</B>\n");
207 print (ANALYSIS_FILE "<BR>\n");
208 print (ANALYSIS_FILE "<BR>\n");
210 while (<OUT_FILE>)
212 $ThisLine = $_;
213 print (ANALYSIS_FILE "$ThisLine\n");
214 print (ANALYSIS_FILE "<BR>\n");
217 print (ANALYSIS_FILE "</BODY>\n");
218 print (ANALYSIS_FILE "</HTML>\n");
220 close (URL_FILE);
221 close (IN_FILE);
222 close (OUT_FILE);
223 close (NOMATCH_FILE);
224 close (ANALYSIS_FILE);
226 sub ParseArgs {
227 my($i);
229 if( (@ARGV == 0) || (@ARGV > 1) ) {
230 &PrintUsage;
232 else {
233 $viewer_path = $ARGV[0];
235 return $viewer_path;
238 sub PrintUsage {
239 die "usage: LoadUrl.pl <directory containing viewer app>";