Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/io-element.test.js

Issue 29723623: Issue 6487 - IOElement as base component for ABP UI (Closed)
Patch Set: Created March 15, 2018, 2:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/io-element.test.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/tests/io-element.test.js
@@ -0,0 +1,28 @@
+/* globals module, require */
+
+"use strict";
+
+const IOElement = require("../js/io-element");
+
+class IOClock extends IOElement
+{
+ connectedCallback()
+ {
+ this._timer = setInterval(() => this.render(), 1000);
+ }
+
+ disconnectedCallback()
+ {
+ clearInterval(this._timer);
+ }
+
+ render()
+ {
+ this.html`
+ ${{i18n: "io_clock"}}
+ @${(new Date()).toLocaleTimeString()}
+ `;
+ }
+}
+
+IOClock.define("io-clock");
« js/io-element.js ('K') | « tests/io-element.js ('k') | tests/locale/en_US/common.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld