This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ <!--
3
+ Copyright 2013 The Polymer Authors. All rights reserved.
4
+ Use of this source code is governed by a BSD-style
5
+ license that can be found in the LICENSE file.
6
+ -->
7
+ < html >
8
+ < head >
9
+ < title > </ title >
10
+ < meta charset ="UTF-8 ">
11
+ < script src ="../../../tools/test/htmltest.js "> </ script >
12
+ < script src ="../../../tools/test/chai/chai.js "> </ script >
13
+ < script src ="../../platform.js " debug > </ script >
14
+ </ head >
15
+ < body >
16
+ < x-foo > </ x-foo >
17
+ < script >
18
+ window . addEventListener ( 'WebComponentsReady' , function ( ) {
19
+ var xfoo = document . querySelector ( 'x-foo' ) ;
20
+ chai . assert . isUndefined ( xfoo . isCreated ) ;
21
+ var link = document . createElement ( 'link' ) ;
22
+ link . rel = 'import' ;
23
+ link . href = 'element-import.html' ;
24
+ document . head . appendChild ( link ) ;
25
+ HTMLImports . whenImportsReady ( function ( ) {
26
+ chai . assert . isTrue ( xfoo . isCreated , 'element in main document, registered in dynamic import is upgraded' ) ;
27
+ var ix = link . import . querySelector ( 'x-foo' ) ;
28
+ chai . assert . isTrue ( ix . isCreated , 'element in import, registered in dynamic import is upgraded' ) ;
29
+ done ( ) ;
30
+ } ) ;
31
+ } ) ;
32
+ </ script >
33
+ </ body >
34
+ </ html >
Original file line number Diff line number Diff line change
1
+ < x-foo > </ x-foo >
2
+ < script >
3
+ ( function ( ) {
4
+ var prototype = Object . create ( HTMLElement . prototype ) ;
5
+
6
+ prototype . createdCallback = function ( ) {
7
+ this . isCreated = true ;
8
+ }
9
+
10
+ document . registerElement ( 'x-foo' , { prototype : prototype } ) ;
11
+ } ) ( ) ;
12
+ </ script >
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ htmlSuite('integration', function() {
17
17
htmlTest ( 'html/smoke.html?shadow®ister' ) ;
18
18
htmlTest ( 'html/mdv-shadow.html' ) ;
19
19
htmlTest ( 'html/template-repeat-wrappers.html' ) ;
20
+ htmlTest ( 'html/ce-import.html' ) ;
21
+ htmlTest ( 'html/ce-import.html?shadow' ) ;
20
22
} ) ;
21
23
22
24
htmlSuite ( 'styling' , function ( ) {
You can’t perform that action at this time.
0 commit comments