Index: LayoutTests/fast/dom/DeviceLight/create-event.html |
diff --git a/LayoutTests/fast/dom/DeviceLight/create-event.html b/LayoutTests/fast/dom/DeviceLight/create-event.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a8727f471137f7217b7157ff78b4f1a8a0a2b252 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/DeviceLight/create-event.html |
@@ -0,0 +1,38 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<script src="../../../resources/js-test.js"></script> |
+<script> |
+description("Tests that document.createEvent() works with DeviceLightEvent."); |
+ |
+var event = document.createEvent('DeviceLightEvent'); |
+var newEvent = new DeviceLightEvent("devicelight", { |
+ bubbles: true, cancelable: false, |
+ value: 10 |
+}); |
+ |
+var defaultEvent = new DeviceLightEvent("devicelight"); |
+ |
+shouldBeTrue("typeof event == 'object'"); |
+shouldBe("event.__proto__", "DeviceLightEvent.prototype"); |
+ |
+shouldBeTrue("event instanceof window.DeviceLightEvent"); |
+shouldBeTrue("'type' in event"); |
+shouldBeTrue("'bubbles' in event"); |
+shouldBeTrue("'cancelable' in event"); |
+shouldBeTrue("'value' in event"); |
+ |
+shouldBeTrue("typeof newEvent.type == 'string'"); |
+shouldBeEqualToString("newEvent.type", "devicelight"); |
+shouldBeTrue("typeof newEvent.bubbles == 'boolean'"); |
+shouldBeTrue("newEvent.bubbles"); |
+shouldBeTrue("typeof newEvent.cancelable == 'boolean'"); |
+shouldBeFalse("newEvent.cancelable") |
+shouldBeTrue("typeof newEvent.value == 'number'"); |
+shouldBeEqualToNumber('newEvent.value', 10); |
+ |
+shouldBeTrue("defaultEvent.bubbles"); |
+shouldBeFalse("defaultEvent.cancelable"); |
+</script> |
+</body> |
+</html> |