| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title>Template with HTMLImports Test</title> |
| 14 <script src="../../template/template.js"></script> |
| 15 <script src="../../html-imports/src/html-imports.js"></script> |
| 16 <script> |
| 17 // WCT = { |
| 18 // waitFor: function(callback) { |
| 19 // this.HTMLImports.whenReady(callback); |
| 20 // } |
| 21 // }; |
| 22 </script> |
| 23 <script src="../../web-component-tester/browser.js"></script> |
| 24 </head> |
| 25 <body> |
| 26 <template id="one"> |
| 27 <link rel="import" href="imports/script-1.html"> |
| 28 </template> |
| 29 |
| 30 <template id="two"> |
| 31 <link rel="import" href="imports/csp-import-1.html"> |
| 32 </template> |
| 33 |
| 34 <script> |
| 35 suite('basic', function() { |
| 36 var templateOne; |
| 37 var templateTwo; |
| 38 |
| 39 setup(function() { |
| 40 templateOne = document.querySelector('template#one'); |
| 41 templateTwo = document.querySelector('template#two'); |
| 42 }); |
| 43 |
| 44 teardown(function() { |
| 45 window.remoteCurrentScriptExecuted = undefined; |
| 46 window.externalScriptParsed1 = undefined; |
| 47 }); |
| 48 |
| 49 test('links are not imported before stamping', function() { |
| 50 assert.equal(window.remoteCurrentScriptExecuted, undefined); |
| 51 assert.equal(window.externalScriptParsed1, undefined); |
| 52 }); |
| 53 |
| 54 test('links are imported when stamped', function(done) { |
| 55 document.head.appendChild(document.importNode(templateTwo.content, tru
e)); |
| 56 |
| 57 var imp = document.querySelector('[href="imports/csp-import-1.html"]')
; |
| 58 imp.addEventListener('load', function() { |
| 59 assert.ok(window.externalScriptParsed1); |
| 60 done(); |
| 61 }); |
| 62 }); |
| 63 }); |
| 64 </script> |
| 65 </body> |
| 66 </html> |
| OLD | NEW |