| Index: appengine/config_service/ui/bower_components/webcomponentsjs/tests/template-and-CE.html
|
| diff --git a/appengine/config_service/ui/bower_components/webcomponentsjs/tests/template-and-CE.html b/appengine/config_service/ui/bower_components/webcomponentsjs/tests/template-and-CE.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..45f95881bf35feea381c87a8b938940c65da46c5
|
| --- /dev/null
|
| +++ b/appengine/config_service/ui/bower_components/webcomponentsjs/tests/template-and-CE.html
|
| @@ -0,0 +1,72 @@
|
| +<!doctype html>
|
| +<!--
|
| +@license
|
| +Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
| +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
| +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
| +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
| +Code distributed by Google as part of the polymer project is also
|
| +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
| +-->
|
| +<html>
|
| + <head>
|
| + <title>Template with HTMLImports Test</title>
|
| + <script src="../../template/template.js"></script>
|
| + <script src="../../custom-elements/custom-elements.min.js"></script>
|
| + <script src="../../web-component-tester/browser.js"></script>
|
| + </head>
|
| + <body>
|
| +<body>
|
| +
|
| + <template>
|
| + <x-child></x-child>
|
| + </template>
|
| +
|
| + <template id="before"></template>
|
| + <x-after></x-after>
|
| +
|
| + <script>
|
| + var created = [];
|
| + var attached = [];
|
| + var childCreated = false;
|
| + var foundTemplate = false;
|
| +
|
| + class XChild extends HTMLElement {
|
| + constructor() {
|
| + super();
|
| + this.custom = true;
|
| + childCreated = true;
|
| + }
|
| + }
|
| +
|
| + class XAfter extends HTMLElement {
|
| + constructor() {
|
| + super();
|
| + this.custom = true;
|
| +
|
| + var template = document.querySelector('#before');
|
| + if (template && template.content) {
|
| + foundTemplate = true;
|
| + }
|
| + }
|
| + }
|
| +
|
| + // The template polyfill is asynchronous, so on IE11 we shouldn't
|
| + // try to upgrade before it's done its thing.
|
| + document.addEventListener('DOMContentLoaded', function() {
|
| + window.customElements.define('x-child', XChild);
|
| + window.customElements.define('x-after', XAfter);
|
| + });
|
| +
|
| + suite('template and custom elements', function() {
|
| + test('elements within templates not upgraded', function() {
|
| + assert(!childCreated);
|
| + });
|
| +
|
| + test('templates before elements are bootstrapped before createdCallback', function() {
|
| + assert(foundTemplate);
|
| + });
|
| + });
|
| + </script>
|
| + </body>
|
| +</html>
|
|
|