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..c811a3bd1722d0a18f205900a6a3bed59895c304 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/DeviceLight/create-event.html |
@@ -0,0 +1,40 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/js-test.js"></script> |
Inactive
2014/05/09 13:12:47
nit: this can be moved to the body and you can rem
riju_
2014/05/09 13:45:35
Done.
|
+</head> |
+<body> |
+<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> |