OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import os |
| 7 |
| 8 import pyauto_functional # Must be imported before pyauto |
| 9 import pyauto |
| 10 |
| 11 |
| 12 class ThemesTest(pyauto.PyUITest): |
| 13 """TestCase for Themes.""" |
| 14 |
| 15 def Debug(self): |
| 16 """Test method for experimentation. |
| 17 |
| 18 This method will not run automatically. |
| 19 """ |
| 20 import pprint |
| 21 pp = pprint.PrettyPrinter(indent=2) |
| 22 while True: |
| 23 raw_input('Hit <enter> to dump info.. ') |
| 24 pp.pprint(self.GetThemeInfo()) |
| 25 |
| 26 def testSetTheme(self): |
| 27 """Verify theme install.""" |
| 28 self.assertFalse(self.GetThemeInfo()) # Verify there's no theme at startup |
| 29 crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx') |
| 30 self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file))) |
| 31 theme = self.GetThemeInfo() |
| 32 self.assertEqual('camo theme', theme['name']) |
| 33 # TODO: verify "theme installed" infobar |
| 34 |
| 35 def testThemeReset(self): |
| 36 """Verify theme reset.""" |
| 37 crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx') |
| 38 self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file))) |
| 39 self.assertTrue(self.ResetToDefaultTheme()) |
| 40 self.assertFalse(self.GetThemeInfo()) |
| 41 |
| 42 |
| 43 if __name__ == '__main__': |
| 44 pyauto_functional.Main() |
| 45 |
OLD | NEW |