| 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>
|
|
|