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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/touch-events/touch-touchevent-constructor.html

Issue 2376103007: Import wpt@09907a9c4bcee14986431d53e4381384c7c69107 (Closed)
Patch Set: update platform expectations Created 4 years, 2 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 <html> 2 <html>
3 <head> 3 <head>
4 <title>Touch and TouchEvent Constructor Tests</title> 4 <title>Touch and TouchEvent Constructor Tests</title>
5 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <script src="touch-support.js"></script> 7 <script src="touch-support.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <div id="target0"></div> 10 <div id="target0"></div>
11 <script> 11 <script>
12 test(function() { 12 test(function() {
13 assert_throws(new TypeError(), function() {new Touch();}, "Touch constructor requires initialize dictionary"); 13 var testIdentifier = 0;
14 assert_throws(new TypeError(), function() {new Touch({});}, "Touch construct or requires identifier and target"); 14 var testTarget = document.getElementById('target0');
15 }, "Create a Touch object with insufficient properties"); 15
16 assert_throws(new TypeError(), function() {new Touch();}, "Touch constructor with no argument");
17 assert_throws(new TypeError(), function() {new Touch(null);}, "Touch constru ctor with null argument");
18 assert_throws(new TypeError(), function() {new Touch(undefined);}, "Touch co nstructor with undefined argument");
19 assert_throws(new TypeError(), function() {new Touch({});}, "Touch construct or with empty object");
20 assert_throws(new TypeError(), function() {new Touch({
21 identifier: testIdentifier
22 });}, "Touch constructor with only identifier");
23 assert_throws(new TypeError(), function() {new Touch({
24 target: testTarget
25 });}, "Touch constructor with only target");
26 }, "Touch constructor with insufficient properties");
27
28 test(function() {
29 var testIdentifier = 0;
30 var testTarget = document.getElementById('target0');
31
32 assert_throws(new TypeError(), function() {new Touch({
33 identifier: testIdentifier,
34 target: null
35 });}, "Touch constructor with null target");
36 assert_throws(new TypeError(), function() {new Touch({
37 identifier: testIdentifier,
38 target: undefined
39 });}, "Touch constructor with undefined target");
40 assert_throws(new TypeError(), function() {new Touch({
41 identifier: testIdentifier,
42 target: location
43 });}, "Touch constructor with Location target");
44 }, "Touch constructor with non-EventTarget target");
16 45
17 test(function() { 46 test(function() {
18 var testIdentifier = 74; 47 var testIdentifier = 74;
19 var testTarget = document.getElementById('target0'); 48 var testTarget = document.getElementById('target0');
20 var approxEpsilon = 0.00001; 49 var approxEpsilon = 0.00001;
21 50
22 var touch1 = new Touch({ 51 var touch1 = new Touch({
23 identifier: testIdentifier, 52 identifier: testIdentifier,
24 target: testTarget, 53 target: testTarget,
25 }); 54 });
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 assert_equals(touchEvent1.targetTouches[0], touch1, "touchEvent.targetTouche s[0] is requested value"); 136 assert_equals(touchEvent1.targetTouches[0], touch1, "touchEvent.targetTouche s[0] is requested value");
108 assert_equals(touchEvent1.changedTouches.length, 0, "touchEvent.changedTouch es.length is requested value"); 137 assert_equals(touchEvent1.changedTouches.length, 0, "touchEvent.changedTouch es.length is requested value");
109 assert_equals(touchEvent1.altKey, true, "touchEvent.altKey is requested valu e"); 138 assert_equals(touchEvent1.altKey, true, "touchEvent.altKey is requested valu e");
110 assert_equals(touchEvent1.metaKey, false, "touchEvent.metaKey is requested v alue"); 139 assert_equals(touchEvent1.metaKey, false, "touchEvent.metaKey is requested v alue");
111 assert_equals(touchEvent1.ctrlKey, false, "touchEvent.ctrlKey is requested v alue"); 140 assert_equals(touchEvent1.ctrlKey, false, "touchEvent.ctrlKey is requested v alue");
112 assert_equals(touchEvent1.shiftKey, false, "touchEvent.shiftKey is requested value."); 141 assert_equals(touchEvent1.shiftKey, false, "touchEvent.shiftKey is requested value.");
113 }, "TouchEvent constructor exists and creates a TouchEvent object with requested properties"); 142 }, "TouchEvent constructor exists and creates a TouchEvent object with requested properties");
114 </script> 143 </script>
115 </body> 144 </body>
116 </html> 145 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698