Bug 1839316: part 5) Guard the "fetchpriority" attribute behind a pref. r=kershaw...
[gecko.git] / docshell / test / chrome / gen_template.pl
blob109d6161cd7d12c29f5c4036f909e50ff0f3222c
1 #!/usr/bin/perl
3 # This script makes docshell test case templates. It takes one argument:
5 # -b: a bugnumber
7 # For example, this command:
9 # perl gen_template.pl -b 303267
11 # Writes test case template files test_bug303267.xhtml and bug303267_window.xhtml
12 # to the current directory.
14 use FindBin;
15 use Getopt::Long;
16 GetOptions("b=i"=> \$bug_number);
18 $template = "$FindBin::RealBin/test.template.txt";
20 open(IN,$template) or die("Failed to open input file for reading.");
21 open(OUT, ">>test_bug" . $bug_number . ".xhtml") or die("Failed to open output file for appending.");
22 while((defined(IN)) && ($line = <IN>)) {
23 $line =~ s/{BUGNUMBER}/$bug_number/g;
24 print OUT $line;
26 close(IN);
27 close(OUT);
29 $template = "$FindBin::RealBin/window.template.txt";
31 open(IN,$template) or die("Failed to open input file for reading.");
32 open(OUT, ">>bug" . $bug_number . "_window.xhtml") or die("Failed to open output file for appending.");
33 while((defined(IN)) && ($line = <IN>)) {
34 $line =~ s/{BUGNUMBER}/$bug_number/g;
35 print OUT $line;
37 close(IN);
38 close(OUT);