Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Unified Diff: tools/browser_tester/browsertester/browserlauncher.py

Issue 8825007: Native Client side changes for debugging support: stdout/err -> postmessage. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/service_runtime/service_runtime.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]
« no previous file with comments | « src/trusted/service_runtime/service_runtime.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698