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

Unified 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 side-by-side diff with in-line comments
Download patch
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'
« 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