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

Side by Side Diff: tools/perf/page_sets/system_health/browsing_stories.py

Issue 2618333006: [tools/perf] Fix JavaScript interpolation in action_runner calls (Closed)
Patch Set: fix a few more interpolations Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 # encoding: utf-8 1 # encoding: utf-8
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 from page_sets.system_health import platforms 6 from page_sets.system_health import platforms
7 from page_sets.system_health import system_health_story 7 from page_sets.system_health import system_health_story
8 8
9 from page_sets.login_helpers import pinterest_login 9 from page_sets.login_helpers import pinterest_login
10 10
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 IS_SINGLE_PAGE_APP = True 215 IS_SINGLE_PAGE_APP = True
216 ITEM_SELECTOR = '.hed > a' 216 ITEM_SELECTOR = '.hed > a'
217 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY 217 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
218 _CLOSE_BUTTON_SELECTOR = '.close' 218 _CLOSE_BUTTON_SELECTOR = '.close'
219 219
220 def _DidLoadDocument(self, action_runner): 220 def _DidLoadDocument(self, action_runner):
221 # Close the popup window. On Nexus 9 (and probably other tables) the popup 221 # Close the popup window. On Nexus 9 (and probably other tables) the popup
222 # window does not have a "Close" button, instead it has only a "Send link 222 # window does not have a "Close" button, instead it has only a "Send link
223 # to phone" button. So on tablets we run with the popup window open. The 223 # to phone" button. So on tablets we run with the popup window open. The
224 # popup is transparent, so this is mostly an aesthetical issue. 224 # popup is transparent, so this is mostly an aesthetical issue.
225 # TODO(catapult:#3028): Fix interpolation of JavaScript values.
226 has_button = action_runner.EvaluateJavaScript( 225 has_button = action_runner.EvaluateJavaScript(
227 '!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) 226 '!!document.querySelector({{ selector }})',
227 selector=self._CLOSE_BUTTON_SELECTOR)
228 if has_button: 228 if has_button:
229 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) 229 action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR)
230 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner) 230 super(WashingtonPostMobileStory, self)._DidLoadDocument(action_runner)
231 231
232 232
233 ############################################################################## 233 ##############################################################################
234 # Search browsing stories. 234 # Search browsing stories.
235 ############################################################################## 235 ##############################################################################
236 236
237 237
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 inner_save_function = 'document.querySelector(".nameAndIcons")' 468 inner_save_function = 'document.querySelector(".nameAndIcons")'
469 action_runner.WaitForElement(element_function=inner_save_function) 469 action_runner.WaitForElement(element_function=inner_save_function)
470 action_runner.ClickElement(element_function=inner_save_function) 470 action_runner.ClickElement(element_function=inner_save_function)
471 action_runner.Wait(1) # Wait to make navigation realistic. 471 action_runner.Wait(1) # Wait to make navigation realistic.
472 472
473 # Close selection. 473 # Close selection.
474 x_element_function = ('document.querySelector(' 474 x_element_function = ('document.querySelector('
475 '".Button.borderless.close.visible")') 475 '".Button.borderless.close.visible")')
476 action_runner.ClickElement(element_function=x_element_function) 476 action_runner.ClickElement(element_function=x_element_function)
477 action_runner.Wait(1) # Wait to make navigation realistic. 477 action_runner.Wait(1) # Wait to make navigation realistic.
OLDNEW
« no previous file with comments | « tools/perf/page_sets/repaint_helpers.py ('k') | tools/perf/page_sets/system_health/loading_stories.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698