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 | 6 |
7 '''Unit tests for grit.format.policy_templates.writers.reg_writer''' | 7 '''Unit tests for grit.format.policy_templates.writers.reg_writer''' |
8 | 8 |
9 | 9 |
10 import os | 10 import os |
(...skipping 30 matching lines...) Expand all Loading... | |
41 grd = self.PrepareTest( | 41 grd = self.PrepareTest( |
42 '{' | 42 '{' |
43 ' "policy_definitions": [],' | 43 ' "policy_definitions": [],' |
44 ' "placeholders": [],' | 44 ' "placeholders": [],' |
45 ' "messages": {}' | 45 ' "messages": {}' |
46 '}') | 46 '}') |
47 output = self.GetOutput(grd, 'fr', {'_chromium': '1', }, 'reg', 'en') | 47 output = self.GetOutput(grd, 'fr', {'_chromium': '1', }, 'reg', 'en') |
48 expected_output = 'Windows Registry Editor Version 5.00' | 48 expected_output = 'Windows Registry Editor Version 5.00' |
49 self.CompareOutputs(output, expected_output) | 49 self.CompareOutputs(output, expected_output) |
50 | 50 |
51 def testEmptyVersion(self): | |
52 # Test the handling of an empty policy list. | |
53 grd = self.PrepareTest( | |
54 '{' | |
55 ' "policy_definitions": [],' | |
56 ' "placeholders": [],' | |
57 ' "messages": {}' | |
58 '}') | |
59 output = self.GetOutput(grd, 'fr', {'_chromium': '1', 'version': '39.0.0.0', }, 'reg', 'en') | |
pastarmovj
2014/10/07 14:54:36
same.
cschuet1
2014/10/07 15:42:47
Done.
| |
60 expected_output = ('Windows Registry Editor Version 5.00\r\n' | |
61 '; chromium version: 39.0.0.0') | |
62 self.CompareOutputs(output, expected_output) | |
63 | |
51 def testMainPolicy(self): | 64 def testMainPolicy(self): |
52 # Tests a policy group with a single policy of type 'main'. | 65 # Tests a policy group with a single policy of type 'main'. |
53 grd = self.PrepareTest( | 66 grd = self.PrepareTest( |
54 '{' | 67 '{' |
55 ' "policy_definitions": [' | 68 ' "policy_definitions": [' |
56 ' {' | 69 ' {' |
57 ' "name": "MainPolicy",' | 70 ' "name": "MainPolicy",' |
58 ' "type": "main",' | 71 ' "type": "main",' |
59 ' "features": { "can_be_recommended": True },' | 72 ' "features": { "can_be_recommended": True },' |
60 ' "caption": "",' | 73 ' "caption": "",' |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 '"Policy2"="c"', | 382 '"Policy2"="c"', |
370 '', | 383 '', |
371 '[HKEY_LOCAL_MACHINE\\Software\\Policies\\Chromium\\Policy1]', | 384 '[HKEY_LOCAL_MACHINE\\Software\\Policies\\Chromium\\Policy1]', |
372 '"1"="a"', | 385 '"1"="a"', |
373 '"2"="b"']) | 386 '"2"="b"']) |
374 self.CompareOutputs(output, expected_output) | 387 self.CompareOutputs(output, expected_output) |
375 | 388 |
376 | 389 |
377 if __name__ == '__main__': | 390 if __name__ == '__main__': |
378 unittest.main() | 391 unittest.main() |
OLD | NEW |