-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1311 from Ms2ger/createHTMLDocument
Cleanup and improve DOMImplementation#createHTMLDocument tests; r=zcorpan
- Loading branch information
Showing
3 changed files
with
78 additions
and
58 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,25 @@ | ||
function createHTMLDocuments(checkDoc) { | ||
var tests = [ | ||
["", "", ""], | ||
[null, "null", "null"], | ||
[undefined, undefined, ""], | ||
["foo bar baz", "foo bar baz", "foo bar baz"], | ||
["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"], | ||
["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"], | ||
["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"], | ||
["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"], | ||
] | ||
|
||
tests.forEach(function(t, i) { | ||
var title = t[0], expectedtitle = t[1], normalizedtitle = t[2] | ||
test(function() { | ||
var doc = document.implementation.createHTMLDocument(title); | ||
checkDoc(doc, expectedtitle, normalizedtitle) | ||
}, "createHTMLDocument test " + i + ": " + t.map(function(el) { return format_value(el) })) | ||
}) | ||
|
||
test(function() { | ||
var doc = document.implementation.createHTMLDocument(); | ||
checkDoc(doc, undefined, "") | ||
}, "Missing title argument"); | ||
} |
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