Chromium Code Reviews| Index: chrome/test/data/webui/i18n_process_css_test.html |
| diff --git a/chrome/test/data/webui/i18n_process_css_test.html b/chrome/test/data/webui/i18n_process_css_test.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a2b93eb1930c0c6f701171d4ad58d11ede0acf4a |
| --- /dev/null |
| +++ b/chrome/test/data/webui/i18n_process_css_test.html |
| @@ -0,0 +1,32 @@ |
| +<!doctype html> |
| +<html> |
|
esprehn
2015/07/21 23:42:02
You can leave out html and body.
Dan Beam
2015/07/22 00:15:40
Done.
|
| + <style> |
| + <include src="../../../../ui/webui/resources/css/i18n_process.css"> |
| + </style> |
| + <body> |
| + <h1 i18n-content="buy"></h1> |
| + <span i18n-values=".innerHTML:link"></span> |
| + <script> |
| +function testI18nProcess_NbspPlaceholder() { |
| + var h1 = document.querySelector('h1'); |
| + var span = document.querySelector('span'); |
| + |
| + assertFalse(document.documentElement.hasAttribute('i18n-processed')); |
| + assertEquals('', h1.textContent); |
| + assertEquals('', span.textContent); |
| + |
| + /* We can't check that the non-breaking space hack actually works because it |
| + * uses :psuedo-elements that are inaccessible to the DOM. Let's just check |
| + * that they're not auto-collapsed. */ |
| + assertNotEqual(0, h1.offsetHeight); |
| + assertNotEqual(0, span.offsetHeight); |
| + |
| + h1.removeAttribute('i18n-content'); |
| + assertEquals(0, h1.offsetHeight); |
| + |
| + span.removeAttribute('i18n-values'); |
| + assertEquals(0, span.offsetHeight); |
| +} |
| + </script> |
|
esprehn
2015/07/21 23:42:02
and then not indent any of this
Dan Beam
2015/07/22 00:15:40
Done.
|
| + </body> |
| +</html> |