| 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 glob | 6 import glob |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 | 9 |
| 10 import pyauto_functional # Must be imported before pyauto | 10 import pyauto_functional # Must be imported before pyauto |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 self.assertFalse(self.GetThemeInfo()) # Verify there's no theme at startup | 57 self.assertFalse(self.GetThemeInfo()) # Verify there's no theme at startup |
| 58 crx_file = os.path.abspath( | 58 crx_file = os.path.abspath( |
| 59 os.path.join(self.DataDir(), 'extensions', 'theme.crx')) | 59 os.path.join(self.DataDir(), 'extensions', 'theme.crx')) |
| 60 self._SetThemeAndVerify(crx_file, 'camo theme') | 60 self._SetThemeAndVerify(crx_file, 'camo theme') |
| 61 | 61 |
| 62 def testThemeReset(self): | 62 def testThemeReset(self): |
| 63 """Verify theme reset.""" | 63 """Verify theme reset.""" |
| 64 crx_file = os.path.abspath( | 64 crx_file = os.path.abspath( |
| 65 os.path.join(self.DataDir(), 'extensions', 'theme.crx')) | 65 os.path.join(self.DataDir(), 'extensions', 'theme.crx')) |
| 66 self.SetTheme(crx_file) | 66 self.SetTheme(crx_file) |
| 67 self.assertTrue(self.ResetToDefaultTheme()) | 67 self.ResetToDefaultTheme() |
| 68 self.assertFalse(self.GetThemeInfo()) | 68 self.assertFalse(self.GetThemeInfo()) |
| 69 | 69 |
| 70 def testThemeUndo(self): | 70 def testThemeUndo(self): |
| 71 """Verify theme undo.""" | 71 """Verify theme undo.""" |
| 72 crx_file = os.path.abspath( | 72 crx_file = os.path.abspath( |
| 73 os.path.join(self.DataDir(), 'extensions', 'theme.crx')) | 73 os.path.join(self.DataDir(), 'extensions', 'theme.crx')) |
| 74 self._SetThemeAndVerify(crx_file, 'camo theme') | 74 self._SetThemeAndVerify(crx_file, 'camo theme') |
| 75 # Undo theme install. | 75 # Undo theme install. |
| 76 infobars = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'] | 76 infobars = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'] |
| 77 for index, infobar in enumerate(infobars): | 77 for index, infobar in enumerate(infobars): |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 failed_themes = self._ReturnCrashingThemes(failed_themes, group_size, | 168 failed_themes = self._ReturnCrashingThemes(failed_themes, group_size, |
| 169 urls) | 169 urls) |
| 170 group_size = group_size // 2 | 170 group_size = group_size // 2 |
| 171 | 171 |
| 172 self.assertFalse(failed_themes, | 172 self.assertFalse(failed_themes, |
| 173 'Theme(s) in failing group: %s' % failed_themes) | 173 'Theme(s) in failing group: %s' % failed_themes) |
| 174 | 174 |
| 175 | 175 |
| 176 if __name__ == '__main__': | 176 if __name__ == '__main__': |
| 177 pyauto_functional.Main() | 177 pyauto_functional.Main() |
| OLD | NEW |