Skip to content
Permalink
Browse files

Add content test for [LenientThis] attribute Document.onreadystatechange

  • Loading branch information...
mukilan committed Oct 25, 2014
1 parent e023662 commit 9653965380a33764460ee8d66cec4ef70b50a587
Showing with 28 additions and 0 deletions.
  1. +28 −0 tests/content/test_lenient_this.html
@@ -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>

4 comments on commit 9653965

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Oct 25, 2014

saw approval from Ms2ger
at mukilan@9653965

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Oct 25, 2014

merging mukilan/servo/lenient-this = 9653965 into auto

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Oct 25, 2014

mukilan/servo/lenient-this = 9653965 merged ok, testing candidate = 6c86284

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Oct 25, 2014

Please sign in to comment.
You can’t perform that action at this time.