Add support for GestureEvents to Sky

We'll likely change the API over time, but this is a start.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/857533002
This commit is contained in:
Adam Barth
2015-01-16 15:42:01 -08:00
parent 51b30e16fa
commit 100c4ae196
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
Running 2 tests
ok 1 Gesture events should be creatable
ok 2 Gesture events should be dispatchable
2 tests
2 pass
0 fail

View File

@@ -0,0 +1,24 @@
<sky>
<import src="../resources/chai.sky" />
<import src="../resources/mocha.sky" />
<div id="target" />
<script>
describe("Gesture events", function() {
it("should be creatable", function() {
var event = new GestureEvent("tap");
assert.ok(event);
});
it("should be dispatchable", function() {
var div = document.getElementById("target");
var marker = false;
div.addEventListener("tap", function(event) {
assert.instanceOf(event, GestureEvent);
marker = true;
});
div.dispatchEvent(new GestureEvent("tap"));
assert.isTrue(marker);
});
});
</script>
</sky>