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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/uievents/constructors/inputevent-constructor.html

Issue 2791373002: [InputEvent] Make StaticRange immutable and move tests to wpt (Closed)
Patch Set: Fix global-interface-listing Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>InputEvent Constructor Tests</title> 2 <title>InputEvent Constructor Tests</title>
3 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 test(function() { 6 test(function() {
7 var e = new InputEvent('type'); 7 var e = new InputEvent('type');
8 assert_equals(e.data, null); 8 assert_equals(e.data, null);
9 assert_false(e.isComposing); 9 assert_false(e.isComposing);
10 }, 'InputEvent constructor without InputEventInit.'); 10 }, 'InputEvent constructor without InputEventInit.');
11 11
12 test(function() { 12 test(function() {
13 var e = new InputEvent('type', { data: null, isComposing: true }); 13 var e = new InputEvent('type', { data: null, isComposing: true });
14 assert_equals(e.data, null); 14 assert_equals(e.data, null);
15 assert_true(e.isComposing); 15 assert_true(e.isComposing);
16 }, 'InputEvent construtor with InputEventInit where data is null'); 16 }, 'InputEvent construtor with InputEventInit where data is null');
17 17
18 test(function() { 18 test(function() {
19 assert_equals(new InputEvent('type', { data: ''}).data, ''); 19 assert_equals(new InputEvent('type', { data: ''}).data, '');
20 }, 'InputEvent construtor with InputEventInit where data is empty string'); 20 }, 'InputEvent construtor with InputEventInit where data is empty string');
21 21
22 test(function() { 22 test(function() {
23 assert_equals(new InputEvent('type', { data: 'data' }).data, 'data'); 23 assert_equals(new InputEvent('type', { data: 'data' }).data, 'data');
24 }, 'InputEvent construtor with InputEventInit where data is non empty string'); 24 }, 'InputEvent construtor with InputEventInit where data is non empty string');
25
26 test(function() {
27 const range = new StaticRange();
28 range.setEnd(document, 1);
29 const resultRange = new InputEvent('type', { targetRanges: [range] }).getTarge tRanges()[0];
30 assert_equals(resultRange.startContainer, document);
31 assert_equals(resultRange.startOffset, 0);
32 assert_equals(resultRange.endContainer, document);
33 assert_equals(resultRange.endOffset, 1);
34 }, 'InputEvent construtor with InputEventInit where targetRanges is non empty li st');
35 </script> 25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698