mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add content test for [LenientThis] attribute Document.onreadystatechange
This commit is contained in:
parent
e023662571
commit
9653965380
1 changed files with 28 additions and 0 deletions
28
tests/content/test_lenient_this.html
Normal file
28
tests/content/test_lenient_this.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="harness.js"></script>
|
||||
<script>
|
||||
var handler = function () { };
|
||||
document.onreadystatechange = handler;
|
||||
var obj = {};
|
||||
|
||||
// test1: basic test
|
||||
{
|
||||
var val = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange").get.call(document);
|
||||
is(val, handler, "test1-0, basic test");
|
||||
}
|
||||
|
||||
// test2: Should not throw for attribute marked "[LenientThis]"
|
||||
{
|
||||
should_not_throw(function () {
|
||||
var val = null;
|
||||
val = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange").get.call(obj);
|
||||
is(val, undefined, "test2-0, calling getter returns undefined");
|
||||
is(Document.prototype.onreadystatechange, undefined, "test2-1, property access returns undefined");
|
||||
});
|
||||
}
|
||||
|
||||
finish();
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue