| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 def is_http_test(self, test_name): | 223 def is_http_test(self, test_name): |
| 224 return True | 224 return True |
| 225 | 225 |
| 226 def test_to_uri(self, test_name): | 226 def test_to_uri(self, test_name): |
| 227 """Convert a test name to a URI. | 227 """Convert a test name to a URI. |
| 228 | 228 |
| 229 Tests which have an 'https' directory in their paths (e.g. | 229 Tests which have an 'https' directory in their paths (e.g. |
| 230 '/http/tests/security/mixedContent/https/test1.html') will be loaded | 230 '/http/tests/security/mixedContent/https/test1.html') will be loaded |
| 231 over HTTPS; all other tests over HTTP. | 231 over HTTPS; all other tests over HTTP. |
| 232 """ | 232 """ |
| 233 if not self.is_http_test(test_name): | 233 assert self.is_http_test(test_name) |
| 234 return path.abspath_to_uri(self._port.host.platform, self._port.absp
ath_for_test(test_name)) | 234 return "http://127.0.0.1:8000/sky/tests/" + test_name |
| 235 | |
| 236 if "/https/" in test_name: | |
| 237 return "https://127.0.0.1:8443/" + test_name | |
| 238 return "http://127.0.0.1:8000/" + test_name | |
| 239 | 235 |
| 240 def uri_to_test(self, uri): | 236 def uri_to_test(self, uri): |
| 241 """Return the base layout test name for a given URI. | 237 """Return the base layout test name for a given URI. |
| 242 | 238 |
| 243 This returns the test name for a given URI, e.g., if you passed in | 239 This returns the test name for a given URI, e.g., if you passed in |
| 244 "file:///src/tests/fast/html/keygen.html" it would return | 240 "file:///src/tests/fast/html/keygen.html" it would return |
| 245 "fast/html/keygen.html". | 241 "fast/html/keygen.html". |
| 246 | 242 |
| 247 """ | 243 """ |
| 248 if uri.startswith("file:///"): | 244 if uri.startswith("file:///"): |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 self.decoded_content = None | 527 self.decoded_content = None |
| 532 self.malloc = None | 528 self.malloc = None |
| 533 self.js_heap = None | 529 self.js_heap = None |
| 534 self.stdin_path = None | 530 self.stdin_path = None |
| 535 | 531 |
| 536 def decode_content(self): | 532 def decode_content(self): |
| 537 if self.encoding == 'base64' and self.content is not None: | 533 if self.encoding == 'base64' and self.content is not None: |
| 538 self.decoded_content = base64.b64decode(self.content) | 534 self.decoded_content = base64.b64decode(self.content) |
| 539 else: | 535 else: |
| 540 self.decoded_content = self.content | 536 self.decoded_content = self.content |
| OLD | NEW |