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

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

Issue 1066983002: Improve hit-testing telemetry test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index f573d107582cb3cc3e55a99ac435efd5d6cf7790..a1e214a34a7bb52a955c17acec8fccd5e300895f 100644
--- a/tools/perf/page_sets/key_hit_test_cases.py
+++ b/tools/perf/page_sets/key_hit_test_cases.py
@@ -5,44 +5,39 @@
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
+from page_sets import polymer
-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):
- super(KeyHitTestCasesPage, self).RunNavigateSteps(action_runner)
- action_runner.Wait(2)
-
- def RunPageInteractions(self, action_runner):
- action_runner.Wait(2)
- for _ in xrange(100):
- self.TapButton(action_runner)
-
-
-class PaperCalculatorHitTest(KeyHitTestCasesPage):
+class PaperCalculatorHitTest(polymer.PolymerPage):
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)
+ page_set=page_set, run_no_page_interactions=False)
- def TapButton(self, action_runner):
- interaction = action_runner.BeginInteraction(
- 'Action_TapAction')
- action_runner.TapElement(element_function='''
- document.querySelector(
+ self.user_agent_type = 'mobile'
+
+ def PerformPageInteractions(self, action_runner):
+ # pay cost of selecting tap target only once
+ action_runner.ExecuteJavaScript('''
+ window.__tapTarget = document.querySelector(
'body /deep/ #outerPanels'
).querySelector(
'#standard'
).shadowRoot.querySelector(
'paper-calculator-key[label="5"]'
)''')
+ action_runner.WaitForJavaScriptCondition(
+ 'window.__tapTarget != null')
+
+ for _ in xrange(100):
+ self.TapButton(action_runner)
+
+ def TapButton(self, action_runner):
+ interaction = action_runner.BeginInteraction(
+ 'Action_TapAction')
nednguyen 2015/04/08 16:27:26 Why do you create an interaction record here?
majidvp 2015/04/08 18:32:30 It was there and I left it as is. Should I remove
nednguyen 2015/04/08 18:36:47 Thanks, I didn't notice that it was here before.
+ action_runner.TapElement(element_function='''window.__tapTarget''')
interaction.End()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698