| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import constants | 5 import constants |
| 6 import traceback | 6 import traceback |
| 7 import warnings | 7 import warnings |
| 8 | 8 |
| 9 | 9 |
| 10 # Location where chrome reads command line flags from | 10 # Location where chrome reads command line flags from |
| 11 CHROME_COMMAND_FILE = constants.TEST_EXECUTABLE_DIR + '/chrome-command-line' | 11 CHROME_COMMAND_FILE = '/data/local/chrome-command-line' |
| 12 | 12 |
| 13 class FlagChanger(object): | 13 class FlagChanger(object): |
| 14 """Changes the flags Chrome runs with. | 14 """Changes the flags Chrome runs with. |
| 15 | 15 |
| 16 There are two different use cases for this file: | 16 There are two different use cases for this file: |
| 17 * Flags are permanently set by calling Set(). | 17 * Flags are permanently set by calling Set(). |
| 18 * Flags can be temporarily set for a particular set of unit tests. These | 18 * Flags can be temporarily set for a particular set of unit tests. These |
| 19 tests should call Restore() to revert the flags to their original state | 19 tests should call Restore() to revert the flags to their original state |
| 20 once the tests have completed. | 20 once the tests have completed. |
| 21 """ | 21 """ |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 # Tack on the last flag. | 136 # Tack on the last flag. |
| 137 if not current_flag: | 137 if not current_flag: |
| 138 if within_quotations: | 138 if within_quotations: |
| 139 warnings.warn("Unterminated quoted string: " + current_flag) | 139 warnings.warn("Unterminated quoted string: " + current_flag) |
| 140 else: | 140 else: |
| 141 tokenized_flags.append(current_flag) | 141 tokenized_flags.append(current_flag) |
| 142 | 142 |
| 143 # Return everything but the program name. | 143 # Return everything but the program name. |
| 144 return tokenized_flags[1:] | 144 return tokenized_flags[1:] |
| OLD | NEW |