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

Unified Diff: grit/gather/chrome_html_unittest.py

Issue 10795100: Accept CSS url()s without quotes. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 8 years, 5 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/gather/chrome_html.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.'''
« no previous file with comments | « grit/gather/chrome_html.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698