gecko-dev/testing/mochitest
2012-07-20 12:59:30 -04: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 Bug 759095 - upgrade license to MPL 2, and other licensing cleanups. 2012-05-29 16:52:43 +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 666693 - 'Remote IndexedDB for multiple IndexedDB-using processes'. r=cjones+sicking. 2012-06-01 10:21:12 -07:00
ssltunnel Bug 761529 - ssltunnel broken in non-proxy mode, r=jgriffin 2012-06-07 18:10:21 +02:00
static Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
tests Bug 370750 - consolidate mochitest files installation; r=glandium 2012-07-03 16:49:02 -04:00
android.json Bug 775982 - Intermittent Android abort during indexedDB/ipc/test_ipc.html. r=edmorley 2012-07-20 12:59:30 -04:00
browser-harness.xul Bug 733631 - Create a unit test infrastructure for the webapp runtime. r=myk,felipc,ctalbert 2012-06-29 15:52:43 -07:00
browser-test-overlay.xul Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
browser-test.js Bug 733631 - Create a unit test infrastructure for the webapp runtime. r=myk,felipc,ctalbert 2012-06-29 15:52:43 -07: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 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 Bug 768736 Define constants for system native virtual keys for nsIDOMWindowUtils::SendNativeKeyEvent() r=roc 2012-06-27 11:26:38 +09:00
Makefile.in Bug 761982 - remove mozprefs.js. r=jmaher 2012-06-18 15:43:00 +02:00
MockFilePicker.jsm Bug 553102 - Add __exposedProps__ for MockFilePicker. r=ted 2012-05-24 13:04:57 +02: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
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 774951 - Allow extensions to be excluded when running mochitest, r=jmaher 2012-07-19 10:31:51 -07:00
runtestsb2g.py Bug 774951 - Allow extensions to be excluded when running mochitest, r=jmaher 2012-07-19 10:31:51 -07:00
runtestsremote.py Bug 754873 - fennec automated tests should capture logcat output while test is running. r=wlach 2012-06-13 14:20:43 -04:00
runtestsvmware.py Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
server.js Bug 733631 - Create a unit test infrastructure for the webapp runtime. r=myk,felipc,ctalbert 2012-06-29 15:52:43 -07: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>