Chromium Code Reviews| Index: grit/node/misc_unittest.py |
| diff --git a/grit/node/misc_unittest.py b/grit/node/misc_unittest.py |
| index b353edb0b7a889271b8e0becf91d0e7f2483e342..c6cb26bad4249d378fd1e7774bffe006c4f03563 100644 |
| --- a/grit/node/misc_unittest.py |
| +++ b/grit/node/misc_unittest.py |
| @@ -53,6 +53,34 @@ class GritNodeUnittest(unittest.TestCase): |
| }) |
| self.assertEqual({}, id_dict.get('devtools.grd', None)) |
| + # Verifies that GetInputFiles() returns the correct list of files |
| + # corresponding to ChromeScaledImage nodes when assets are missing. |
| + def testGetInputFilesChromeScaledImage(self): |
| + xml = '''<?xml version="1.0" encoding="utf-8"?> |
| + <grit latest_public_release="0" current_release="1"> |
| + <outputs> |
| + <output filename="default.pak" type="data_package" context="default_100_percent" /> |
| + <output filename="special.pak" type="data_package" context="special_100_percent" fallback_to_default_layout="false" /> |
| + </outputs> |
| + <release seq="1"> |
| + <structures fallback_to_low_resolution="true"> |
| + <structure type="chrome_scaled_image" name="IDR_A" file="a.png" /> |
| + <structure type="chrome_scaled_image" name="IDR_B" file="b.png" /> |
| + </structures> |
| + </release> |
| + </grit>''' |
| + |
| + grd = grd_reader.Parse(StringIO.StringIO(xml), util.PathFromRoot('grit/testdata')) |
| + input_files = grd.GetInputFiles() |
| + expected = ['default_100_percent/a.png', 'default_100_percent/b.png', 'special_100_percent/a.png'] |
| + actual = [] |
| + for file in input_files: |
| + split = file.split('/') |
| + actual.append(split[-2] + '/' + split[-1]) |
|
flackr
2015/06/26 19:45:21
Is this to convert a full path to the last 2 compo
|
| + |
| + self.assertEquals(expected, actual) |
| + |
| + |
| class IfNodeUnittest(unittest.TestCase): |
| def testIffyness(self): |
| grd = grd_reader.Parse(StringIO.StringIO(''' |