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

Unified Diff: grit/gather/chrome_scaled_image_unittest.py

Issue 1194063002: grit: Add fallback_to_default_layout attribute to <output> (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: for landing Created 5 years, 6 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_scaled_image.py ('k') | grit/node/include.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/gather/chrome_scaled_image_unittest.py
diff --git a/grit/gather/chrome_scaled_image_unittest.py b/grit/gather/chrome_scaled_image_unittest.py
index 957326edc02bf465fb250e6f73410061e9c8dd0e..4b0bbfcccd5ee248fd3692145f04ad750591fb26 100644
--- a/grit/gather/chrome_scaled_image_unittest.py
+++ b/grit/gather/chrome_scaled_image_unittest.py
@@ -79,11 +79,12 @@ def _If(expr, *body):
return '<if expr="%s">\n%s\n</if>' % (expr, '\n'.join(body))
-def _RunBuildTest(self, structures, inputs, expected_outputs, skip_rc=False):
- outputs = '\n'.join('<output filename="out/%s%s" type="%s" context="%s" />'
- % (context, ext, type, context)
+def _RunBuildTest(self, structures, inputs, expected_outputs, skip_rc=False, layout_fallback=''):
+ outputs = '\n'.join('<output filename="out/%s%s" type="%s" context="%s"%s />'
+ % (context, ext, type, context, layout_fallback)
for ext, type in _OUTFILETYPES
for context in expected_outputs)
+
infiles = {
'in/in.grd': '''<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1">
@@ -172,3 +173,21 @@ class ChromeScaledImageUnittest(unittest.TestCase):
),
{}, # no files
{'tactile_123_percent': 'should fail before using this'})
+
+ def testNoFallbackToDefaultLayout(self):
+ d123a = _MakePNG([('AbCd', '')])
+ t123a = _MakePNG([('EfGh', '')])
+ d123b = _MakePNG([('IjKl', '')])
+ _RunBuildTest(self,
+ _Structures(None,
+ _Structure('IDR_A', 'a.png'),
+ _Structure('IDR_B', 'b.png'),
+ ),
+ {'default_123_percent/a.png': d123a,
+ 'tactile_123_percent/a.png': t123a,
+ 'default_123_percent/b.png': d123b,
+ },
+ {'default_123_percent': set([d123a, d123b]),
+ 'tactile_123_percent': set([t123a]),
+ },
+ layout_fallback=' fallback_to_default_layout="false"')
« no previous file with comments | « grit/gather/chrome_scaled_image.py ('k') | grit/node/include.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698