summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/uievents/constructors/inputevent-constructor.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/uievents/constructors/inputevent-constructor.html')
-rw-r--r--testing/web-platform/tests/uievents/constructors/inputevent-constructor.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/uievents/constructors/inputevent-constructor.html b/testing/web-platform/tests/uievents/constructors/inputevent-constructor.html
new file mode 100644
index 0000000000..3876abcd43
--- /dev/null
+++ b/testing/web-platform/tests/uievents/constructors/inputevent-constructor.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>InputEvent Constructor Tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ var e = new InputEvent('type');
+ assert_equals(e.data, null, '.data');
+ assert_false(e.isComposing, '.isComposing');
+}, 'InputEvent constructor without InputEventInit.');
+
+test(function() {
+ var e = new InputEvent('type', { data: null, isComposing: true });
+ assert_equals(e.data, null, '.data');
+ assert_true(e.isComposing, '.isComposing');
+}, 'InputEvent construtor with InputEventInit where data is null');
+
+test(function() {
+ assert_equals(new InputEvent('type', { data: ''}).data, '', '.data');
+}, 'InputEvent construtor with InputEventInit where data is empty string');
+
+test(function() {
+ assert_equals(new InputEvent('type', { data: 'data' }).data, 'data', '.data');
+}, 'InputEvent construtor with InputEventInit where data is non empty string');
+</script>