| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import pyauto_functional # Must be imported first | 6 import pyauto_functional # Must be imported first |
| 7 import pyauto | 7 import pyauto |
| 8 import test_utils | 8 import test_utils |
| 9 | 9 |
| 10 import json | 10 import json |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 prefs = self._LoadPreferences() | 166 prefs = self._LoadPreferences() |
| 167 if startup_type is None: | 167 if startup_type is None: |
| 168 del prefs['session']['restore_on_startup'] | 168 del prefs['session']['restore_on_startup'] |
| 169 else: | 169 else: |
| 170 prefs['session']['restore_on_startup'] = startup_type | 170 prefs['session']['restore_on_startup'] = startup_type |
| 171 | 171 |
| 172 if startup_urls is not None: | 172 if startup_urls is not None: |
| 173 prefs['session']['urls_to_restore_on_startup'] = startup_urls | 173 prefs['session']['urls_to_restore_on_startup'] = startup_urls |
| 174 if homepage is not None: | 174 if homepage is not None: |
| 175 prefs['homepage'] = homepage | 175 prefs['homepage'] = homepage |
| 176 prefs['homepage_is_newtabpage'] = False |
| 176 if delete_migrated_pref: | 177 if delete_migrated_pref: |
| 177 del prefs['session']['restore_on_startup_migrated'] | 178 del prefs['session']['restore_on_startup_migrated'] |
| 178 self._WritePreferences(prefs) | 179 self._WritePreferences(prefs) |
| 179 | 180 |
| 180 def _ChangePinnedTabsPrefs(self, pinned_tabs): | 181 def _ChangePinnedTabsPrefs(self, pinned_tabs): |
| 181 """Changes the list of pinned tabs. | 182 """Changes the list of pinned tabs. |
| 182 | 183 |
| 183 Args: | 184 Args: |
| 184 pinned_tabs: list(str) with a list of pinned tabs URLs. | 185 pinned_tabs: list(str) with a list of pinned tabs URLs. |
| 185 """ | 186 """ |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 pre_launch_hook=lambda: self._ChangeHomepage(new_homepage, False, True)) | 767 pre_launch_hook=lambda: self._ChangeHomepage(new_homepage, False, True)) |
| 767 # Not showing the change. | 768 # Not showing the change. |
| 768 self.assertFalse(self.GetProtectorState()['showing_change']) | 769 self.assertFalse(self.GetProtectorState()['showing_change']) |
| 769 # New values must be active. | 770 # New values must be active. |
| 770 self.assertEquals(new_homepage, self.GetPrefsInfo().Prefs(pyauto.kHomePage)) | 771 self.assertEquals(new_homepage, self.GetPrefsInfo().Prefs(pyauto.kHomePage)) |
| 771 self.assertEquals(True, self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton)) | 772 self.assertEquals(True, self.GetPrefsInfo().Prefs(pyauto.kShowHomeButton)) |
| 772 | 773 |
| 773 | 774 |
| 774 if __name__ == '__main__': | 775 if __name__ == '__main__': |
| 775 pyauto_functional.Main() | 776 pyauto_functional.Main() |
| OLD | NEW |