| 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 are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 self.measurements = measurements | 75 self.measurements = measurements |
| 76 self.timeout = timeout | 76 self.timeout = timeout |
| 77 self.error = error # stderr output | 77 self.error = error # stderr output |
| 78 self.pid = pid | 78 self.pid = pid |
| 79 self.device_offline = device_offline | 79 self.device_offline = device_offline |
| 80 | 80 |
| 81 def has_stderr(self): | 81 def has_stderr(self): |
| 82 return bool(self.error) | 82 return bool(self.error) |
| 83 | 83 |
| 84 | 84 |
| 85 class DeviceOffline(Exception): |
| 86 pass |
| 87 |
| 88 |
| 85 class Driver(object): | 89 class Driver(object): |
| 86 """object for running test(s) using content_shell or other driver.""" | 90 """object for running test(s) using content_shell or other driver.""" |
| 87 | 91 |
| 88 def __init__(self, port, worker_number, pixel_tests, no_timeout=False): | 92 def __init__(self, port, worker_number, pixel_tests, no_timeout=False): |
| 89 """Initialize a Driver to subsequently run tests. | 93 """Initialize a Driver to subsequently run tests. |
| 90 | 94 |
| 91 Typically this routine will spawn content_shell in a config | 95 Typically this routine will spawn content_shell in a config |
| 92 ready for subsequent input. | 96 ready for subsequent input. |
| 93 | 97 |
| 94 port - reference back to the port object. | 98 port - reference back to the port object. |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 self.content = str() # FIXME: Should be bytearray() once we require Pyt
hon 2.6. | 484 self.content = str() # FIXME: Should be bytearray() once we require Pyt
hon 2.6. |
| 481 self.decoded_content = None | 485 self.decoded_content = None |
| 482 self.malloc = None | 486 self.malloc = None |
| 483 self.js_heap = None | 487 self.js_heap = None |
| 484 | 488 |
| 485 def decode_content(self): | 489 def decode_content(self): |
| 486 if self.encoding == 'base64' and self.content is not None: | 490 if self.encoding == 'base64' and self.content is not None: |
| 487 self.decoded_content = base64.b64decode(self.content) | 491 self.decoded_content = base64.b64decode(self.content) |
| 488 else: | 492 else: |
| 489 self.decoded_content = self.content | 493 self.decoded_content = self.content |
| OLD | NEW |