OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2013 Google Inc. All rights reserved. | 3 # Copyright 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 Verifies that embedding UAC information into the manifest works. | 8 Verifies that embedding UAC information into the manifest works. |
9 """ | 9 """ |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 'enable_uac_admin.exe', chdir=CHDIR), 1)) | 61 'enable_uac_admin.exe', chdir=CHDIR), 1)) |
62 | 62 |
63 # Verify that <requestedExecutionLevel level="asInvoker" uiAccess="false" /> | 63 # Verify that <requestedExecutionLevel level="asInvoker" uiAccess="false" /> |
64 # is present. | 64 # is present. |
65 manifest = parseString(extract_manifest( | 65 manifest = parseString(extract_manifest( |
66 test.built_file_path('enable_uac.exe', chdir=CHDIR), 1)) | 66 test.built_file_path('enable_uac.exe', chdir=CHDIR), 1)) |
67 execution_level = manifest.getElementsByTagName('requestedExecutionLevel') | 67 execution_level = manifest.getElementsByTagName('requestedExecutionLevel') |
68 test.fail_test(len(execution_level) != 1) | 68 test.fail_test(len(execution_level) != 1) |
69 execution_level = execution_level[0].attributes | 69 execution_level = execution_level[0].attributes |
70 test.fail_test(not ( | 70 test.fail_test(not ( |
71 execution_level.has_key('level') and | 71 'level' in execution_level and |
72 execution_level.has_key('uiAccess') and | 72 'uiAccess' in execution_level and |
73 execution_level['level'].nodeValue == 'asInvoker' and | 73 execution_level['level'].nodeValue == 'asInvoker' and |
74 execution_level['uiAccess'].nodeValue == 'false')) | 74 execution_level['uiAccess'].nodeValue == 'false')) |
75 | 75 |
76 # Verify that <requestedExecutionLevel> is not in the menifest. | 76 # Verify that <requestedExecutionLevel> is not in the menifest. |
77 manifest = parseString(extract_manifest( | 77 manifest = parseString(extract_manifest( |
78 test.built_file_path('enable_uac_no.exe', chdir=CHDIR), 1)) | 78 test.built_file_path('enable_uac_no.exe', chdir=CHDIR), 1)) |
79 execution_level = manifest.getElementsByTagName('requestedExecutionLevel') | 79 execution_level = manifest.getElementsByTagName('requestedExecutionLevel') |
80 test.fail_test(len(execution_level) != 0) | 80 test.fail_test(len(execution_level) != 0) |
81 | 81 |
82 # Verify that <requestedExecutionLevel level="requireAdministrator" | 82 # Verify that <requestedExecutionLevel level="requireAdministrator" |
83 # uiAccess="true" /> is present. | 83 # uiAccess="true" /> is present. |
84 manifest = parseString(extract_manifest( | 84 manifest = parseString(extract_manifest( |
85 test.built_file_path('enable_uac_admin.exe', chdir=CHDIR), 1)) | 85 test.built_file_path('enable_uac_admin.exe', chdir=CHDIR), 1)) |
86 execution_level = manifest.getElementsByTagName('requestedExecutionLevel') | 86 execution_level = manifest.getElementsByTagName('requestedExecutionLevel') |
87 test.fail_test(len(execution_level) != 1) | 87 test.fail_test(len(execution_level) != 1) |
88 execution_level = execution_level[0].attributes | 88 execution_level = execution_level[0].attributes |
89 test.fail_test(not ( | 89 test.fail_test(not ( |
90 execution_level.has_key('level') and | 90 'level' in execution_level and |
91 execution_level.has_key('uiAccess') and | 91 'uiAccess' in execution_level and |
92 execution_level['level'].nodeValue == 'requireAdministrator' and | 92 execution_level['level'].nodeValue == 'requireAdministrator' and |
93 execution_level['uiAccess'].nodeValue == 'true')) | 93 execution_level['uiAccess'].nodeValue == 'true')) |
94 | 94 |
95 test.pass_test() | 95 test.pass_test() |
OLD | NEW |