mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
22 lines
576 B
HTML
22 lines
576 B
HTML
<html>
|
|
<link rel="import" href="../resources/chai.html" />
|
|
<link rel="import" href="../resources/mocha.html" />
|
|
<body>
|
|
<div id="container"></div>
|
|
<script>
|
|
describe('Custom element constructors', function() {
|
|
it('should run the createdCallback synchronously', function() {
|
|
var proto = Object.create(HTMLElement.prototype);
|
|
var ncallbacks = 0;
|
|
proto.createdCallback = function () {
|
|
ncallbacks++;
|
|
};
|
|
var A = document.registerElement('x-a', {prototype: proto});
|
|
var x = new A();
|
|
assert.equal(ncallbacks, 1);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|