| Index: tools/perf/benchmarks/test_tap.py
|
| diff --git a/tools/perf/benchmarks/test_tap.py b/tools/perf/benchmarks/test_tap.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4135438a8af1f144bb22c803f2f923bbb7eaf3bc
|
| --- /dev/null
|
| +++ b/tools/perf/benchmarks/test_tap.py
|
| @@ -0,0 +1,63 @@
|
| +# 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 logging
|
| +
|
| +from core import perf_benchmark
|
| +from telemetry import story
|
| +from telemetry.page import page
|
| +
|
| +
|
| +class TestTapStory(page.Page):
|
| +
|
| + def __init__(self, story_set):
|
| + super(TestTapStory, self).__init__(url='file://test_tap/test_tap.html',
|
| + page_set=story_set)
|
| +
|
| + def _PrintState(self, action_runner, label):
|
| + logging.info('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BEGIN %s '
|
| + '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<', label)
|
| + triggered_handlers = action_runner.EvaluateJavaScript('triggeredHandlers')
|
| + logging.info('Triggered handlers: %s', triggered_handlers)
|
| + action_runner.tab.browser.DumpStateUponFailure()
|
| + logging.info('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END %s '
|
| + '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<', label)
|
| +
|
| +
|
| + def RunPageInteractions(self, action_runner):
|
| + logging.getLogger().setLevel(logging.INFO)
|
| +
|
| + action_runner.WaitForJavaScriptCondition('handlersInitialized')
|
| + self._PrintState(action_runner, 'start')
|
| +
|
| + action_runner.TapElement('#test')
|
| + self._PrintState(action_runner, 'immediately after tap')
|
| + action_runner.Wait(5)
|
| + self._PrintState(action_runner, '5 seconds after tap')
|
| +
|
| + action_runner.ClickElement('#test')
|
| + self._PrintState(action_runner, 'immediately after click')
|
| + action_runner.Wait(5)
|
| + self._PrintState(action_runner, '5 seconds after click')
|
| +
|
| + raise Exception('Intentional exception to dump browser state')
|
| +
|
| +
|
| +class TestTapStorySet(story.StorySet):
|
| +
|
| + def __init__(self):
|
| + super(TestTapStorySet, self).__init__()
|
| + self.AddStory(TestTapStory(self))
|
| +
|
| +
|
| +class TestTapBenchmark(perf_benchmark.PerfBenchmark):
|
| +
|
| + page_set = TestTapStorySet
|
| +
|
| + def SetExtraBrowserOptions(self, options):
|
| + options.logging_verbosity = 'non-verbose'
|
| +
|
| + @classmethod
|
| + def Name(cls):
|
| + return 'test_tap'
|
|
|