Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: chrome/test/data/webui/i18n_process_test.html

Issue 1234753002: Revert "Teach i18nTemplate.process() to handle <link rel=import> and <template>" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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">&lt;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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698