Index: tools/browser_tester/browsertester/browserlauncher.py |
=================================================================== |
--- tools/browser_tester/browsertester/browserlauncher.py (revision 7373) |
+++ tools/browser_tester/browsertester/browserlauncher.py (working copy) |
@@ -142,17 +142,32 @@ |
def SetStandardStream(self, env, var_name, redirect_file, is_output): |
if redirect_file is None: |
return |
- redirect_file = os.path.abspath(redirect_file) |
+ # logic must match src/trusted/service_runtime/nacl_resource.* |
+ # resource specification notation |
+ is_file = (redirect_file.startswith('file:') or |
+ not (redirect_file.startswith('dev:') or |
+ redirect_file.startswith('DEBUG_ONLY:dev:'))) |
+ if is_file: |
+ if redirect_file.startswith('file:'): |
+ bare_file = redirect_file[5:] |
+ else: |
+ bare_file = redirect_file |
+ # why always abspath? does chrome chdir or might it in the |
+ # future? this means we do not test/use the relative path case. |
+ redirect_file = 'file:' + os.path.abspath(bare_file) |
+ else: |
+ bare_file = None # ensure error if used without checking is_file |
env[var_name] = redirect_file |
if is_output: |
# sel_ldr appends program output to the file so we need to clear it |
# in order to get the stable result. |
- if os.path.exists(redirect_file): |
- os.remove(redirect_file) |
- parent_dir = os.path.dirname(redirect_file) |
- # parent directory may not exist. |
- if not os.path.exists(parent_dir): |
- os.makedirs(parent_dir) |
+ if is_file: |
+ if os.path.exists(bare_file): |
+ os.remove(bare_file) |
+ parent_dir = os.path.dirname(bare_file) |
+ # parent directory may not exist. |
+ if not os.path.exists(parent_dir): |
+ os.makedirs(parent_dir) |
def Launch(self, cmd, env): |
browser_path = cmd[0] |