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

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: Chris's comments 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
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>

Powered by Google App Engine
This is Rietveld 408576698