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:
@@ -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
|
||||
24
engine/src/flutter/tests/events/gesture-events.sky
Normal file
24
engine/src/flutter/tests/events/gesture-events.sky
Normal 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>
|
||||
Reference in New Issue
Block a user