Index: tools/perf/page_sets/system_health/loading_stories.py |
diff --git a/tools/perf/page_sets/system_health/loading_stories.py b/tools/perf/page_sets/system_health/loading_stories.py |
index b470d76985d31b54be685332b698a14ed8f15097..5e95b224fec06e1f4e844ba2b80a0be4f19fb0c7 100644 |
--- a/tools/perf/page_sets/system_health/loading_stories.py |
+++ b/tools/perf/page_sets/system_health/loading_stories.py |
@@ -178,16 +178,22 @@ class LoadWashingtonPostMobileStory(_LoadingStory): |
URL = 'https://www.washingtonpost.com/pwa' |
SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
_CLOSE_BUTTON_SELECTOR = '.close' |
+ _MAIL_BUTTON_SELECTOR = '.mailBlock' |
def _DidLoadDocument(self, action_runner): |
# Close the popup window. On Nexus 9 (and probably other tables) the popup |
# window does not have a "Close" button, instead it has only a "Send link |
# to phone" button. So on tablets we run with the popup window open. The |
# popup is transparent, so this is mostly an aesthetical issue. |
- has_button = action_runner.EvaluateJavaScript( |
+ action_runner.WaitForElement(selector="%s, %s" % |
+ (self._CLOSE_BUTTON_SELECTOR, self._MAIL_BUTTON_SELECTOR)) |
+ has_close_button = action_runner.EvaluateJavaScript( |
'!!document.querySelector("%s")' % self._CLOSE_BUTTON_SELECTOR) |
- if has_button: |
+ if has_close_button: |
action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR) |
+ else: |
petrcermak
2016/07/21 09:49:13
ditto
ulan
2016/07/21 09:53:25
Done.
|
+ assert action_runner.EvaluateJavaScript( |
+ '!!document.querySelector("%s")' % self._MAIL_BUTTON_SELECTOR) |
class LoadWikipediaStory(_LoadingStory): |