7 1.) Run the runtests.pl script to start the server.
9 Currently, the test script automatically determines the location
12 2.) gen_template.pl will generate test templates for HTML, XUL, and XHTML.
13 Read the comment at the top of the file for usage instructions.
23 https://bugzilla.mozilla.org/show_bug.cgi?id=345656
26 <title>Test for Bug 345656</title>
27 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
28 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
29 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
33 <div id="content" style="display: none">
37 <script class="testbody" type="text/javascript">
39 /** Test for Bug 345656 **/
41 //add information to show on the test page
43 $("display").innerHTML = "doing stuff...";
46 // The '$' is function is shorthand for getElementById. This is the same thing:
48 document.getElementById("display").innerHTML = "doing stuff...";
51 // you can add content that you don't want to clutter
52 // the display to the content div.
54 // You can write directly, or you can use MochiKit functions
55 // to do it in JS like this:
57 appendChildNodes($("content"),
59 SPAN({id: "span42"}, "content"))
63 // the ok() function is like assert
65 ok(true, "checking to see if true is true);
70 ok(1==2, "1 equals 2?");
74 // this will be marked as a todo.
75 // When we fix 1 so it equals 2, we'll need to change this
76 // function to ok() or is().
78 todo(1==2, "1 equals 2?");
81 // is() takes two args
84 is(myVar, "foo", "checking to see if myVar is 'foo'");
87 // Tests can run in event handlers.
88 // Call this to tell SimpleTest to wait for SimpleTest.finish()
90 SimpleTest.waitForExplicitFinish();
95 function event_fired(ev) {
96 is(ev.newValue, "width: auto;", "DOMAttrModified event reports correct newValue");
97 SimpleTest.finish(); // trigger the end of our test sequence
101 // Hook up the event. Mochikit.Signal has many conveniences for this, if you want.
103 $("content").addEventListener("DOMAttrModified", event_fired, false);
108 $("content").style.width = "auto";