<commit_before># Copyright 2013 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.
"""Finds CrOS browsers that can be controlled by telemetry."""

import logging

from telemetry.core import browser
from telemetry.core import possible_browser
from telemetry.core.backends.chrome import cros_browser_with_oobe
from telemetry.core.backends.chrome import cros_browser_backend
from telemetry.core.backends.chrome import cros_interface
from telemetry.core.platform import cros_platform_backend

ALL_BROWSER_TYPES = [
    'cros-chrome',
    'cros-chrome-guest',
    'system-guest',
    ]

class PossibleCrOSBrowser(possible_browser.PossibleBrowser):
  """A launchable chromeos browser instance."""
  def __init__(self, browser_type, finder_options, cri, is_guest):
    super(PossibleCrOSBrowser, self).__init__(browser_type, finder_options)
    assert browser_type in ALL_BROWSER_TYPES, \
        'Please add %s to ALL_BROWSER_TYPES' % browser_type
    self._cri = cri
    self._is_guest = is_guest

  def __repr__(self):
    return 'PossibleCrOSBrowser(browser_type=%s)' % self.browser_type

  def Create(self):
    if self.finder_options.output_profile_path:
      raise Exception("Profile generation is not currently supported on Chrome"
          " OS")

    browser_options = self.finder_options.browser_options
    backend = cros_browser_backend.CrOSBrowserBackend(
        self.browser_type, browser_options, self._cri, self._is_guest,
        extensions_to_load=self.finder_options.extensions_to_load)
    platform = cros_platform_backend.CrosPlatformBackend(self._cri)
    if browser_options.create_browser_with_oobe:
      return cros_browser_with_oobe.CrOSBrowserWithOOBE(backend, platform)
    else:
      return browser.Browser(backend, platform)<commit_msg>Add 'system' to cros browsers.<commit_after># Copyright 2013 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.
"""Finds CrOS browsers that can be controlled by telemetry."""

import logging

from telemetry.core import browser
from telemetry.core import possible_browser
from telemetry.core.backends.chrome import cros_browser_with_oobe
from telemetry.core.backends.chrome import cros_browser_backend
from telemetry.core.backends.chrome import cros_interface
from telemetry.core.platform import cros_platform_backend

ALL_BROWSER_TYPES = [
    'cros-chrome',
    'cros-chrome-guest',
    'system',
    'system-guest',
    ]

class PossibleCrOSBrowser(possible_browser.PossibleBrowser):
  """A launchable chromeos browser instance."""
  def __init__(self, browser_type, finder_options, cri, is_guest):
    super(PossibleCrOSBrowser, self).__init__(browser_type, finder_options)
    assert browser_type in ALL_BROWSER_TYPES, \
        'Please add %s to ALL_BROWSER_TYPES' % browser_type
    self._cri = cri
    self._is_guest = is_guest

  def __repr__(self):
    return 'PossibleCrOSBrowser(browser_type=%s)' % self.browser_type

  def Create(self):
    if self.finder_options.output_profile_path:
      raise Exception("Profile generation is not currently supported on Chrome"
          " OS")

    browser_options = self.finder_options.browser_options
    backend = cros_browser_backend.CrOSBrowserBackend(
        self.browser_type, browser_options, self._cri, self._is_guest,
        extensions_to_load=self.finder_options.extensions_to_load)
    platform = cros_platform_backend.CrosPlatformBackend(self._cri)
    if browser_options.create_browser_with_oobe:
      return cros_browser_with_oobe.CrOSBrowserWithOOBE(backend, platform)
    else:
      return browser.Browser(backend, platform)
{'fraction_non_alphanumeric': 0.07472644782492661, 'fraction_numerical': 0.0021350413664264745, 'mean_word_length': 4.757296466973886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3632590', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1108, 'n_words': 276}