gecko-dev/testing/mochitest
2012-05-22 08:43:36 +12: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
MochiKit Backout 4997c6f8b24d (bug 616542) for causing locally run mochitest-browser-chrome test runs to fail 2011-11-05 18:35:59 +00: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 Bug 753546 Part 1 - Make nsDocument listen for 'fullscreen-approved' notification rather than 'perm-changed' to signal fullscreen approved. r=smaug 2012-05-22 08:43:36 +12:00
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 85eb1308f976 & 09da30d622c0 (bug 728893) until the test is ready to land 2012-05-15 17:44:18 +01:00
harness.xul Bug 423035: can't run single chrome/a11y test automatically; r=Waldo 2008-03-18 12:57:22 -07:00
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
Makefile.in Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
MockFilePicker.jsm Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01: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 85eb1308f976 & 09da30d622c0 (bug 728893) until the test is ready to land 2012-05-15 17:44:18 +01:00
pywebsocket_wrapper.py Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
README.txt
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 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00

 ----------------
 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>