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

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

Issue 313383002: Cleanup interaction creation and add ExecuteJavaScript to action_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/page_sets/gmail_compose_discard.py
diff --git a/tools/perf/page_sets/gmail_compose_discard.py b/tools/perf/page_sets/gmail_compose_discard.py
index 4bab258d45c07e9ebd9de87cbb2c5a8266816746..264878ba90b73baaca375f336e19b9f0bf8d7a3b 100644
--- a/tools/perf/page_sets/gmail_compose_discard.py
+++ b/tools/perf/page_sets/gmail_compose_discard.py
@@ -29,18 +29,16 @@ class GmailComposeDiscardPage(page_module.Page):
}))
def ComposeClick(self, action_runner):
- action_runner.RunAction(JavascriptAction({
- 'expression': '''
+ action_runner.ExecuteJavaScript('''
var button=document.evaluate('//div[text()="COMPOSE"]',
- document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null)
+ document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null)
.singleNodeValue;
var mousedownevent=new MouseEvent('mousedown',true,true,window,0,0,0,0,0,
false,false,false,false,0,null);
var mouseupevent=new MouseEvent('mouseup',true,true,window,0,0,0,0,0,
false,false,false,false,0,null);
button.dispatchEvent(mousedownevent);
- button.dispatchEvent(mouseupevent);'''
- }))
+ button.dispatchEvent(mouseupevent);''')
def RunEndure(self, action_runner):
action_runner.RunAction(WaitAction(
« no previous file with comments | « tools/perf/page_sets/calendar_forward_backward.py ('k') | tools/perf/page_sets/image_decoding_measurement.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698