OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 '''Unit tests for misc.GritNode''' | 6 '''Unit tests for misc.GritNode''' |
7 | 7 |
8 | 8 |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 <messages> | 171 <messages> |
172 <message name="IDS_BINGO"> | 172 <message name="IDS_BINGO"> |
173 Bingo | 173 Bingo |
174 </message> | 174 </message> |
175 </messages> | 175 </messages> |
176 <structures> | 176 <structures> |
177 <structure type="menu" name="IDC_KLONKMENU" encoding="utf-16" file="
klonk.rc" /> | 177 <structure type="menu" name="IDC_KLONKMENU" encoding="utf-16" file="
klonk.rc" /> |
178 </structures> | 178 </structures> |
179 </release> | 179 </release> |
180 </grit>'''), util.PathFromRoot('grit/testdata')) | 180 </grit>'''), util.PathFromRoot('grit/testdata')) |
| 181 grd.SetOutputContext('en', {}) |
181 grd.RunGatherers(recursive=True) | 182 grd.RunGatherers(recursive=True) |
182 | 183 |
183 hello = grd.GetNodeById('IDS_HELLO') | 184 hello = grd.GetNodeById('IDS_HELLO') |
184 aboutbox = grd.GetNodeById('IDD_ABOUTBOX') | 185 aboutbox = grd.GetNodeById('IDD_ABOUTBOX') |
185 bingo = grd.GetNodeById('IDS_BINGO') | 186 bingo = grd.GetNodeById('IDS_BINGO') |
186 menu = grd.GetNodeById('IDC_KLONKMENU') | 187 menu = grd.GetNodeById('IDC_KLONKMENU') |
187 | 188 |
188 for node in [hello, aboutbox]: | 189 for node in [hello, aboutbox]: |
189 self.failUnless(not node.PseudoIsAllowed()) | 190 self.failUnless(not node.PseudoIsAllowed()) |
190 | 191 |
(...skipping 11 matching lines...) Expand all Loading... |
202 for node in [bingo, menu]: | 203 for node in [bingo, menu]: |
203 try: | 204 try: |
204 formatter = node.ItemFormatter('rc_all') | 205 formatter = node.ItemFormatter('rc_all') |
205 formatter.Format(node, 'xyz-pseudo') | 206 formatter.Format(node, 'xyz-pseudo') |
206 except: | 207 except: |
207 self.fail('Should not have gotten exception since pseudo is allowed') | 208 self.fail('Should not have gotten exception since pseudo is allowed') |
208 | 209 |
209 | 210 |
210 if __name__ == '__main__': | 211 if __name__ == '__main__': |
211 unittest.main() | 212 unittest.main() |
OLD | NEW |