Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: tools/perf/benchmarks/test_tap.py

Issue 2245133006: CL for perf tryjob on win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CL for perf tryjob on mac Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import logging
6
7 from core import perf_benchmark
8 from telemetry import story
9 from telemetry.page import page
10
11
12 class TestTapStory(page.Page):
13
14 def __init__(self, story_set):
15 super(TestTapStory, self).__init__(url='file://test_tap/test_tap.html',
16 page_set=story_set)
17
18 def _PrintState(self, action_runner, label):
19 logging.info('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BEGIN %s '
20 '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<', label)
21 triggered_handlers = action_runner.EvaluateJavaScript('triggeredHandlers')
22 logging.info('Triggered handlers: %s', triggered_handlers)
23 action_runner.tab.browser.DumpStateUponFailure()
24 logging.info('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END %s '
25 '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<', label)
26
27
28 def RunPageInteractions(self, action_runner):
29 logging.getLogger().setLevel(logging.INFO)
30
31 action_runner.WaitForJavaScriptCondition('handlersInitialized')
32 self._PrintState(action_runner, 'start')
33
34 action_runner.TapElement('#test')
35 self._PrintState(action_runner, 'immediately after tap')
36 action_runner.Wait(5)
37 self._PrintState(action_runner, '5 seconds after tap')
38
39 action_runner.ClickElement('#test')
40 self._PrintState(action_runner, 'immediately after click')
41 action_runner.Wait(5)
42 self._PrintState(action_runner, '5 seconds after click')
43
44 raise Exception('Intentional exception to dump browser state')
45
46
47 class TestTapStorySet(story.StorySet):
48
49 def __init__(self):
50 super(TestTapStorySet, self).__init__()
51 self.AddStory(TestTapStory(self))
52
53
54 class TestTapBenchmark(perf_benchmark.PerfBenchmark):
55
56 page_set = TestTapStorySet
57
58 def SetExtraBrowserOptions(self, options):
59 options.logging_verbosity = 'non-verbose'
60
61 @classmethod
62 def Name(cls):
63 return 'test_tap'
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/TouchEventManager.cpp ('k') | tools/perf/benchmarks/test_tap/test_tap.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698