This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed and fully tested in virtually all major browsers
- Loading branch information
Todd Wolfson
committed
Jul 25, 2011
1 parent
795bcdc
commit 03ef0f7
Showing
8 changed files
with
93 additions
and
67 deletions.
There are no files selected for viewing
Binary file not shown.
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,6 @@ | ||
Tested and functional in: | ||
- FF 2.0, 3.0, 3.5, 3.6, 5.0 | ||
- Chrome 8, 9, 10, 11, 12 | ||
- Opera 9.6, 10.63 | ||
- IE 6, 7, 8, 9 | ||
- Safari 3, 4, 5 |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
java -jar JsTestDriver.jar --tests all --captureConsole |
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 @@ | ||
java -jar JsTestDriver.jar --config jsTestDriver.conf --port 42442 |
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,5 @@ | ||
server: http://localhost:42442 | ||
|
||
load: | ||
- src/*.js | ||
- src-test/*.js |
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,57 @@ | ||
var mainTest = TestCase("CSS Query test suite"); | ||
|
||
mainTest.prototype.setUp = function(){}; | ||
mainTest.prototype.tearDown = function(){}; | ||
|
||
mainTest.prototype.testQuery = function () { | ||
/*:DOC += <div id="myDiv"> | ||
<p class="one"> | ||
<a href="http://www.google.com/"> | ||
This is a link | ||
</a> | ||
</p> | ||
</div> */ | ||
/*:DOC += <div> | ||
<p class="two dos"> | ||
<a href="#"> | ||
Another link | ||
</a> | ||
</p> | ||
</div> */ | ||
/*:DOC += <span> | ||
<p class="third"> | ||
<a href="#"> | ||
Third link | ||
</a> | ||
</p> | ||
</span> */ | ||
|
||
var doc = document, | ||
body = doc.body, | ||
allNodes = [body]; | ||
|
||
var allDivs = doc.getElementsByTagName('div'), | ||
allP = doc.getElementsByTagName('p'), | ||
allA = doc.getElementsByTagName('a'), | ||
myDiv = doc.getElementById('myDiv'), | ||
secondLink = allDivs[1].getElementsByTagName('a')[0], | ||
firstSpan = doc.getElementsByTagName('span')[0]; | ||
|
||
allNodes.push( allDivs[0], allP[0], allA[0] ); | ||
allNodes.push( allDivs[1], allP[1], allA[1] ); | ||
allNodes.push( firstSpan, allP[2], allA[2] ); | ||
|
||
// No parameters | ||
assertEquals( "CSS Query: No params (everything top-down)", allNodes, CSSQuery() ); | ||
|
||
// First param only | ||
assertEquals( "CSS Query: First param only", allNodes.slice(allNodes.length - 3), CSSQuery(firstSpan) ); | ||
|
||
// Second param only | ||
assertEquals( "CSS Query: Second param only", [allDivs[0], allDivs[1]], CSSQuery(null, 'div') ); | ||
|
||
// Both params, remaining functionality | ||
assertEquals( "CSS Query: #myDiv", [myDiv], CSSQuery(body, '#myDiv') ); | ||
assertEquals( "CSS Query: Second link", [secondLink], CSSQuery(body, '.two a') ); | ||
assertEquals( "CSS Query: Bad query (a p span)", [], CSSQuery(body, 'a p span') ); | ||
}; |
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