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

Unified Diff: LayoutTests/fast/events/touch/document-create-touch.html

Issue 1149233003: Exposed unprefixed Touch.rotationAngle to web. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/document-create-touch-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/touch/document-create-touch.html
diff --git a/LayoutTests/fast/events/touch/document-create-touch.html b/LayoutTests/fast/events/touch/document-create-touch.html
index 051d401a7d189a848cddb75713e593cc93301956..ab628e90de19f6e198480f962c5074ee120e98ce 100644
--- a/LayoutTests/fast/events/touch/document-create-touch.html
+++ b/LayoutTests/fast/events/touch/document-create-touch.html
@@ -11,6 +11,89 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/document-create-touch.js"></script>
+<script>
+description("This tests support for the document.createTouch API.");
+
+shouldBeTrue('"createTouch" in document');
+
+var box = document.createElement("div");
+box.id = "box";
+box.style.width = "100px";
+box.style.height = "100px";
+document.body.appendChild(box);
+
+var target = document.getElementById("box");
+var touch = document.createTouch(window, target, 1, 100, 101, 102, 103, 5, 3, 10, 10);
+shouldBeNonNull("touch");
+shouldBe("touch.target", "box");
+shouldBe("touch.identifier", "1");
+shouldBe("touch.pageX", "100");
+shouldBe("touch.pageY", "101");
+shouldBe("touch.screenX", "102");
+shouldBe("touch.screenY", "103");
+shouldBe("touch.radiusX", "5");
+shouldBe("touch.radiusY", "3");
+shouldBe("touch.rotationAngle", "10");
+shouldBe("touch.force", "10");
+shouldBe("touch.webkitRadiusX", "5");
+shouldBe("touch.webkitRadiusY", "3");
+shouldBe("touch.webkitRotationAngle", "10");
+shouldBe("touch.webkitForce", "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");
+shouldBe("emptyTouch.webkitRadiusX", "0");
+shouldBe("emptyTouch.webkitRadiusY", "0");
+shouldBe("emptyTouch.webkitRotationAngle", "0");
+shouldBe("emptyTouch.webkitForce", "0");
+
+// 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');
+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.radiusX", "0");
+shouldBe("badParamsTouch.radiusY", "0");
+shouldBe("badParamsTouch.rotationAngle", "0");
+shouldBe("badParamsTouch.force", "0");
+shouldBe("badParamsTouch.webkitRadiusX", "0");
+shouldBe("badParamsTouch.webkitRadiusY", "0");
+shouldBe("badParamsTouch.webkitRotationAngle", "0");
+shouldBe("badParamsTouch.webkitForce", "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");
+shouldBe("detachedTouch.radiusX", "0");
+shouldBe("detachedTouch.radiusY", "0");
+shouldBe("detachedTouch.rotationAngle", "0");
+shouldBe("detachedTouch.force", "0");
+shouldBe("detachedTouch.webkitRadiusX", "0");
+shouldBe("detachedTouch.webkitRadiusY", "0");
+shouldBe("detachedTouch.webkitRotationAngle", "0");
+shouldBe("detachedTouch.webkitForce", "0");
+
+isSuccessfullyParsed();
+</script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/document-create-touch-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698