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

Unified Diff: grit/format/html_inline_unittest.py

Issue 1002663003: Raises an exception when an unexpected </if> occurs (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 5 years, 9 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 | « grit/format/html_inline.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/html_inline_unittest.py
===================================================================
--- grit/format/html_inline_unittest.py (revision 188)
+++ grit/format/html_inline_unittest.py (working copy)
@@ -78,6 +78,28 @@
self.failUnlessEqual(resources, source_resources)
tmp_dir.CleanUp()
+ def testUnmatchedEndIfBlock(self):
+ '''Tests that an unmatched </if> raises an exception.'''
+
+ files = {
+ 'index.html': '''
+ <!DOCTYPE HTML>
+ <html>
+ <if expr="lang == 'fr'">
+ bonjour
+ </if>
+ </if>
+ </html>
+ ''',
+ }
+
+ tmp_dir = util.TempDir(files)
+
+ with self.assertRaises(Exception) as cm:
+ html_inline.GetResourceFilenames(tmp_dir.GetPath('index.html'))
+ self.failUnlessEqual(cm.exception.message, 'Unmatched </if>')
+ tmp_dir.CleanUp()
+
def testCompressedJavaScript(self):
'''Tests that ".src=" doesn't treat as a tag.'''
« no previous file with comments | « grit/format/html_inline.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698