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

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

Issue 2926573003: [MD settings] allow unicode nbsp in i18n behavior strings (Closed)
Patch Set: reduced comment 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 bcbad9a1f985315348e475d4578e8d520c4902e0..18eda268153068d874594bb3c351b7c40f441a8f 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'); });
@@ -37,8 +45,7 @@ function testI18nAdvanced() {
function testI18nDynamic() {
var locale = 'en';
- assertEquals("I'm just text, nobody should have a problem with me!",
- I18nBehavior.i18nDynamic(locale, 'text'));
+ assertEquals(text, I18nBehavior.i18nDynamic(locale, 'text'));
}
function testI18nExists() {
« 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