Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/touch/document-create-touch.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/document-create-touch.html b/third_party/WebKit/LayoutTests/fast/events/touch/document-create-touch.html |
| index 01c04ce2a25993c1463b54bbc0c6a2a46d8b99b3..8c0bbeae5d2e2f6c4c8c047b8042a977016f09b2 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/events/touch/document-create-touch.html |
| +++ b/third_party/WebKit/LayoutTests/fast/events/touch/document-create-touch.html |
| @@ -36,28 +36,32 @@ shouldBe("touch.radiusY", "3"); |
| shouldBe("touch.rotationAngle", "10"); |
| shouldBe("touch.force", "10"); |
| -var emptyTouch = document.createTouch(); |
| -shouldBeNonNull("emptyTouch"); |
| -shouldBeNull("emptyTouch.target"); |
| -shouldBe("emptyTouch.identifier", "0"); |
| -shouldBe("emptyTouch.pageX", "0"); |
| -shouldBe("emptyTouch.pageY", "0"); |
| -shouldBe("emptyTouch.screenX", "0"); |
| -shouldBe("emptyTouch.screenY", "0"); |
| -shouldBe("emptyTouch.radiusX", "0"); |
| -shouldBe("emptyTouch.radiusY", "0"); |
| -shouldBe("emptyTouch.rotationAngle", "0"); |
| -shouldBe("emptyTouch.force", "0"); |
| +shouldThrow("document.createTouch()", '"TypeError: Failed to execute \'createTouch\' on \'Document\': 7 arguments required, but only 0 present."'); |
| + |
| +var incompleteTouch = document.createTouch(window, target, 1, 100, 101, 102, 103); |
| +shouldBeNonNull("incompleteTouch"); |
| +shouldBeNonNull("incompleteTouch.target"); |
| +shouldBe("incompleteTouch.identifier", "1"); |
| +shouldBe("incompleteTouch.pageX", "100"); |
| +shouldBe("incompleteTouch.pageY", "101"); |
| +shouldBe("incompleteTouch.screenX", "102"); |
| +shouldBe("incompleteTouch.screenY", "103"); |
| +shouldBe("incompleteTouch.radiusX", "0"); |
| +shouldBe("incompleteTouch.radiusY", "0"); |
| +shouldBe("incompleteTouch.rotationAngle", "0"); |
| +shouldBe("incompleteTouch.force", "0"); |
| + |
| +shouldThrow("document.createTouch(function(x) { return x; }, 12, 'a', 'b', 101, 102, 103, function(x) { return x; }, 'a', 'b', 'c')", '"TypeError: Failed to execute \'createTouch\' on \'Document\': The provided double value is non-finite."'); |
| // Try invoking with incorrect parameter types. |
| -var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104, 'a', 'b', 'c', 'd'); |
| +var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 100, 101, 102, 103, function(x) { return x; }, 'a', 'b', 'c'); |
|
foolip
2017/03/21 08:01:13
Is this test change needed to get coverage of some
lunalu1
2017/03/21 19:19:27
This tests that window can be a function, target c
foolip
2017/03/22 05:16:24
But pageX/Y and screenX/Y are now tested with numb
lunalu1
2017/03/22 17:56:03
Right. It was 104 in the original test (so I guess
|
| shouldBeNonNull("badParamsTouch"); |
| shouldBeNull("badParamsTouch.target"); |
| shouldBe("badParamsTouch.identifier", "0"); |
| -shouldBe("badParamsTouch.pageX", "0"); |
| -shouldBe("badParamsTouch.pageY", "0"); |
| -shouldBe("badParamsTouch.screenX", "0"); |
| -shouldBe("badParamsTouch.screenY", "104"); |
| +shouldBe("badParamsTouch.pageX", "100"); |
| +shouldBe("badParamsTouch.pageY", "101"); |
| +shouldBe("badParamsTouch.screenX", "102"); |
| +shouldBe("badParamsTouch.screenY", "103"); |
| shouldBe("badParamsTouch.radiusX", "0"); |
| shouldBe("badParamsTouch.radiusY", "0"); |
| shouldBe("badParamsTouch.rotationAngle", "0"); |
| @@ -65,19 +69,20 @@ shouldBe("badParamsTouch.force", "0"); |
| // Should not crash when invoked on a detached Document. |
| var detachedTouch; |
| -shouldBeNonNull("detachedTouch = document.implementation.createDocument('a', 'b').createTouch()"); |
| -shouldBeNull("detachedTouch.target"); |
| -shouldBe("detachedTouch.identifier", "0"); |
| -shouldBe("detachedTouch.pageX", "0"); |
| -shouldBe("detachedTouch.pageY", "0"); |
| -shouldBe("detachedTouch.screenX", "0"); |
| -shouldBe("detachedTouch.screenY", "0"); |
| +shouldBeNonNull("detachedTouch = document.implementation.createDocument('a', 'b').createTouch(window, target, 1, 100, 101, 102, 103)"); |
|
foolip
2017/03/21 08:01:13
This was a crash test, so it's probably best to pr
lunalu1
2017/03/21 19:19:27
Done.
|
| +shouldBeNonNull("detachedTouch.target"); |
| +shouldBe("detachedTouch.identifier", "1"); |
| +shouldBe("detachedTouch.pageX", "100"); |
| +shouldBe("detachedTouch.pageY", "101"); |
| +shouldBe("detachedTouch.screenX", "102"); |
| +shouldBe("detachedTouch.screenY", "103"); |
| shouldBe("detachedTouch.radiusX", "0"); |
| shouldBe("detachedTouch.radiusY", "0"); |
| shouldBe("detachedTouch.rotationAngle", "0"); |
| shouldBe("detachedTouch.force", "0"); |
| isSuccessfullyParsed(); |
| + |
| </script> |
| </body> |
| </html> |