<commit_before># Copyright 2016 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 time

from telemetry import decorators
from telemetry.internal.actions import key_event
from telemetry.internal.actions import utils
from telemetry.testing import tab_test_case


class KeyPressActionTest(tab_test_case.TabTestCase):

  @property
  def _scroll_position(self):
    return self._tab.EvaluateJavaScript(
        'document.documentElement.scrollTop || document.body.scrollTop')

  @property
  def _window_height(self):
    return self._tab.EvaluateJavaScript('__GestureCommon_GetWindowHeight()')

  def _PressKey(self, key):
    action = key_event.KeyPressAction(key)
    action.WillRunAction(self._tab)
    action.RunAction(self._tab)

  def setUp(self):
    tab_test_case.TabTestCase.setUp(self)
    self.Navigate('blank.html')
    utils.InjectJavaScript(self._tab, 'gesture_common.js')

  # https://github.com/catapult-project/catapult/issues/3099
  # crbug.com/1005062
  @decorators.Disabled('android', 'chromeos')
  def testPressEndAndHome(self):
    # Make page taller than the window so it's scrollable.<commit_msg>Disable testPressEndAndHome on linux<commit_after># Copyright 2016 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 time

from telemetry import decorators
from telemetry.internal.actions import key_event
from telemetry.internal.actions import utils
from telemetry.testing import tab_test_case


class KeyPressActionTest(tab_test_case.TabTestCase):

  @property
  def _scroll_position(self):
    return self._tab.EvaluateJavaScript(
        'document.documentElement.scrollTop || document.body.scrollTop')

  @property
  def _window_height(self):
    return self._tab.EvaluateJavaScript('__GestureCommon_GetWindowHeight()')

  def _PressKey(self, key):
    action = key_event.KeyPressAction(key)
    action.WillRunAction(self._tab)
    action.RunAction(self._tab)

  def setUp(self):
    tab_test_case.TabTestCase.setUp(self)
    self.Navigate('blank.html')
    utils.InjectJavaScript(self._tab, 'gesture_common.js')

  # https://github.com/catapult-project/catapult/issues/3099
  # crbug.com/1005062
  @decorators.Disabled('android', 'chromeos', 'linux')
  def testPressEndAndHome(self):
    # Make page taller than the window so it's scrollable.
{'fraction_non_alphanumeric': 0.0919773095623987, 'fraction_numerical': 0.012155591572123177, 'mean_word_length': 4.836879432624113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7587460', 'n_tokens_mistral': 783, 'n_tokens_neox': 735, 'n_words': 179}