Skip to content

Commit

Permalink
Issue #11388: --debug and --browserhtml are not exclusive in 'mach run'.
Browse files Browse the repository at this point in the history
  • Loading branch information
simartin committed Jun 17, 2016
1 parent 9208b8e commit ec5792e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions python/servo/post_build_commands.py
Expand Up @@ -98,6 +98,25 @@ def run(self, params, release=False, dev=False, android=None, debug=False, debug

args = [self.get_binary_path(release, dev)]

if browserhtml:
browserhtml_path = find_dep_path_newest('browserhtml', args[0])
if browserhtml_path is None:
print("Could not find browserhtml package; perhaps you haven't built Servo.")
return 1

if is_macosx():
# Enable borderless on OSX
args = args + ['-b']
elif is_windows():
# Convert to a relative path to avoid mingw -> Windows path conversions
browserhtml_path = path.relpath(browserhtml_path, os.getcwd())

args = args + ['-w',
'--pref', 'dom.mozbrowser.enabled',
'--pref', 'dom.forcetouch.enabled',
'--pref', 'shell.quit-on-escape.enabled=false',
path.join(browserhtml_path, 'out', 'index.html')]

# Borrowed and modified from:
# http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883
if debug:
Expand Down Expand Up @@ -126,25 +145,6 @@ def run(self, params, release=False, dev=False, android=None, debug=False, debug
# Prepend the debugger args.
args = ([command] + self.debuggerInfo.args +
args + params)
elif browserhtml:
browserhtml_path = find_dep_path_newest('browserhtml', args[0])
if browserhtml_path is None:
print("Could not find browserhtml package; perhaps you haven't built Servo.")
return 1

if is_macosx():
# Enable borderless on OSX
args = args + ['-b']
elif is_windows():
# Convert to a relative path to avoid mingw -> Windows path conversions
browserhtml_path = path.relpath(browserhtml_path, os.getcwd())

args = args + ['-w',
'--pref', 'dom.mozbrowser.enabled',
'--pref', 'dom.forcetouch.enabled',
'--pref', 'shell.quit-on-escape.enabled=false',
path.join(browserhtml_path, 'out', 'index.html')]
args = args + params
else:
args = args + params

Expand Down

0 comments on commit ec5792e

Please sign in to comment.