| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 _JS_FLAGS_SWITCH = '--js-flags=' | 5 _JS_FLAGS_SWITCH = '--js-flags=' |
| 6 | 6 |
| 7 | 7 |
| 8 def EnableIgnition(options): | 8 def EnableIgnition(options): |
| 9 AppendJSFlags(options, '--ignition') | 9 AppendJSFlags(options, '--ignition-staging') |
| 10 | 10 |
| 11 | 11 |
| 12 def AppendJSFlags(options, js_flags): | 12 def AppendJSFlags(options, js_flags): |
| 13 existing_js_flags = '' | 13 existing_js_flags = '' |
| 14 # There should be only one occurence of --js-flags in the browser flags. When | 14 # There should be only one occurence of --js-flags in the browser flags. When |
| 15 # there are multiple flags, only one of them would be used. Append any | 15 # there are multiple flags, only one of them would be used. Append any |
| 16 # additional js_flags to the existing flags (if present). | 16 # additional js_flags to the existing flags (if present). |
| 17 for extra_arg in options.extra_browser_args: | 17 for extra_arg in options.extra_browser_args: |
| 18 if extra_arg.startswith(_JS_FLAGS_SWITCH): | 18 if extra_arg.startswith(_JS_FLAGS_SWITCH): |
| 19 # Find and remove the set of existing js_flags. | 19 # Find and remove the set of existing js_flags. |
| 20 existing_js_flags = extra_arg[len(_JS_FLAGS_SWITCH):] | 20 existing_js_flags = extra_arg[len(_JS_FLAGS_SWITCH):] |
| 21 options.extra_browser_args.remove(extra_arg) | 21 options.extra_browser_args.remove(extra_arg) |
| 22 break | 22 break |
| 23 | 23 |
| 24 options.AppendExtraBrowserArgs([ | 24 options.AppendExtraBrowserArgs([ |
| 25 # Add a new --js-flags which includes previous flags. | 25 # Add a new --js-flags which includes previous flags. |
| 26 '%s%s %s' % (_JS_FLAGS_SWITCH, js_flags, existing_js_flags) | 26 '%s%s %s' % (_JS_FLAGS_SWITCH, js_flags, existing_js_flags) |
| 27 ]) | 27 ]) |
| OLD | NEW |