| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title i18n-content="title"></title> | |
| 5 <link rel="import" href="data:text/html, | |
| 6 <link rel=import href='data:text/html,<div i18n-content=nested>'>"> | |
| 7 </head> | |
| 8 <body i18n-values="type:type"> | |
| 9 <span i18n-values=".innerHTML:content;.style.display:display"><3</span> | |
| 10 <template> | |
| 11 <template> | |
| 12 <div i18n-content="nested"></div> | |
| 13 </template> | |
| 14 </template> | |
| 15 <script> | |
| 16 function setUpPage() { | |
| 17 loadTimeData.data = { | |
| 18 'content': "doesn't matter; you can't see me!", | |
| 19 'display': 'none', | |
| 20 'title': 'BUY NOW!', | |
| 21 'type': 'ectomorph', | |
| 22 'nested': 'real deep', | |
| 23 }; | |
| 24 i18nTemplate.process(document, loadTimeData); | |
| 25 } | |
| 26 | |
| 27 function testI18nProcess_Attributes() { | |
| 28 assertNotEqual(0, document.title.length); | |
| 29 assertTrue(document.body.hasAttribute('type')); | |
| 30 assertTrue(document.querySelector('span').textContent.length > 5); | |
| 31 assertEquals('none', document.querySelector('span').style.display); | |
| 32 } | |
| 33 | |
| 34 function testI18nProcess_Imports() { | |
| 35 var outerImportDoc = document.querySelector('link').import; | |
| 36 console.log(outerImportDoc.documentElement.outerHTML); | |
| 37 var innerImportDoc = outerImportDoc.querySelector('link').import; | |
| 38 assertNotEqual(0, innerImportDoc.querySelector('div').textContent.length); | |
| 39 } | |
| 40 | |
| 41 function testI18nProcess_Templates() { | |
| 42 var outerDocFrag = document.querySelector('template').content; | |
| 43 var innerDocFrag = outerDocFrag.querySelector('template').content; | |
| 44 assertNotEqual(0, innerDocFrag.querySelector('div').textContent.length); | |
| 45 } | |
| 46 </script> | |
| 47 </body> | |
| 48 </html> | |
| OLD | NEW |