Index: grit/gather/chrome_html_unittest.py |
diff --git a/grit/gather/chrome_html_unittest.py b/grit/gather/chrome_html_unittest.py |
index c65236ce6ba19fbecd00c5c653ff9a52a7dc0117..a0a8e46cc36c5882ef0f482f55f9ad01bbf4df8a 100644 |
--- a/grit/gather/chrome_html_unittest.py |
+++ b/grit/gather/chrome_html_unittest.py |
@@ -111,6 +111,54 @@ class ChromeHtmlUnittest(unittest.TestCase): |
''')) |
tmp_dir.CleanUp() |
+ def testFileResourcesDoubleQuotes(self): |
+ '''Tests inlined image file resources if url() filename is double quoted.''' |
+ |
+ tmp_dir = util.TempDir({ |
+ 'test.css': ''' |
+ .image { |
+ background: url("test.png"); |
+ } |
+ ''', |
+ |
+ 'test.png': 'PNG DATA', |
+ }) |
+ |
+ html = chrome_html.ChromeHtml(tmp_dir.GetPath('test.css')) |
+ html.SetAttributes({'flattenhtml': 'true'}) |
+ html.Parse() |
+ self.failUnlessEqual(StandardizeHtml(html.GetData('en', 'utf-8')), |
+ StandardizeHtml(''' |
+ .image { |
+ background: -webkit-image-set(url("data:image/png;base64,UE5HIERBVEE=") 1x); |
+ } |
+ ''')) |
+ tmp_dir.CleanUp() |
+ |
+ def testFileResourcesNoQuotes(self): |
+ '''Tests inlined image file resources when url() filename is unquoted.''' |
+ |
+ tmp_dir = util.TempDir({ |
+ 'test.css': ''' |
+ .image { |
+ background: url(test.png); |
+ } |
+ ''', |
+ |
+ 'test.png': 'PNG DATA', |
+ }) |
+ |
+ html = chrome_html.ChromeHtml(tmp_dir.GetPath('test.css')) |
+ html.SetAttributes({'flattenhtml': 'true'}) |
+ html.Parse() |
+ self.failUnlessEqual(StandardizeHtml(html.GetData('en', 'utf-8')), |
+ StandardizeHtml(''' |
+ .image { |
+ background: -webkit-image-set(url("data:image/png;base64,UE5HIERBVEE=") 1x); |
+ } |
+ ''')) |
+ tmp_dir.CleanUp() |
+ |
def testFileResourcesNoFile(self): |
'''Tests inlined image file resources without available high DPI assets.''' |