<commit_before>#!/usr/bin/python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os

import pyauto_functional  # Must be imported before pyauto
import pyauto


class ThemesTest(pyauto.PyUITest):
  """TestCase for Themes."""

  def Debug(self):
    """Test method for experimentation.

    This method will not run automatically.
    """
    import pprint
    pp = pprint.PrettyPrinter(indent=2)
    while True:
      raw_input('Hit <enter> to dump info.. ')
      pp.pprint(self.GetThemeInfo())

  def testSetTheme(self):
    """Verify theme install."""
    self.assertFalse(self.GetThemeInfo())  # Verify there's no theme at startup
    crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx')
    self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file)))
    theme = self.GetThemeInfo()
    self.assertEqual('camo theme', theme['name'])
    # TODO: verify "theme installed" infobar

  def testThemeReset(self):
    """Verify theme reset."""
    crx_file = os.path.join(self.DataDir(), 'extensions', 'theme.crx')
    self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file)))
    self.assertTrue(self.ResetToDefaultTheme())
    self.assertFalse(self.GetThemeInfo())


if __name__ == '__main__':
  pyauto_functional.Main()
<commit_msg>Fix a theme test<commit_after>#!/usr/bin/python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os

import pyauto_functional  # Must be imported before pyauto
import pyauto


class ThemesTest(pyauto.PyUITest):
  """TestCase for Themes."""

  def Debug(self):
    """Test method for experimentation.

    This method will not run automatically.
    """
    import pprint
    pp = pprint.PrettyPrinter(indent=2)
    while True:
      raw_input('Hit <enter> to dump info.. ')
      pp.pprint(self.GetThemeInfo())

  def testSetTheme(self):
    """Verify theme install."""
    self.assertFalse(self.GetThemeInfo())  # Verify there's no theme at startup
    crx_file = os.path.abspath(
        os.path.join(self.DataDir(), 'extensions', 'theme.crx'))
    self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file)))
    theme = self.GetThemeInfo()
    self.assertEqual('camo theme', theme['name'])
    # TODO: verify "theme installed" infobar

  def testThemeReset(self):
    """Verify theme reset."""
    crx_file = os.path.abspath(
        os.path.join(self.DataDir(), 'extensions', 'theme.crx'))
    self.assertTrue(self.SetTheme(pyauto.FilePath(crx_file)))
    self.assertTrue(self.ResetToDefaultTheme())
    self.assertFalse(self.GetThemeInfo())


if __name__ == '__main__':
  pyauto_functional.Main()

{'fraction_non_alphanumeric': 0.12737030411449016, 'fraction_numerical': 0.0035778175313059034, 'mean_word_length': 3.905263157894737, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6063774', 'n_tokens_mistral': 896, 'n_tokens_neox': 869, 'n_words': 229}