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

Unified Diff: tools/perf/page_sets/key_hit_test_cases.py

Issue 789003002: Add telemetry test for paper calculator hit testing performance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add line after header Created 6 years 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/page_sets/key_hit_test_cases.py
diff --git a/tools/perf/page_sets/key_hit_test_cases.py b/tools/perf/page_sets/key_hit_test_cases.py
new file mode 100644
index 0000000000000000000000000000000000000000..c504123443c395d43627a5301edc25c75785fc57
--- /dev/null
+++ b/tools/perf/page_sets/key_hit_test_cases.py
@@ -0,0 +1,55 @@
+# Copyright 2014 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.
+
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class KeyHitTestCasesPage(page_module.Page):
+
+ def __init__(self, url, page_set):
+ super(KeyHitTestCasesPage, self).__init__(
+ url=url, page_set=page_set, credentials_path = 'data/credentials.json')
+ self.user_agent_type = 'mobile'
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.NavigateToPage(self)
+ action_runner.Wait(2)
+
+ def RunSmoothness(self, action_runner):
+ action_runner.Wait(2)
+ for _ in xrange(100):
+ self.TapButton(action_runner)
+
+
+class PaperCalculatorHitTest(KeyHitTestCasesPage):
+
+ def __init__(self, page_set):
+ super(PaperCalculatorHitTest, self).__init__(
+ # Generated from https://github.com/zqureshi/paper-calculator
+ # vulcanize --inline --strip paper-calculator/demo.html
+ url='file://key_hit_test_cases/paper-calculator-no-rendering.html',
+ page_set=page_set)
+
+ def TapButton(self, action_runner):
+ interaction = action_runner.BeginInteraction(
+ 'Action_TapAction', is_smooth=True)
+ action_runner.TapElement(element_function='''
+ document.querySelector(
+ 'body /deep/ #outerPanels'
+ ).querySelector(
+ '#standard'
+ ).shadowRoot.querySelector(
+ 'paper-calculator-key[label="5"]'
+ )''')
+ interaction.End()
+
+
+class KeyHitTestCasesPageSet(page_set_module.PageSet):
+
+ def __init__(self):
+ super(KeyHitTestCasesPageSet, self).__init__(
+ user_agent_type='mobile')
+
+ self.AddPage(PaperCalculatorHitTest(self))
« no previous file with comments | « tools/perf/benchmarks/thread_times.py ('k') | tools/perf/page_sets/key_hit_test_cases/paper-calculator-no-rendering.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698