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

Unified Diff: sky/tests/framework/templates.sky

Issue 845283003: Allow on-* event handlers on <sky-element>. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: s p a c i n g Created 5 years, 11 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 | « sky/framework/sky-radio/sky-radio.sky ('k') | sky/tests/framework/templates-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/framework/templates.sky
diff --git a/sky/tests/framework/templates.sky b/sky/tests/framework/templates.sky
index f34657159ac810eae5fc92765dddcf9728a1b3f4..aca46d80f4473f5b34c26c98c3c63e6c823d71b1 100644
--- a/sky/tests/framework/templates.sky
+++ b/sky/tests/framework/templates.sky
@@ -131,7 +131,7 @@ describe("SkyElement", function() {
});
});
- it("should connect event handlers", function() {
+ it("should connect template event handlers", function() {
sandbox.appendChild(element);
var inside = element.shadowRoot.getElementById("inside");
inside.dispatchEvent(new CustomEvent("wrong-event"));
@@ -141,6 +141,15 @@ describe("SkyElement", function() {
assert.equal(element.lastEvent, event);
});
+ it("should connect host event handlers", function() {
+ sandbox.appendChild(element);
+ element.dispatchEvent(new CustomEvent("wrong-event"));
+ assert.isNull(element.lastEvent);
+ var event = new CustomEvent("host-event");
+ element.dispatchEvent(event);
+ assert.equal(element.lastEvent, event);
+ });
+
it("should call shadowRootReady after creating the template instance", function() {
assert.equal(element.shadowRootReadyCount, 0);
sandbox.appendChild(element);
« no previous file with comments | « sky/framework/sky-radio/sky-radio.sky ('k') | sky/tests/framework/templates-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698