| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 /* Execute these tests with the browser_tests executable. */ | 6 /* Execute these tests with the browser_tests executable. */ |
| 7 | 7 |
| 8 var allowedByDefault = '<a href="https://google.com">Google!</a>'; | 8 var allowedByDefault = '<a href="https://google.com">Google!</a>'; |
| 9 var text = 'I\'m just text, nobody should have a problem with me!'; | 9 var text = 'I\'m just text, nobody should have a problem with me!'; |
| 10 var nonBreakingSpace = 'A\u00a0B'; // 0xa0 is a unicode nbsp. | 10 var nonBreakingSpace = 'A\u00a0B\u00a0C'; // \u00a0 is a unicode nbsp. |
| 11 | 11 |
| 12 function setUpPage() { | 12 function setUpPage() { |
| 13 loadTimeData.data = { | 13 loadTimeData.data = { |
| 14 'allowedByDefault': allowedByDefault, | 14 'allowedByDefault': allowedByDefault, |
| 15 'customAttr': '<a is="action-link">Take action!</a>', | 15 'customAttr': '<a is="action-link">Take action!</a>', |
| 16 'customTag': "<x-foo>I'm an X, foo!</x-foo>", | 16 'customTag': "<x-foo>I'm an X, foo!</x-foo>", |
| 17 'javascriptHref': '<a href="javascript:alert(1)">teh hax</a>', | 17 'javascriptHref': '<a href="javascript:alert(1)">teh hax</a>', |
| 18 'script': '<script>alert(/xss/)</scr' + 'ipt>', | 18 'script': '<script>alert(/xss/)</scr' + 'ipt>', |
| 19 'text': text, | 19 'text': text, |
| 20 'nonBreakingSpace': nonBreakingSpace, | 20 'nonBreakingSpace': nonBreakingSpace, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 function testI18nExists() { | 46 function testI18nExists() { |
| 47 assertTrue(I18nBehavior.i18nExists('text')); | 47 assertTrue(I18nBehavior.i18nExists('text')); |
| 48 assertFalse(I18nBehavior.i18nExists('missingText')); | 48 assertFalse(I18nBehavior.i18nExists('missingText')); |
| 49 } | 49 } |
| 50 | 50 |
| 51 </script> | 51 </script> |
| 52 </body> | 52 </body> |
| 53 </html> | 53 </html> |
| OLD | NEW |