Bug 809097 - Add a testharness.js case to gen_template.pl; r=jhammel
authorMs2ger <ms2ger@gmail.com>
Sun, 02 Dec 2012 09:59:36 +0100
changeset 114717 f4fe16db035ad4f39a1d01222d2f9919dabf1761
parent 114716 0c2ce63dace54c357631238e63c9c9351f8606fe
child 114718 bf0617c52ecc677f0307e51d961b62f2da64cf82
push id23928
push userMs2ger@gmail.com
push dateSun, 02 Dec 2012 09:02:47 +0000
treeherdermozilla-central@0352a32fde64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhammel
bugs809097
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 809097 - Add a testharness.js case to gen_template.pl; r=jhammel
testing/mochitest/gen_template.pl
testing/mochitest/static/th.template.txt
--- a/testing/mochitest/gen_template.pl
+++ b/testing/mochitest/gen_template.pl
@@ -1,31 +1,33 @@
 #!/usr/bin/perl
 #
 #  gen_template.pl
 #  Makes test case templates.
 #  Takes two arguments:
 #
 #  -b : a bugnumber
-#  -type : template type. {html|xhtml|xul}. defaults to html.  
+#  -type : template type. {html|xhtml|xul|th}. defaults to html.
 #
 #  perl gen_template.pl -b 345876 -type xul
 #
 #  sends a test case template for bug 345876 to stdout
 use FindBin;
 use Getopt::Long;
 GetOptions("b=i"=> \$bug_number,
            "type:s"=> \$template_type);
 
 if ($template_type eq "xul") {
   $template_type = "$FindBin::RealBin/static/xul.template.txt";
 } elsif ($template_type eq "xhtml") {
   $template_type = "$FindBin::RealBin/static/xhtml.template.txt";
 } elsif ($template_type eq "chrome") {
   $template_type = "$FindBin::RealBin/static/chrome.template.txt";
+} elsif ($template_type eq "th") {
+  $template_type = "$FindBin::RealBin/static/th.template.txt";
 } else {
   $template_type = "$FindBin::RealBin/static/test.template.txt";
 }
 
 open(IN,$template_type) or die("Failed to open myfile for reading.");
 while((defined(IN)) && ($line = <IN>)) {
         $line =~ s/{BUGNUMBER}/$bug_number/g;
         print STDOUT $line;
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/static/th.template.txt
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test for ...</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+
+}, "Description");
+</script>