Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 368994. moving test cases closer to the code they test. r=bzbarsky
- Loading branch information
sayrer%gmail.com
committed
Feb 1, 2007
1 parent
4c2cf70
commit 477c951
Showing
13 changed files
with
405 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=1297 | ||
--> | ||
<head> | ||
<title>Test for Bug 1297</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1297">Mozilla Bug 1297</a> | ||
<p id="display"></p> | ||
<div id="content" style="display: none"> | ||
<table border=1> | ||
<tr> | ||
<td id="td1" onmousedown="alert(this.cellIndex)">cellIndex=0</td> | ||
<td id="td2" onmousedown="alert(this.cellIndex)">cellIndex=1</td> | ||
<td id="td3" onmousedown="alert(this.cellIndex)">cellIndex=2</td> | ||
<tr id="tr1" | ||
onmousedown="alert(this.rowIndex)"><td>rowIndex=1<td>rowIndex=1<td>rowIndex=1</t | ||
r> | ||
<tr id="tr2" | ||
onmousedown="alert(this.rowIndex)"><td>rowIndex=2<td>rowIndex=2<td>rowIndex=2</t | ||
r> | ||
</tr> | ||
</table> | ||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 1297 **/ | ||
is($('td1').cellIndex, 0, "cellIndex / rowIndex working td1"); | ||
is($('td2').cellIndex, 1, "cellIndex / rowIndex working td2"); | ||
is($('td3').cellIndex, 2, "cellIndex / rowIndex working td3"); | ||
is($('tr1').rowIndex, 1, "cellIndex / rowIndex working tr1"); | ||
is($('tr2').rowIndex, 2, "cellIndex / rowIndex working tr2"); | ||
|
||
|
||
|
||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=1366 | ||
--> | ||
<head> | ||
<title>Test for Bug 1366</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1366">Mozilla Bug 1366</a> | ||
<p id="display"></p> | ||
<div id="content" style="display: none"> | ||
<table id="testtable" width=150 border> | ||
<tbody id="testbody"> | ||
<tr> | ||
<td>cell content</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 1366 **/ | ||
$('testtable').removeChild($('testbody')); | ||
$('display').innerHTML = "SCRIPT: deleted first ROWGROUP\n"; | ||
is($('testbody'), null, "deleting tbody works"); | ||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=1400 | ||
--> | ||
<head> | ||
<title>Test for Bug 1400</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1400">Mozilla Bug 1400</a> | ||
<p id="display"></p> | ||
<div id="content" style="display: none"> | ||
|
||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 1400 **/ | ||
|
||
table = document.createElement("TABLE"); | ||
thead = table.createTHead(); | ||
thead2 = table.createTHead(); | ||
|
||
table.appendChild(thead); | ||
table.appendChild(thead); | ||
table.appendChild(thead); | ||
table.appendChild(thead2); | ||
table.appendChild(thead2); | ||
table.appendChild(thead2); | ||
table.appendChild(thead); | ||
table.appendChild(thead2); | ||
|
||
is(table.childNodes.length, 1, | ||
"adding multiple theads results in one thead child"); | ||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=2082 | ||
--> | ||
<head> | ||
<title>Test for Bug 2082</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=2082">Mozilla Bug 2082</a> | ||
<p id="display"></p> | ||
<div id="content" style="display: none"> | ||
<FORM name="gui" id="gui"> | ||
<INPUT TYPE="text" NAME="field" VALUE="some value"> | ||
</FORM> | ||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 2082 **/ | ||
var guiform = document.getElementById("gui"); | ||
ok(document.getElementById("gui").hasChildNodes(), "form elements should be treated as form's children"); | ||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=589 | ||
--> | ||
<head> | ||
<title>Test for Bug 589</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" /> | ||
|
||
<style type="text/css"> | ||
.letters {list-style-type: upper-alpha;} | ||
.numbers {list-style-type: decimal;} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=589">Mozilla Bug 589</a> | ||
<p id="display"></p> | ||
<div id="content" > | ||
|
||
<OL id="thelist" class="letters"> | ||
<LI id="liA">This list should feature... | ||
<LI id="liB">...letters for each item... | ||
<LI id="li3" class="numbers">...except this one. | ||
</OL> | ||
|
||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 589 **/ | ||
|
||
is(computedStyle($("liA"),"list-style-type"),"upper-alpha"); | ||
is(computedStyle($("liB"),"list-style-type"),"upper-alpha"); | ||
is(computedStyle($("li3"),"list-style-type"),"decimal"); | ||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=691 | ||
--> | ||
<head> | ||
<title>Test for Bug 691</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" /> | ||
<script type="text/javascript"> | ||
|
||
function show(what) { | ||
var stage = document.getElementById("stage"); | ||
if (what == "modularity") { | ||
var spaghetti = document.createElement("IMG",null); | ||
spaghetti.setAttribute("SRC","/static/nnc_lockup.gif"); | ||
spaghetti.setAttribute("id","foo"); | ||
stage.insertBefore(spaghetti,stage.firstChild); | ||
} | ||
} | ||
|
||
function remove() { | ||
var stage = document.getElementById("stage"); | ||
var body = document.getElementsByTagName("BODY")[0]; | ||
while (stage.firstChild) { | ||
stage.removeChild(stage.firstChild); | ||
} | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=691">Mozilla Bug 691</a> | ||
<p id="display"></p> | ||
<div id="content" > | ||
<ul> | ||
<li >foo</li> | ||
</ul> | ||
<div id="stage"> | ||
</div> | ||
|
||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 691 **/ | ||
|
||
show("modularity"); | ||
remove(); | ||
show("modularity"); | ||
remove(); | ||
show("modularity"); | ||
remove(); | ||
show("modularity"); | ||
|
||
ok($("foo"), "basic DOM manipulation doesn't crash"); | ||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=694 | ||
--> | ||
<head> | ||
<title>Test for Bug 694</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=694">Mozilla Bug 694</a> | ||
<p id="display"></p> | ||
<div id="content" > | ||
<img src="/missing_on_purpose" width=123 height=25 alt="Hello, "Quotes" how are you?" id="testimg"> | ||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 694 **/ | ||
|
||
is($("testimg").getAttribute("alt"), "Hello, \"Quotes\" how are you?", "entities in alt attribute works"); | ||
|
||
|
||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=696 | ||
--> | ||
<head> | ||
<title>Test for Bug 696</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=696">Mozilla Bug 696</a> | ||
<p id="display"></p> | ||
<div id="content" style="display: none"> | ||
<table><tr id="mytr"><td>Foo</td><td>Bar</td></tr></table> | ||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 696 **/ | ||
var mytr = $("content").getElementsByTagName("TR")[0]; | ||
is(mytr.getAttribute("ID"),"mytr","TR tags expose their ID attribute"); | ||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=1682 | ||
--> | ||
<head> | ||
<title>Test for Bug 1682</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> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1682">Mozilla Bug 1682</a> | ||
<p id="display"></p> | ||
<div id="content" style="display: none"> | ||
|
||
</div> | ||
<pre id="test"> | ||
<script class="testbody" type="text/javascript"> | ||
|
||
/** Test for Bug 1682 **/ | ||
var count = 1; | ||
|
||
SimpleTest.waitForExplicitFinish(); | ||
addLoadEvent(function () { | ||
is(count, 1, "onload executes once"); | ||
++count; | ||
}); | ||
addLoadEvent(SimpleTest.finish); | ||
|
||
|
||
|
||
|
||
</script> | ||
</pre> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.