Added: trunk/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt (0 => 141386)
--- trunk/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt 2013-01-31 08:33:21 UTC (rev 141386)
@@ -0,0 +1,52 @@
+This tests the constructor for the CompositionEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new CompositionEvent('eventType').bubbles is false
+PASS new CompositionEvent('eventType').cancelable is false
+PASS new CompositionEvent('eventType').view is null
+PASS new CompositionEvent('eventType').detail is 0
+PASS new CompositionEvent('eventType').data is ""
+PASS new CompositionEvent('eventType', { bubbles: false }).bubbles is false
+PASS new CompositionEvent('eventType', { bubbles: true }).bubbles is true
+PASS new CompositionEvent('eventType', { cancelable: false }).cancelable is false
+PASS new CompositionEvent('eventType', { cancelable: true }).cancelable is true
+PASS new CompositionEvent('eventType', { view: window }).view is window
+PASS new CompositionEvent('eventType', { view: this }).view is this
+PASS new CompositionEvent('eventType', { view: testObject }).view is null
+PASS new CompositionEvent('eventType', { view: document }).view is null
+PASS new CompositionEvent('eventType', { view: undefined }).view is null
+PASS new CompositionEvent('eventType', { view: null }).view is null
+PASS new CompositionEvent('eventType', { view: false }).view is null
+PASS new CompositionEvent('eventType', { view: true }).view is null
+PASS new CompositionEvent('eventType', { view: '' }).view is null
+PASS new CompositionEvent('eventType', { view: 'chocolate' }).view is null
+PASS new CompositionEvent('eventType', { view: 12345 }).view is null
+PASS new CompositionEvent('eventType', { view: 18446744073709551615 }).view is null
+PASS new CompositionEvent('eventType', { view: NaN }).view is null
+PASS new CompositionEvent('eventType', { view: {valueOf: function () { return window; } } }).view == window is false
+PASS new CompositionEvent('eventType', { get view() { return 123; } }).view is null
+PASS new CompositionEvent('eventType', { get view() { throw 'CompositionEvent Error'; } }) threw exception CompositionEvent Error.
+PASS new CompositionEvent('eventType', { data: 'koakuma' }).data is "koakuma"
+PASS new CompositionEvent('eventType', { data: '' }).data is ""
+PASS new CompositionEvent('eventType', { data: undefined }).data is "undefined"
+PASS new CompositionEvent('eventType', { data: null }).data is "null"
+PASS new CompositionEvent('eventType', { data: false }).data is "false"
+PASS new CompositionEvent('eventType', { data: true }).data is "true"
+PASS new CompositionEvent('eventType', { data: 12345 }).data is "12345"
+PASS new CompositionEvent('eventType', { data: 18446744073709551615 }).data is "18446744073709552000"
+PASS new CompositionEvent('eventType', { data: NaN }).data is "NaN"
+PASS new CompositionEvent('eventType', { data: [] }).data is ""
+PASS new CompositionEvent('eventType', { data: [1, 2, 3] }).data is "1,2,3"
+PASS new CompositionEvent('eventType', { data: {koakuma: 12345} }).data is "[object Object]"
+PASS new CompositionEvent('eventType', { data: {valueOf: function () { return 'koakuma'; } } }).data is "[object Object]"
+PASS new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).bubbles is true
+PASS new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).cancelable is true
+PASS new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).view is window
+PASS new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).detail is 111
+PASS new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).data is "koakuma"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/events/constructors/composition-event-constructor.html (0 => 141386)
--- trunk/LayoutTests/fast/events/constructors/composition-event-constructor.html (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/composition-event-constructor.html 2013-01-31 08:33:21 UTC (rev 141386)
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+description("This tests the constructor for the CompositionEvent DOM class.");
+
+var testObject = {nyannyan: 123};
+
+// No initializer is passed.
+shouldBe("new CompositionEvent('eventType').bubbles", "false");
+shouldBe("new CompositionEvent('eventType').cancelable", "false");
+shouldBe("new CompositionEvent('eventType').view", "null");
+shouldBe("new CompositionEvent('eventType').detail", "0");
+shouldBeEqualToString("new CompositionEvent('eventType').data", "");
+
+// bubbles is passed.
+shouldBe("new CompositionEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new CompositionEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new CompositionEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new CompositionEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// view is passed.
+// Window objects.
+shouldBe("new CompositionEvent('eventType', { view: window }).view", "window");
+shouldBe("new CompositionEvent('eventType', { view: this }).view", "this");
+
+// Non-window objects.
+shouldBe("new CompositionEvent('eventType', { view: testObject }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: document }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: undefined }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: null }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: false }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: true }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: '' }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: 'chocolate' }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: 12345 }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: 18446744073709551615 }).view", "null");
+shouldBe("new CompositionEvent('eventType', { view: NaN }).view", "null");
+// Note that valueOf() is not called, when the left hand side is evaluated.
+shouldBeFalse("new CompositionEvent('eventType', { view: {valueOf: function () { return window; } } }).view == window");
+shouldBe("new CompositionEvent('eventType', { get view() { return 123; } }).view", "null");
+shouldThrow("new CompositionEvent('eventType', { get view() { throw 'CompositionEvent Error'; } })");
+
+// data is passed.
+// Strings.
+shouldBeEqualToString("new CompositionEvent('eventType', { data: 'koakuma' }).data", "koakuma");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: '' }).data", "");
+
+// Non-strings.
+shouldBeEqualToString("new CompositionEvent('eventType', { data: undefined }).data", "undefined");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: null }).data", "null");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: false }).data", "false");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: true }).data", "true");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: 12345 }).data", "12345");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: 18446744073709551615 }).data", "18446744073709552000");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: NaN }).data", "NaN");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: [] }).data", "");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: [1, 2, 3] }).data", "1,2,3");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: {koakuma: 12345} }).data", "[object Object]");
+shouldBeEqualToString("new CompositionEvent('eventType', { data: {valueOf: function () { return 'koakuma'; } } }).data", "[object Object]");
+
+// All initializers are passed.
+shouldBe("new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).bubbles", "true");
+shouldBe("new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).cancelable", "true");
+shouldBe("new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).view", "window");
+shouldBe("new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).detail", "111");
+shouldBeEqualToString("new CompositionEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, data: 'koakuma' }).data", "koakuma");
+</script>
+<script src=""
+</body>
+</html>