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

Unified Diff: LayoutTests/fast/dom/DeviceLight/create-event.html

Issue 143823004: Implement DeviceLight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nits Created 6 years, 7 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 | LayoutTests/fast/dom/DeviceLight/create-event-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DeviceLight/create-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698