OLD | NEW |
1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 # Technically, it's a third party. | 6 # Technically, it's a third party. |
7 # | 7 # |
8 # Copyright 2008, Google Inc. | 8 # Copyright 2008, Google Inc. |
9 # All rights reserved. | 9 # All rights reserved. |
10 # | 10 # |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 my $iframe_index = 0; | 210 my $iframe_index = 0; |
211 foreach $content_type ( @content_type) { | 211 foreach $content_type ( @content_type) { |
212 my $infile = join "", "iframe/", $content_type, ".html"; | 212 my $infile = join "", "iframe/", $content_type, ".html"; |
213 $infile =~ tr/\//_/; | 213 $infile =~ tr/\//_/; |
214 $infile = $target_path.$infile; | 214 $infile = $target_path.$infile; |
215 | 215 |
216 open OUT, "> $infile" or die "Failed to open file $infile"; | 216 open OUT, "> $infile" or die "Failed to open file $infile"; |
217 print OUT "This HTML is used to test HTTP content-type \"$content_type\"". | 217 print OUT "This HTML is used to test HTTP content-type \"$content_type\"". |
218 " by having multiple iframes render different types of content for the". | 218 " by having multiple iframes render different types of content for the". |
219 " same HTTP content-type header.\n"; | 219 " same HTTP content-type header.\n"; |
220 print OUT "<script>\n if(window.layoutTestController)\n " . | 220 print OUT "<script>\n if(window.testRunner)\n " . |
221 "window.layoutTestController.waitUntilDone();\n</script>\n"; | 221 "window.testRunner.waitUntilDone();\n</script>\n"; |
222 print OUT "<html>\n<body>\n<br>Well here are the frames !<br>\n"; | 222 print OUT "<html>\n<body>\n<br>Well here are the frames !<br>\n"; |
223 | 223 |
224 foreach $parameter ( @parameter ) { | 224 foreach $parameter ( @parameter ) { |
225 | 225 |
226 # Make sure to iterate only through the first half of the expected | 226 # Make sure to iterate only through the first half of the expected |
227 # results matrix | 227 # results matrix |
228 if (($iframe_index > 0) && (0 == ($iframe_index % $test_set_size))) { | 228 if (($iframe_index > 0) && (0 == ($iframe_index % $test_set_size))) { |
229 $iframe_index += $test_set_size; | 229 $iframe_index += $test_set_size; |
230 } | 230 } |
231 $current_expected = get_result_description($expected[$iframe_index++]); | 231 $current_expected = get_result_description($expected[$iframe_index++]); |
232 | 232 |
233 $source = join "", $root, "type=", $content_type, "&", $parameter; | 233 $source = join "", $root, "type=", $content_type, "&", $parameter; |
234 $query_description = get_query_description($parameter); | 234 $query_description = get_query_description($parameter); |
235 print OUT "<br><br>This frame tests loading of a $query_description when the
". | 235 print OUT "<br><br>This frame tests loading of a $query_description when the
". |
236 "HTTP content-type is set to \"$content_type\" .<br> Expected : This ", | 236 "HTTP content-type is set to \"$content_type\" .<br> Expected : This ", |
237 "iframe should have $current_expected .<br>\n<iframe src=\"$source\" ". | 237 "iframe should have $current_expected .<br>\n<iframe src=\"$source\" ". |
238 "height=\"300\" width=\"500\"></iframe>\n\n"; | 238 "height=\"300\" width=\"500\"></iframe>\n\n"; |
239 } | 239 } |
240 | 240 |
241 print OUT "</body>\n</html>\n"; | 241 print OUT "</body>\n</html>\n"; |
242 print OUT "<script>\n if(window.layoutTestController)\n ". | 242 print OUT "<script>\n if(window.testRunner)\n ". |
243 "layoutTestController.notifyDone();\n</script>"; | 243 "testRunner.notifyDone();\n</script>"; |
244 close OUT; | 244 close OUT; |
245 } | 245 } |
246 | 246 |
247 # This loop generates one HTML for every combination of content-type and | 247 # This loop generates one HTML for every combination of content-type and |
248 # parameter. | 248 # parameter. |
249 my $main_index = 0; | 249 my $main_index = 0; |
250 foreach $content_type ( @content_type) { | 250 foreach $content_type ( @content_type) { |
251 $count = 0; | 251 $count = 0; |
252 foreach $parameter ( @parameter ) { | 252 foreach $parameter ( @parameter ) { |
253 $count++; | 253 $count++; |
(...skipping 13 matching lines...) Expand all Loading... |
267 $query_description = get_query_description($parameter); | 267 $query_description = get_query_description($parameter); |
268 | 268 |
269 open OUT, "> $infile" or die "Failed to open file $infile"; | 269 open OUT, "> $infile" or die "Failed to open file $infile"; |
270 print OUT "This tests loading of a $query_description when the HTTP content-
type". | 270 print OUT "This tests loading of a $query_description when the HTTP content-
type". |
271 " is set to \"$content_type\" .\n Expected : This page should have ". | 271 " is set to \"$content_type\" .\n Expected : This page should have ". |
272 "$current_expected .\n\n"; | 272 "$current_expected .\n\n"; |
273 print OUT "<script>\n window.location=\"$source\";\n</script>\n"; | 273 print OUT "<script>\n window.location=\"$source\";\n</script>\n"; |
274 close OUT; | 274 close OUT; |
275 } | 275 } |
276 } | 276 } |
OLD | NEW |