gecko-dev/testing/mochitest
Gregory Szorc 25e74247ed Bug 757397 - Make test package generation quieter; r=ted
This may reduce the size of the buildbot build logs by up to half!

--HG--
extra : rebase_source : 87b3f2f40654d69ecd91e19520e2341fc8aac9a6
2012-05-23 16:51:21 +02:00
..
MochiKit Backout 4997c6f8b24d (bug 616542) for causing locally run mochitest-browser-chrome test runs to fail 2011-11-05 18:35:59 +00:00
chrome Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
dynamic Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
pywebsocket bug 752776. Mozilla tweaks to pywebsocket v631. r=mcmanus 2012-05-16 17:04:46 -07:00
roboextender Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
specialpowers Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
ssltunnel Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
static Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
tests Backout cfac7b6a1f9c (bug 728893) for mochitest-1 orange 2012-05-23 11:56:03 +01:00
Makefile.in Bug 757397 - Make test package generation quieter; r=ted 2012-05-23 16:51:21 +02:00
MockFilePicker.jsm Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
README.txt
android.json Bug 694741 - Move Android mochitest test-paths into the source tree. r=ctalbert 2011-10-17 16:58:57 -04:00
browser-harness.xul Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
browser-test-overlay.xul Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
browser-test.js Bug 734172 followup - add gBrowser check for sanity 2012-05-17 16:45:40 +02:00
chrome-harness.js Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
gen_template.pl Adding bug 535806 test. r=dbaron 2010-01-13 11:37:54 -05:00
harness-overlay.xul Backout cfac7b6a1f9c (bug 728893) for mochitest-1 orange 2012-05-23 11:56:03 +01:00
harness.xul
install.rdf Merging to tip. a=blocking-b7 2010-09-30 17:10:19 -07:00
jar.mn Back out changeset 453772872eeb (bug 668710) for bustage 2011-11-20 01:10:40 +13:00
mozprefs.js Bug 437361. Propagate exceptions from showModalDialog's guts to script as needed instead of dropping them on the floor. r+sr=bzbarsky 2008-07-28 22:52:53 -07:00
plain-loop.html Backout cfac7b6a1f9c (bug 728893) for mochitest-1 orange 2012-05-23 11:56:03 +01:00
pywebsocket_wrapper.py Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
redirect.html Bug 733269. (Av1) redirect.html: Let its load complete before redirecting. rs=jwalden. 2012-03-30 12:27:50 +02:00
runtests.py Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
runtestsb2g.py Bug 749011 - Add support for running mochitest-plain on B2G, r=jmaher 2012-04-27 11:44:59 -07:00
runtestsremote.py Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
runtestsvmware.py Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
server.js Backout cfac7b6a1f9c (bug 728893) for mochitest-1 orange 2012-05-23 11:56:03 +01:00

README.txt

 ----------------
 mochitest README
 ----------------

Steps to get started:

 1.) Run the runtests.pl script to start the server.
 
     Currently, the test script automatically determines the location
     of *Firefox*.

 2.) gen_template.pl will generate test templates for HTML, XUL, and XHTML.
     Read the comment at the top of the file for usage instructions.

 3.) Write a test.


Example test:

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=345656
-->
<head>
  <title>Test for Bug 345656</title>
  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

/** Test for Bug 345656 **/
//
//add information to show on the test page
//
$("display").innerHTML = "doing stuff...";

//
// The '$' is function is shorthand for getElementById. This is the same thing:
//
document.getElementById("display").innerHTML = "doing stuff...";

//
// you can add content that you don't want to clutter 
// the display to the content div.
//
// You can write directly, or you can use MochiKit functions
// to do it in JS like this:
//
appendChildNodes($("content"),
                 DIV({class: "qux"},
                     SPAN({id: "span42"}, "content"))
                 );

//
// the ok() function is like assert
//
ok(true, "checking to see if true is true);

//
// this will fail
//
ok(1==2, "1 equals 2?");


//
// this will be marked as a todo.
// When we fix 1 so it equals 2, we'll need to change this 
// function to ok() or is().
//
todo(1==2, "1 equals 2?");

//
// is() takes two args
//
myVar = "foo";
is(myVar, "foo", "checking to see if myVar is 'foo'");

//
// Tests can run in event handlers.
// Call this to tell SimpleTest to wait for SimpleTest.finish() 
//
SimpleTest.waitForExplicitFinish();

//
// event handler:
//
function event_fired(ev) {
  is(ev.newValue, "width: auto;", "DOMAttrModified event reports correct newValue");
  SimpleTest.finish(); // trigger the end of our test sequence
}

//
// Hook up the event. Mochikit.Signal has many conveniences for this, if you want.
//
$("content").addEventListener("DOMAttrModified", event_fired, false);

//
// Fire the event.
//
$("content").style.width = "auto";

</script>
</pre>
</body>
</html>