mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
Tests: Import WPT inputevent constructor test
This commit is contained in:
parent
d223cf25af
commit
a25ff8d46e
Notes:
github-actions[bot]
2024-11-29 20:24:03 +00:00
Author: https://github.com/shlyakpavel
Commit: a25ff8d46e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2630
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 39 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
Summary
|
||||
|
||||
Harness status: OK
|
||||
|
||||
Rerun
|
||||
|
||||
Found 4 tests
|
||||
|
||||
4 Pass
|
||||
Details
|
||||
Result Test Name MessagePass InputEvent constructor without InputEventInit.
|
||||
Pass InputEvent construtor with InputEventInit where data is null
|
||||
Pass InputEvent construtor with InputEventInit where data is empty string
|
||||
Pass InputEvent construtor with InputEventInit where data is non empty string
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue