gecko/testing/mochitest
Doug Turner ac832ab236 Bug 767894 - Device Storage - Move test from dom/tests/mochitest/devicestorage to dom/devicestorage. rs=bent
--HG--
rename : dom/tests/mochitest/devicestorage/Makefile.in => dom/devicestorage/test/Makefile.in
rename : dom/tests/mochitest/devicestorage/devicestorage_common.js => dom/devicestorage/test/devicestorage_common.js
rename : dom/tests/mochitest/devicestorage/test_basic.html => dom/devicestorage/test/test_basic.html
rename : dom/tests/mochitest/devicestorage/test_dotdot.html => dom/devicestorage/test/test_dotdot.html
rename : dom/tests/mochitest/devicestorage/test_enumerate.html => dom/devicestorage/test/test_enumerate.html
rename : dom/tests/mochitest/devicestorage/test_enumerateMultipleContinue.html => dom/devicestorage/test/test_enumerateMultipleContinue.html
rename : dom/tests/mochitest/devicestorage/test_enumerateNoParam.html => dom/devicestorage/test/test_enumerateNoParam.html
rename : dom/tests/mochitest/devicestorage/test_enumerateOptions.html => dom/devicestorage/test/test_enumerateOptions.html
rename : dom/tests/mochitest/devicestorage/test_lastModificationFilter.html => dom/devicestorage/test/test_lastModificationFilter.html
rename : dom/tests/mochitest/devicestorage/test_overwrite.html => dom/devicestorage/test/test_overwrite.html
rename : dom/tests/mochitest/devicestorage/test_sanity.html => dom/devicestorage/test/test_sanity.html
2012-06-27 13:47:36 -07: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 768736 Define constants for system native virtual keys for nsIDOMWindowUtils::SendNativeKeyEvent() r=roc 2012-06-27 11:26:38 +09:00
android.json Bug 767894 - Device Storage - Move test from dom/tests/mochitest/devicestorage to dom/devicestorage. rs=bent 2012-06-27 13:47:36 -07: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 755558 - report exceptions in head.js during browser-test. r=gavin 2012-06-15 12:08:17 +10:00
chrome-harness.js Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
gen_template.pl
harness-overlay.xul Backout cfac7b6a1f9c (bug 728893) for mochitest-1 orange 2012-05-23 11:56:03 +01:00
harness.xul
install.rdf
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 761125 - change mochitests to run all tests except excludedtests in android.json. r=jgriffin 2012-06-14 09:01:23 -04:00
runtestsb2g.py Bug 765015 - Don't stop server if it doesn't exist, r=jgriffin, DONTBUILD because NPOTB 2012-06-15 14:13:04 -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 Backout cfac7b6a1f9c (bug 728893) for mochitest-1 orange 2012-05-23 11:56:03 +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>