Skip to content

Commit

Permalink
Add content test for [LenientThis] attribute Document.onreadystatechange
Browse files Browse the repository at this point in the history
  • Loading branch information
mukilan committed Oct 25, 2014
1 parent e023662 commit 9653965
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Ms2ger
at mukilan@9653965

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.