Minor tweaks, mostly to use isnot()

This commit is contained in:
bzbarsky%mit.edu 2006-11-11 05:20:57 +00:00
parent 82c1df0239
commit 9e09938936
4 changed files with 13 additions and 23 deletions

View File

@ -33,13 +33,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339494
{
ok(!d.hasAttribute("hhh"), "Value check 1",
"There should be no value");
ok(d.getAttribute("hhh") != "testvalue", "Value check 2",
"Value should not be old value");
isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
document.removeEventListener("DOMAttrModified", removeItAgain, false);
d.removeAttribute("hhh");
ok(true, "Reachability", "We shouldn't have crashed");
}
var s = document.getElementById("s");
s.setAttribute("ggg", "testvalue");
@ -52,10 +51,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339494
{
ok(s.hasAttribute("ggg"), "Value check 3",
"There should be a value");
ok(s.getAttribute("ggg") != "testvalue", "Value check 4",
"Value should not be old value");
ok(s.getAttribute("ggg") == "othervalue", "Value check 5",
"Value should be newvalue");
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
}
</script>

View File

@ -32,13 +32,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339494
{
ok(!d.hasAttribute("hhh"), "Value check 1",
"There should be no value");
ok(d.getAttribute("hhh") != "testvalue", "Value check 2",
"Value should not be old value");
isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
document.removeEventListener("DOMAttrModified", removeItAgain, false);
// d.removeAttribute("hhh");
d.removeAttribute("hhh");
ok(true, "Reachability", "We shouldn't have crashed");
}
var s = document.getElementById("s");
s.setAttribute("ggg", "testvalue");
@ -51,10 +50,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339494
{
ok(s.hasAttribute("ggg"), "Value check 3",
"There should be a value");
ok(s.getAttribute("ggg") != "testvalue", "Value check 4",
"Value should not be old value");
ok(s.getAttribute("ggg") == "othervalue", "Value check 5",
"Value should be newvalue");
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
}
</script>

View File

@ -40,8 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339494
{
ok(!d.hasAttribute("hhh"), "Value check 1",
"There should be no value");
ok(d.getAttribute("hhh") != "testvalue", "Value check 2",
"Value should not be old value");
isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
document.removeEventListener("DOMAttrModified", removeItAgain, false);
d.removeAttribute("hhh");
ok(true, "Reachability", "We shouldn't have crashed");
@ -59,10 +58,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339494
{
ok(s.hasAttribute("ggg"), "Value check 3",
"There should be a value");
ok(s.getAttribute("ggg") != "testvalue", "Value check 4",
"Value should not be old value");
ok(s.getAttribute("ggg") == "othervalue", "Value check 5",
"Value should be newvalue");
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
}
</script>

View File

@ -23,8 +23,7 @@ function runTest() {
var span = document.createElement("span");
$("test").insertBefore(span, $("test").firstChild);
ok(true, "Reachability", "We should get here without crashing");
ok($("test").firstChild === span, "First child is correct",
"First child should be the node we inserted");
is($("test").firstChild, span, "First child is correct");
}
</script>
<div>