Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: LayoutTests/fast/dom/lenient-this.html

Issue 1182033002: bindings: Adds a layout test for [LenientThis] extended attribute. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/lenient-this.html
diff --git a/LayoutTests/fast/dom/lenient-this.html b/LayoutTests/fast/dom/lenient-this.html
new file mode 100644
index 0000000000000000000000000000000000000000..6931f9b0df8e7773bb6b224ffd1ef218c4bc0063
--- /dev/null
+++ b/LayoutTests/fast/dom/lenient-this.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<title>[LenientThis] test</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ // GlobalEventHandlers.onmouseenter is [LenientThis].
+ assert_equals(document.onmouseenter, null, "|this| is an appropriate object.");
+ assert_equals(Document.prototype.onmouseenter, undefined, "|this| is not an appropriate object.");
+ Document.prototype.onmouseenter = 'foo'; // must not throw.
+ assert_equals(Document.prototype.onmouseenter, undefined, "the value must not change.");
+
+ // GlobalEventHandlers.onmousedown is NOT [LenientThis].
+ assert_equals(document.onmousedown, null, "|this| is an appropriate object.");
+ assert_throws(null, function() {
+ Document.prototype.onmousedown;
+ }, "Document.prototype is invalid as |this|.");
+ assert_throws(null, function() {
+ Document.prototype.onmousedown = 'foo';
+ }, "Document.prototype is invalid as |this|.");
+});
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698