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

Unified Diff: LayoutTests/fast/events/constructors/error-event-constructor.html

Issue 20679002: Add 'colno' attribute to ErrorEvent interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
Index: LayoutTests/fast/events/constructors/error-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/error-event-constructor.html b/LayoutTests/fast/events/constructors/error-event-constructor.html
index ba85f78e037b87b1bfb5b48da5d60074750831b8..a5313b26f658ce0c728902032f34da38194317f2 100644
--- a/LayoutTests/fast/events/constructors/error-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/error-event-constructor.html
@@ -74,12 +74,44 @@ shouldBe("new ErrorEvent('eventType', { lineno: {} }).lineno", "0");
shouldBe("new ErrorEvent('eventType', { lineno: {moemoe: 12345} }).lineno", "0");
shouldBe("new ErrorEvent('eventType', { lineno: {valueOf: function () { return 12345; }} }).lineno", "12345");
+// colno is passed.
+// numbers within the unsigned long range.
+shouldBe("new ErrorEvent('eventType', { colno: 0 }).colno", "0");
tkent 2013/07/28 21:52:11 According to the specification, the member name of
do-not-use 2013/07/30 05:20:12 The specification has now been fixed: http://html5
+shouldBe("new ErrorEvent('eventType', { colno: 1 }).colno", "1");
+shouldBe("new ErrorEvent('eventType', { colno: 4294967294 }).colno", "4294967294");
+shouldBe("new ErrorEvent('eventType', { colno: 4294967295 }).colno", "4294967295");
+
+// numbers out of the unsigned long range.
+// 2^{53}-1, the largest number that can be exactly represented by double.
+shouldBe("new ErrorEvent('eventType', { colno: 9007199254740991 }).colno", "4294967295");
+// 2^{64}-1
+shouldBe("new ErrorEvent('eventType', { colno: 18446744073709551615 }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: 12345678901234567890 }).colno", "3944679424");
+shouldBe("new ErrorEvent('eventType', { colno: -1 }).colno", "4294967295");
+shouldBe("new ErrorEvent('eventType', { colno: 123.45 }).colno", "123");
+shouldBe("new ErrorEvent('eventType', { colno: NaN }).colno", "0");
+
+// Non-numeric values.
+shouldBe("new ErrorEvent('eventType', { colno: undefined }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: null }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: '' }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: '12345' }).colno", "12345");
+shouldBe("new ErrorEvent('eventType', { colno: '12345a' }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: 'abc' }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: [] }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: [12345] }).colno", "12345");
+shouldBe("new ErrorEvent('eventType', { colno: [12345, 67890] }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: {} }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: {moemoe: 12345} }).colno", "0");
+shouldBe("new ErrorEvent('eventType', { colno: {valueOf: function () { return 12345; }} }).colno", "12345");
+
// All initializers are passed.
-shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).bubbles", "true");
-shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).cancelable", "true");
-shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).message", "sakuranbo");
-shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).filename", "amaenbo");
-shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345 }).lineno", "12345");
+shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).bubbles", "true");
+shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).cancelable", "true");
+shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).message", "sakuranbo");
+shouldBeEqualToString("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).filename", "amaenbo");
+shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).lineno", "12345");
+shouldBe("new ErrorEvent('eventType', { bubbles: true, cancelable: true, message: 'sakuranbo', filename: 'amaenbo', lineno: 12345, colno: 23456 }).colno", "23456");
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>

Powered by Google App Engine
This is Rietveld 408576698