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

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

Issue 2938473002: [MD settings] allow unicode nbsp in i18n behavior strings (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | ui/webui/resources/js/i18n_behavior.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/i18n_behavior_test.html
diff --git a/chrome/test/data/webui/i18n_behavior_test.html b/chrome/test/data/webui/i18n_behavior_test.html
index 0bd41fd844a132997550f218ad2cce148c25ec27..7a3a6ca4b0257398b06248d1a1feb808dc1bba0f 100644
--- a/chrome/test/data/webui/i18n_behavior_test.html
+++ b/chrome/test/data/webui/i18n_behavior_test.html
@@ -3,20 +3,28 @@
<body>
<script>
+/* Execute these tests with the browser_tests executable. */
+
+var allowedByDefault = '<a href="https://google.com">Google!</a>';
+var text = 'I\'m just text, nobody should have a problem with me!';
+var nonBreakingSpace = 'A\u00a0B'; // 0xa0 is a unicode nbsp.
+
function setUpPage() {
loadTimeData.data = {
- 'allowedByDefault': '<a href="https://google.com">Google!</a>',
+ 'allowedByDefault': allowedByDefault,
'customAttr': '<a is="action-link">Take action!</a>',
'customTag': "<x-foo>I'm an X, foo!</x-foo>",
'javascriptHref': '<a href="javascript:alert(1)">teh hax</a>',
'script': '<script>alert(/xss/)</scr' + 'ipt>',
- 'text': "I'm just text, nobody should have a problem with me!",
+ 'text': text,
+ 'nonBreakingSpace': nonBreakingSpace,
};
}
function testI18n() {
- I18nBehavior.i18n('allowedByDefault');
- I18nBehavior.i18n('text');
+ assertEquals(allowedByDefault, I18nBehavior.i18n('allowedByDefault'));
+ assertEquals(text, I18nBehavior.i18n('text'));
+ assertEquals(nonBreakingSpace, I18nBehavior.i18n('nonBreakingSpace'));
assertThrows(function() { I18nBehavior.i18n('customAttr'); });
assertThrows(function() { I18nBehavior.i18n('customTag'); });
@@ -39,7 +47,7 @@ function testI18nExists() {
assertTrue(I18nBehavior.i18nExists('text'));
assertFalse(I18nBehavior.i18nExists('missingText'));
}
-
+
</script>
</body>
</html>
« no previous file with comments | « no previous file | ui/webui/resources/js/i18n_behavior.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698