OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
5 # are met: | 5 # are met: |
6 # 1. Redistributions of source code must retain the above copyright | 6 # 1. Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # 2. Redistributions in binary form must reproduce the above copyright | 8 # 2. Redistributions in binary form must reproduce the above copyright |
9 # notice, this list of conditions and the following disclaimer in the | 9 # notice, this list of conditions and the following disclaimer in the |
10 # documentation and/or other materials provided with the distribution. | 10 # documentation and/or other materials provided with the distribution. |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 def write_list_file(idl_paths): | 143 def write_list_file(idl_paths): |
144 list_file, list_filename = self.provider.new_temp_file() | 144 list_file, list_filename = self.provider.new_temp_file() |
145 list_contents = ''.join(idl_path + '\n' | 145 list_contents = ''.join(idl_path + '\n' |
146 for idl_path in idl_paths) | 146 for idl_path in idl_paths) |
147 os.write(list_file, list_contents) | 147 os.write(list_file, list_contents) |
148 return list_filename | 148 return list_filename |
149 | 149 |
150 def compute_interfaces_info(idl_files_list_filename, | 150 def compute_interfaces_info(idl_files_list_filename, |
151 event_names_filename): | 151 event_names_filename): |
152 # Dummy files, required by compute_interfaces_info but not checked | |
153 _, window_constructors_file = self.provider.new_temp_file() | |
154 _, workerglobalscope_constructors_file = self.provider.new_temp_file
() | |
155 _, sharedworkerglobalscope_constructors_file = self.provider.new_tem
p_file() | |
156 _, dedicatedworkerglobalscope_constructors_file = self.provider.new_
temp_file() | |
157 _, serviceworkersglobalscope_constructors_file = self.provider.new_t
emp_file() | |
158 cmd = ['python', | 152 cmd = ['python', |
159 'bindings/scripts/compute_interfaces_info.py', | 153 'bindings/scripts/compute_interfaces_info.py', |
160 '--idl-files-list', idl_files_list_filename, | 154 '--idl-files-list', idl_files_list_filename, |
161 '--interface-dependencies-file', self.interface_dependencies_
filename, | 155 '--interface-dependencies-file', self.interface_dependencies_
filename, |
162 '--interfaces-info-file', self.interfaces_info_filename, | 156 '--interfaces-info-file', self.interfaces_info_filename, |
163 '--window-constructors-file', window_constructors_file, | |
164 '--workerglobalscope-constructors-file', workerglobalscope_co
nstructors_file, | |
165 '--sharedworkerglobalscope-constructors-file', sharedworkergl
obalscope_constructors_file, | |
166 '--dedicatedworkerglobalscope-constructors-file', dedicatedwo
rkerglobalscope_constructors_file, | |
167 '--serviceworkerglobalscope-constructors-file', serviceworker
sglobalscope_constructors_file, | |
168 '--event-names-file', event_names_filename, | 157 '--event-names-file', event_names_filename, |
169 '--write-file-only-if-changed', '0'] | 158 '--write-file-only-if-changed', '0'] |
170 self.run_command(cmd) | 159 self.run_command(cmd) |
171 | 160 |
172 test_idl_files_list_filename = write_list_file(idl_paths(test_input_dire
ctory)) | 161 test_idl_files_list_filename = write_list_file(idl_paths(test_input_dire
ctory)) |
173 all_idl_files_list_filename = write_list_file(idl_paths_recursive(all_in
put_directory)) | 162 all_idl_files_list_filename = write_list_file(idl_paths_recursive(all_in
put_directory)) |
174 | 163 |
175 if self.reset_results and self.verbose: | 164 if self.reset_results and self.verbose: |
176 print 'Reset results: EventInterfaces.in' | 165 print 'Reset results: EventInterfaces.in' |
177 try: | 166 try: |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 print PASS_MESSAGE | 270 print PASS_MESSAGE |
282 return 0 | 271 return 0 |
283 print | 272 print |
284 print FAIL_MESSAGE | 273 print FAIL_MESSAGE |
285 return -1 | 274 return -1 |
286 | 275 |
287 | 276 |
288 def run_bindings_tests(reset_results, verbose): | 277 def run_bindings_tests(reset_results, verbose): |
289 with ScopedTempFileProvider() as provider: | 278 with ScopedTempFileProvider() as provider: |
290 return BindingsTests(reset_results, verbose, provider).main() | 279 return BindingsTests(reset_results, verbose, provider).main() |
OLD | NEW |