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

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

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 10 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 | « tools/perf/page_sets/system_health/media_stories.py ('k') | tools/perf/page_sets/todomvc.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/text_selection_sites.py
diff --git a/tools/perf/page_sets/text_selection_sites.py b/tools/perf/page_sets/text_selection_sites.py
index 0fa2aa6362a0577156971e9cb20f7e36500089f0..435379cbc84c2472774d41f020da2b212a5c9d89 100644
--- a/tools/perf/page_sets/text_selection_sites.py
+++ b/tools/perf/page_sets/text_selection_sites.py
@@ -18,7 +18,7 @@ class SimplePage(page_module.Page):
def RunNavigateSteps(self, action_runner):
super(SimplePage, self).RunNavigateSteps(action_runner)
- action_runner.WaitForJavaScriptCondition2(
+ action_runner.WaitForJavaScriptCondition(
'document.readyState == "complete"')
@@ -31,7 +31,7 @@ class SimpleTextSelectionPage(SimplePage):
# Create a fixed position div in the top left corner of the page, and
# another one in the bottom right corner of the page.
# Select the text within the first div.
- action_runner.ExecuteJavaScript2('''
+ action_runner.ExecuteJavaScript('''
(function() {
var text_div = document.createElement('div');
var text_div_2 = document.createElement('div');
@@ -65,32 +65,32 @@ class SimpleTextSelectionPage(SimplePage):
# Wait two frames so that the selection information is sent to chromium
# and it is able to process input events interacting with selection.
- action_runner.WaitForJavaScriptCondition2(
+ action_runner.WaitForJavaScriptCondition(
'document.getElementById("text-for-perf-test").style.color == "green"')
- action_runner.ExecuteJavaScript2('''
+ action_runner.ExecuteJavaScript('''
window.requestAnimationFrame(function() {
document.getElementById("text-for-perf-test").style.color="red";
});
''')
- action_runner.WaitForJavaScriptCondition2(
+ action_runner.WaitForJavaScriptCondition(
'document.getElementById("text-for-perf-test").style.color == "red"')
# Confirm that the selection is set correctly.
- text = action_runner.EvaluateJavaScript2('window.getSelection().toString()')
+ text = action_runner.EvaluateJavaScript('window.getSelection().toString()')
assert text == "Hello"
# Tap on the selected text to make the handles show up.
with action_runner.CreateGestureInteraction('TapAction'):
action_runner.TapElement('#text-for-perf-test')
- text_div_bottom = float(action_runner.EvaluateJavaScript2('''
+ text_div_bottom = float(action_runner.EvaluateJavaScript('''
document.getElementById("text-for-perf-test").getClientRects()[0].bottom
'''))
- text_div_2_bottom = float(action_runner.EvaluateJavaScript2('''
+ text_div_2_bottom = float(action_runner.EvaluateJavaScript('''
document.getElementById(
"text-for-perf-test-2").getClientRects()[0].bottom
'''))
- body_rect_str = action_runner.EvaluateJavaScript2('''
+ body_rect_str = action_runner.EvaluateJavaScript('''
var r = window.__GestureCommon_GetBoundingVisibleRect(document.body);
r.left + " " + r.top + " " + r.height + " " + r.width;
''')
@@ -116,11 +116,11 @@ class SimpleTextSelectionPage(SimplePage):
use_touch=1)
# Confirm that the selection has changed.
- text = action_runner.EvaluateJavaScript2('window.getSelection().toString()')
+ text = action_runner.EvaluateJavaScript('window.getSelection().toString()')
assert text != "Hello"
# Determine the coordinates of the end of the selection
- sel_end_str = action_runner.EvaluateJavaScript2('''
+ sel_end_str = action_runner.EvaluateJavaScript('''
var rects = window.getSelection().getRangeAt(0).getClientRects();
var last_rect = rects[rects.length - 1];
last_rect.right + " " + last_rect.bottom;
@@ -139,7 +139,7 @@ class SimpleTextSelectionPage(SimplePage):
use_touch=1)
# Confirm that the selection is back to the text in the first div.
- text = action_runner.EvaluateJavaScript2('window.getSelection().toString()')
+ text = action_runner.EvaluateJavaScript('window.getSelection().toString()')
assert text == "Hello"
« no previous file with comments | « tools/perf/page_sets/system_health/media_stories.py ('k') | tools/perf/page_sets/todomvc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698