OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2013 Google Inc. All rights reserved. | 3 # Copyright (c) 2013 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Make sure binary is relinked when manifest settings are changed. | 8 Make sure binary is relinked when manifest settings are changed. |
9 """ | 9 """ |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 }, | 68 }, |
69 }, | 69 }, |
70 }, | 70 }, |
71 ], | 71 ], |
72 } | 72 } |
73 ''' | 73 ''' |
74 | 74 |
75 gypfile = 'update-manifest.gyp' | 75 gypfile = 'update-manifest.gyp' |
76 | 76 |
77 def WriteAndUpdate(uac_execution_level, additional_manifest_files, do_build): | 77 def WriteAndUpdate(uac_execution_level, additional_manifest_files, do_build): |
78 with open(os.path.join(CHDIR, gypfile), 'wb') as f: | 78 with open(os.path.join(CHDIR, gypfile), 'w') as f: |
79 f.write(gyp_template % { | 79 f.write(gyp_template % { |
80 'uac_execution_level': uac_execution_level, | 80 'uac_execution_level': uac_execution_level, |
81 'additional_manifest_files': additional_manifest_files, | 81 'additional_manifest_files': additional_manifest_files, |
82 }) | 82 }) |
83 test.run_gyp(gypfile, chdir=CHDIR) | 83 test.run_gyp(gypfile, chdir=CHDIR) |
84 if do_build: | 84 if do_build: |
85 test.build(gypfile, chdir=CHDIR) | 85 test.build(gypfile, chdir=CHDIR) |
86 exe_file = test.built_file_path('test_update_manifest.exe', chdir=CHDIR) | 86 exe_file = test.built_file_path('test_update_manifest.exe', chdir=CHDIR) |
87 return extract_manifest(exe_file, 1) | 87 return extract_manifest(exe_file, 1) |
88 | 88 |
89 manifest = WriteAndUpdate(0, '', True) | 89 manifest = WriteAndUpdate(0, '', True) |
90 test.fail_test('asInvoker' not in manifest) | 90 test.fail_test('asInvoker' not in manifest) |
91 test.fail_test('35138b9a-5d96-4fbd-8e2d-a2440225f93a' in manifest) | 91 test.fail_test('35138b9a-5d96-4fbd-8e2d-a2440225f93a' in manifest) |
92 | 92 |
93 # Make sure that updating .gyp and regenerating doesn't cause a rebuild. | 93 # Make sure that updating .gyp and regenerating doesn't cause a rebuild. |
94 WriteAndUpdate(0, '', False) | 94 WriteAndUpdate(0, '', False) |
95 test.up_to_date(gypfile, test.ALL, chdir=CHDIR) | 95 test.up_to_date(gypfile, test.ALL, chdir=CHDIR) |
96 | 96 |
97 # But make sure that changing a manifest property does cause a relink. | 97 # But make sure that changing a manifest property does cause a relink. |
98 manifest = WriteAndUpdate(2, '', True) | 98 manifest = WriteAndUpdate(2, '', True) |
99 test.fail_test('requireAdministrator' not in manifest) | 99 test.fail_test('requireAdministrator' not in manifest) |
100 | 100 |
101 # Adding a manifest causes a rebuild. | 101 # Adding a manifest causes a rebuild. |
102 manifest = WriteAndUpdate(2, 'extra.manifest', True) | 102 manifest = WriteAndUpdate(2, 'extra.manifest', True) |
103 test.fail_test('35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in manifest) | 103 test.fail_test('35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in manifest) |
OLD | NEW |