| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 """ | 8 """ |
| 9 Frogpad is used to compile .dart files to javascript. | 9 Frogpad is used to compile .dart files to javascript. |
| 10 | 10 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 def generate_js(self): | 229 def generate_js(self): |
| 230 drt = os.path.join(self.dart_dir, "client/tests/drt/DumpRenderTree") | 230 drt = os.path.join(self.dart_dir, "client/tests/drt/DumpRenderTree") |
| 231 if platform.system() == 'Darwin': | 231 if platform.system() == 'Darwin': |
| 232 drt += ".app" | 232 drt += ".app" |
| 233 elif platform.system() == 'Windows': | 233 elif platform.system() == 'Windows': |
| 234 raise Exception("frogpad does not run on Windows") | 234 raise Exception("frogpad does not run on Windows") |
| 235 | 235 |
| 236 check_exists(drt) | 236 check_exists(drt) |
| 237 args = [] | 237 args = [] |
| 238 args.append("xvfb-run") | |
| 239 args.append("-a") | |
| 240 args.append(drt) | 238 args.append(drt) |
| 241 args.append(self.html_file) | 239 args.append(self.html_file) |
| 242 | 240 |
| 243 stdout = run_command(args) | 241 stdout = run_command(args) |
| 244 match = OUTPUT_JAVASCRIPT_REGEX.match(stdout) | 242 match = OUTPUT_JAVASCRIPT_REGEX.match(stdout) |
| 245 if not match: | 243 if not match: |
| 246 raise Exception("can't find regex in DumpRenderTree output") | 244 raise Exception("can't find regex in DumpRenderTree output") |
| 247 return match.group(1) | 245 return match.group(1) |
| 248 | 246 |
| 249 @staticmethod | 247 @staticmethod |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 raise CommandFailedException(msg) | 359 raise CommandFailedException(msg) |
| 362 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) | 360 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) |
| 363 return stdout | 361 return stdout |
| 364 | 362 |
| 365 | 363 |
| 366 def main(argv): | 364 def main(argv): |
| 367 Pad(argv) | 365 Pad(argv) |
| 368 | 366 |
| 369 if __name__ == "__main__": | 367 if __name__ == "__main__": |
| 370 sys.exit(main(sys.argv)) | 368 sys.exit(main(sys.argv)) |
| OLD | NEW |