| 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 logging | 5 import logging |
| 6 | 6 |
| 7 import pylib.device.device_utils | |
| 8 | |
| 9 from pylib.device import device_errors | 7 from pylib.device import device_errors |
| 10 | 8 |
| 11 | 9 |
| 12 class FlagChanger(object): | 10 class FlagChanger(object): |
| 13 """Changes the flags Chrome runs with. | 11 """Changes the flags Chrome runs with. |
| 14 | 12 |
| 15 There are two different use cases for this file: | 13 There are two different use cases for this file: |
| 16 * Flags are permanently set by calling Set(). | 14 * Flags are permanently set by calling Set(). |
| 17 * Flags can be temporarily set for a particular set of unit tests. These | 15 * Flags can be temporarily set for a particular set of unit tests. These |
| 18 tests should call Restore() to revert the flags to their original state | 16 tests should call Restore() to revert the flags to their original state |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 151 |
| 154 # Tack on the last flag. | 152 # Tack on the last flag. |
| 155 if not current_flag: | 153 if not current_flag: |
| 156 if within_quotations: | 154 if within_quotations: |
| 157 logging.warn('Unterminated quoted argument: ' + line) | 155 logging.warn('Unterminated quoted argument: ' + line) |
| 158 else: | 156 else: |
| 159 tokenized_flags.append(current_flag) | 157 tokenized_flags.append(current_flag) |
| 160 | 158 |
| 161 # Return everything but the program name. | 159 # Return everything but the program name. |
| 162 return tokenized_flags[1:] | 160 return tokenized_flags[1:] |
| OLD | NEW |