Commit f676d912 authored by andersca's avatar andersca

2006-01-03 Anders Carlsson <andersca@mac.com>

        Reviewed by Eric.

        - add tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=6358
        JS objects missing "prototype" properties

        * fast/js/test-prototypes-expected.txt: Added.
        * fast/js/test-prototypes.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6ab8a185
2006-01-03 Anders Carlsson <andersca@mac.com>
Reviewed by Eric.
- add tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=6358
JS objects missing "prototype" properties
* fast/js/test-prototypes-expected.txt: Added.
* fast/js/test-prototypes.html: Added.
2006-01-03 Anders Carlsson <andersca@mac.com> 2006-01-03 Anders Carlsson <andersca@mac.com>
Reviewed by Darin. Reviewed by Darin.
......
This checks that DOMParser, XMLHttpRequest, XMLSerializer and XSLTProcessor have their prototypes set correctly. If this test is successful, the text "SUCCESS" will be shown below.
SUCCESS!
<html>
<head>
<script>
function debug(str) {
var c = document.getElementById('console')
c.innerHTML += (str + "<br>")
}
var numErrors = 0;
function testPrototype(name)
{
func = eval(name);
if (!func.prototype) {
debug("FAILURE: " + name + " did not have a prototype defined.")
numErrors++;
return;
}
// Create an object
o = new func()
if (!func.prototype.isPrototypeOf(o)) {
debug('FAILURE: Newly created object of type ' + name + " does not have " + name + ".prototype in it's prototype chain.");
numErrors++;
}
}
function runTests() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
testPrototype("DOMParser");
testPrototype("XMLHttpRequest");
testPrototype("XMLSerializer");
testPrototype("XSLTProcessor");
if (numErrors == 0)
debug('SUCCESS!')
}
</script>
</head>
<body onload="runTests();">
This checks that DOMParser, XMLHttpRequest, XMLSerializer and XSLTProcessor have their prototypes set correctly. If this test is successful, the text "SUCCESS" will be shown below.
<pre id="console"></pre>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment