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

Unified Diff: chrome/test/data/webui/i18n_process_css_test.html

Issue 1246253002: Convert i18n_process.css to use /deep/ instead of ::shadow and add tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: esprehn@ review 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 side-by-side diff with in-line comments
Download patch
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..85ba748050a79b00836fd88b856f208311820ab7
--- /dev/null
+++ b/chrome/test/data/webui/i18n_process_css_test.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<style>
+<include src="../../../../ui/webui/resources/css/i18n_process.css">
+</style>
+<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>

Powered by Google App Engine
This is Rietveld 408576698