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 assert self.is_http_test(test_name) | 233 if not self.is_http_test(test_name): |
234 return "http://127.0.0.1:8000/sky/tests/" + test_name | 234 return path.abspath_to_uri(self._port.host.platform, self._port.absp
ath_for_test(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 |
235 | 239 |
236 def uri_to_test(self, uri): | 240 def uri_to_test(self, uri): |
237 """Return the base layout test name for a given URI. | 241 """Return the base layout test name for a given URI. |
238 | 242 |
239 This returns the test name for a given URI, e.g., if you passed in | 243 This returns the test name for a given URI, e.g., if you passed in |
240 "file:///src/tests/fast/html/keygen.html" it would return | 244 "file:///src/tests/fast/html/keygen.html" it would return |
241 "fast/html/keygen.html". | 245 "fast/html/keygen.html". |
242 | 246 |
243 """ | 247 """ |
244 if uri.startswith("file:///"): | 248 if uri.startswith("file:///"): |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 self.decoded_content = None | 531 self.decoded_content = None |
528 self.malloc = None | 532 self.malloc = None |
529 self.js_heap = None | 533 self.js_heap = None |
530 self.stdin_path = None | 534 self.stdin_path = None |
531 | 535 |
532 def decode_content(self): | 536 def decode_content(self): |
533 if self.encoding == 'base64' and self.content is not None: | 537 if self.encoding == 'base64' and self.content is not None: |
534 self.decoded_content = base64.b64decode(self.content) | 538 self.decoded_content = base64.b64decode(self.content) |
535 else: | 539 else: |
536 self.decoded_content = self.content | 540 self.decoded_content = self.content |
OLD | NEW |