Permalink
Browse files

Append 1.9 test files

  • Loading branch information...
1 parent c7accdc commit 17469efae1b5c2f5ea38dbcac1484a0ed48cc510 @janodvarko janodvarko committed Apr 12, 2012
Showing 733 changed files with 105,383 additions and 0 deletions.
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>(firebug) Firebug Tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>(firebug) FBTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,159 @@
+<?xml version="1.0" ?>
+
+<!-- In order to build FBTest extension run: $ant build
+ The final xpi file should be located in a release directory -->
+<project name="fbtest" basedir="." default="build">
+
+ <!-- Properties -->
+ <property file="content/fbtest.properties"/>
+
+ <!-- Directories -->
+ <property name="build.dir" value="release"/>
+ <property name="release.dir" value="./release"/>
+ <property name="deploy-xpi.dir" value="${GETFIREBUG}/releases/fbtest/${VERSION}"/>
+ <property name="deploy-jsdoc.dir" value="${GETFIREBUG}/developer/api/fbtest${VERSION}"/>
+
+ <available file="${GETFIREBUG}" property="deploy.dir.available"/>
+
+ <!-- echo -->
+ <target name="echo">
+ <echo message="Build directory: ${build.dir}"/>
+ <echo message="Deploy directory ${GETFIREBUG} available: ${deploy.dir.available}"/>
+ </target>
+
+ <!-- Clean -->
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <!-- Build -->
+ <target name="build" depends="clean">
+
+ <!-- Copy components directory -->
+ <copy todir="${build.dir}/components">
+ <fileset dir="components">
+ <include name="*.js"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy content directory -->
+ <copy todir="${build.dir}/content">
+ <fileset dir="content">
+ <include name="*.js"/>
+ <include name="*.css"/>
+ <include name="*.xml"/>
+ <include name="*.xul"/>
+ <include name="*.html"/>
+ <include name="*.properties"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy defaults directory -->
+ <copy todir="${build.dir}/defaults">
+ <fileset dir="defaults">
+ <include name="**/*.js"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy locale directory -->
+ <copy todir="${build.dir}/locale">
+ <fileset dir="locale">
+ <include name="**/*.properties"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy skin directory -->
+ <copy todir="${build.dir}/skin">
+ <fileset dir="skin">
+ <include name="**/*.css"/>
+ <include name="**/*.png"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy modules directory -->
+ <copy todir="${build.dir}/modules">
+ <fileset dir="modules">
+ <include name="**/*.js"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy extension installation files and licence.txt -->
+ <copy file="chrome.manifest" todir="${build.dir}"/>
+ <copy file="install.rdf" todir="${build.dir}"/>
+ <copy file="license.txt" todir="${build.dir}"/>
+ <copy file="update.rdf" todir="${build.dir}"/>
+
+ <!-- Update release version from fbtest.properties file -->
+ <replace file="${build.dir}/install.rdf" propertyFile="content/fbtest.properties">
+ <replacefilter token="@VERSION@" property="VERSION"/>
+ <replacefilter token="@RELEASE@" property="RELEASE"/>
+ </replace>
+
+ <!-- Create final fbTest.xpi file -->
+ <zip destfile="${build.dir}/fbTest-${VERSION}${RELEASE}.xpi"
+ basedir="${build.dir}" update="true" />
+
+ <!-- Generate update.rdf file -->
+ <replace file="${build.dir}/update.rdf" propertyFile="content/fbtest.properties">
+ <replacefilter token="@VERSION@" property="VERSION"/>
+ <replacefilter token="@RELEASE@" property="RELEASE"/>
+ </replace>
+
+ <!-- Final version message -->
+ <echo message="FBTest version: ${VERSION}${RELEASE}"/>
+
+ <!-- Deploy -->
+ <antcall target="deploy" />
+ </target>
+
+ <!-- Deploy if target available -->
+ <target name="deploy" if="deploy.dir.available">
+
+ <!-- Deploy xpi & update.rdf files -->
+ <copy file="${build.dir}/update.rdf" todir="${deploy-xpi.dir}" overwrite="true"/>
+ <copy file="${build.dir}/fbTest-${VERSION}${RELEASE}.xpi" todir="${deploy-xpi.dir}" overwrite="true"/>
+ <echo message="XPI deployed to: ${VERSION}${RELEASE} to ${deploy-xpi.dir}"/>
+ </target>
+
+ <!-- Deploy if target available -->
+ <target name="deploy-jsdoc" if="deploy.dir.available">
+
+ <!-- Deploy jsdoc -->
+ <copy todir="${deploy-jsdoc.dir}">
+ <fileset dir="${release.dir}/jsdoc"/>
+ </copy>
+
+ <echo message="JSDoc deployed to: ${VERSION}${RELEASE} to ${deploy-xpi.dir}"/>
+ </target>
+
+ <!-- Support for generating docs from source code comments using js-doc-toolkit -->
+ <target name="jsdoc" description="Generate documentation">
+
+ <property name="jsdoc.dir" value="../../../jsdoc/"/>
+ <property name="jsdoc-toolkit.dir" value="${jsdoc.dir}/jsdoc-toolkit-2.3.0/"/>
+ <property name="jsdoc-output.dir" value="${release.dir}/jsdoc/"/>
+
+ <path id="jsdoctoolkit">
+ <!-- Rhino js.jar 1.7.R2 must be used with jsdoctoolkit-ant-task-1.0.1.jar -->
+ <fileset dir="${jsdoc.dir}" includes="*.jar"/>
+ </path>
+
+ <taskdef name="jsdoctoolkit"
+ classpathref="jsdoctoolkit"
+ classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit"/>
+
+ <echo message="Generate doc from FBTest source ($svn/jsdoc/out/)."/>
+
+ <!-- Clean the output direcotory -->
+ <delete dir="${jsdoc-output.dir}"/>
+
+ <!-- Parse all source files -->
+ <jsdoctoolkit jsdochome="${jsdoc-toolkit.dir}"
+ template="firebug"
+ outputdir="${jsdoc-output.dir}"
+ inputdir="." />
+
+ <!-- Deploy -->
+ <antcall target="deploy-jsdoc" />
+ </target>
+</project>
@@ -0,0 +1,25 @@
+content fbtest content/
+skin fbtest classic/1.0 skin/classic/
+locale fbtest en-US locale/en-US/
+
+# Maps resource://fbtest/* to files in modules/*
+resource fbtest modules/
+
+
+overlay chrome://firebug/content/firebugOverlay.xul chrome://fbtest/content/overlayFirebug.xul
+overlay chrome://firebug/content/firefox/browserOverlayWithFrame.xul chrome://fbtest/content/overlayFirebug.xul
+overlay chrome://fbtest/content/testConsole.xul chrome://fbtest/content/haltOnFailedTest.xul
+
+component {F483275E-ECC6-4028-B375-92498C0AD76F} components/commandLine.js
+contract @mozilla.org/commandlinehandler/general-startup;1?type=FBTest {F483275E-ECC6-4028-B375-92498C0AD76F}
+category command-line-handler m-FBTest @mozilla.org/commandlinehandler/general-startup;1?type=FBTest
+
+component {3008FA55-C12F-4992-9930-B9D52F0CF037} components/testHistory.js
+contract @mozilla.org/autocomplete/search;1?name=FBTestHistory {3008FA55-C12F-4992-9930-B9D52F0CF037}
+
+component {B37D6564-77D9-4613-B088-324389E1A8F3} components/testHistory.js
+contract @mozilla.org/autocomplete/search;1?name=FBTestCaseHistory {B37D6564-77D9-4613-B088-324389E1A8F3}
+
+component {3882FC1B-D32A-4722-B935-FA82142808A5} components/testHistory.js
+contract @mozilla.org/autocomplete/search;1?name=FBTestDriverHistory {3882FC1B-D32A-4722-B935-FA82142808A5}
+
@@ -0,0 +1,109 @@
+/* See license.txt for terms of usage */
+
+// ************************************************************************************************
+// Constants
+
+const CLASS_ID = Components.ID("{F483275E-ECC6-4028-B375-92498C0AD76F}");
+const CLASS_NAME = "FBTest Command Line Handler";
+const CONTRACT_ID = "@mozilla.org/commandlinehandler/general-startup;1?type=FBTest";
+const CLD_CATEGORY = "m-FBTest";
+
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cr = Components.results;
+
+const categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
+const appShellService = Cc["@mozilla.org/appshell/appShellService;1"].getService(Ci.nsIAppShellService);
+
+const CMDLINE_FLAG = "runFBTests";
+
+Components.utils["import"]("resource://gre/modules/XPCOMUtils.jsm");
+
+// ************************************************************************************************
+// Command Line Handler
+
+function CommandLineHandler()
+{
+ this.wrappedJSObject = this;
+};
+
+CommandLineHandler.prototype =
+{
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ // XPCOM
+
+ classID: CLASS_ID,
+ classDescription: CLASS_NAME,
+ contractID: CONTRACT_ID,
+
+ QueryInterface: XPCOMUtils.generateQI([
+ Ci.nsISupports,
+ Ci.nsICommandLineHandler
+ ]),
+
+ _xpcom_categories: [{
+ category: "command-line-handler",
+ entry: CLD_CATEGORY,
+ }],
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ // nsICommandLineHandler
+
+ runFBTests: false,
+ testListURI: null,
+
+ handle: function(cmdLine)
+ {
+ window = appShellService.hiddenDOMWindow;
+
+ if (cmdLine.findFlag(CMDLINE_FLAG, false) < 0)
+ return;
+
+ try
+ {
+ // Handle flag with test URI specified. This throws an exception
+ // if the parameter isn't specified.
+ var testListURI = cmdLine.handleFlagWithParam(CMDLINE_FLAG, false);
+ this.startOnStartup(testListURI);
+ }
+ catch (e)
+ {
+ // So, the parameter isn't probably there. Try to handle at least the flag.
+ // The default test list URI will be used.
+ if (cmdLine.handleFlag(CMDLINE_FLAG, false))
+ this.startOnStartup(null);
+ }
+ },
+
+ startOnStartup: function(testListURI)
+ {
+ if (!testListURI)
+ window.dump("FBTest; No test list URI specified.");
+
+ // This info will be used by FBTest overlay as soon as the browser window is loaded.
+ this.runFBTests = true;
+ this.testListURI = testListURI;
+
+ window.dump("FBTest; FBTests will be executed as soon as Firefox is ready.\n");
+ window.dump("FBTest; Test List URI: " + testListURI + "\n");
+ },
+
+ // The text should have embedded newlines which wrap at 76 columns, and should include
+ // a newline at the end. By convention, the right column which contains flag descriptions
+ // begins at the 24th character.
+ // xxxHonza: weird is that if I run Firefox with -help parameter the second column
+ // begins on 33th character.
+ helpInfo: " -" + CMDLINE_FLAG + " <test-list-uri> Automatically run all Firebug tests \n" +
+ " https://getfirebug.com/tests/content/testlists/firebug1.6.html\n",
+};
+
+// ************************************************************************************************
+
+/**
+* XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4).
+* XPCOMUtils.generateNSGetModule is for Mozilla 1.9.2 (Firefox 3.6).
+*/
+if (XPCOMUtils.generateNSGetFactory)
+ var NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
+else
+ var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
Oops, something went wrong.

0 comments on commit 17469ef

Please sign in to comment.