| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import re | 5 import re |
| 6 | 6 |
| 7 from telemetry.page import page as page_module | 7 from telemetry.page import page as page_module |
| 8 from telemetry.page import page_set as page_set_module | 8 from telemetry.page import page_set as page_set_module |
| 9 | 9 |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 class GmailAltThreadlistConversationPage( | 29 class GmailAltThreadlistConversationPage( |
| 30 page_module.Page): | 30 page_module.Page): |
| 31 | 31 |
| 32 """ Why: Alternate between Inbox and the first email conversation. """ | 32 """ Why: Alternate between Inbox and the first email conversation. """ |
| 33 | 33 |
| 34 def __init__(self, page_set): | 34 def __init__(self, page_set): |
| 35 super(GmailAltThreadlistConversationPage, self).__init__( | 35 super(GmailAltThreadlistConversationPage, self).__init__( |
| 36 url='https://mail.google.com/mail/', | 36 url='https://mail.google.com/mail/', |
| 37 page_set=page_set, | 37 page_set=page_set, |
| 38 name='gmail_alt_threadlist_conversation') | 38 name='gmail_alt_threadlist_conversation', |
| 39 self.credentials_path = 'data/credentials.json' | 39 credentials_path = 'data/credentials.json') |
| 40 self.user_agent_type = 'desktop' | 40 self.user_agent_type = 'desktop' |
| 41 self.archive_data_file = 'data/gmail_alt_threadlist_conversation.json' | 41 self.archive_data_file = 'data/gmail_alt_threadlist_conversation.json' |
| 42 self.credentials = 'google' | 42 self.credentials = 'google' |
| 43 | 43 |
| 44 def RunNavigateSteps(self, action_runner): | 44 def RunNavigateSteps(self, action_runner): |
| 45 action_runner.NavigateToPage(self) | 45 action_runner.NavigateToPage(self) |
| 46 action_runner.WaitForJavaScriptCondition( | 46 action_runner.WaitForJavaScriptCondition( |
| 47 'window.gmonkey !== undefined && ' | 47 'window.gmonkey !== undefined && ' |
| 48 'document.getElementById("gb") !== null') | 48 'document.getElementById("gb") !== null') |
| 49 | 49 |
| 50 def RunEndure(self, action_runner): | 50 def RunEndure(self, action_runner): |
| 51 old_href = _GetCurrentLocation(action_runner) | 51 old_href = _GetCurrentLocation(action_runner) |
| 52 action_runner.ClickElement( | 52 action_runner.ClickElement( |
| 53 element_function=_CreateXpathFunction('//span[@email]')) | 53 element_function=_CreateXpathFunction('//span[@email]')) |
| 54 _WaitForLocationChange(action_runner, old_href) | 54 _WaitForLocationChange(action_runner, old_href) |
| 55 action_runner.Wait(1) | 55 action_runner.Wait(1) |
| 56 old_href = _GetCurrentLocation(action_runner) | 56 old_href = _GetCurrentLocation(action_runner) |
| 57 action_runner.ClickElement( | 57 action_runner.ClickElement( |
| 58 'a[href="https://mail.google.com/mail/u/0/?shva=1#inbox"]') | 58 'a[href="https://mail.google.com/mail/u/0/?shva=1#inbox"]') |
| 59 _WaitForLocationChange(action_runner, old_href) | 59 _WaitForLocationChange(action_runner, old_href) |
| 60 action_runner.Wait(1) | 60 action_runner.Wait(1) |
| 61 | 61 |
| 62 | 62 |
| 63 class GmailAltThreadlistConversationPageSet(page_set_module.PageSet): | 63 class GmailAltThreadlistConversationPageSet(page_set_module.PageSet): |
| 64 | 64 |
| 65 """ Chrome Endure test for GMail. """ | 65 """ Chrome Endure test for GMail. """ |
| 66 | 66 |
| 67 def __init__(self): | 67 def __init__(self): |
| 68 super(GmailAltThreadlistConversationPageSet, self).__init__( | 68 super(GmailAltThreadlistConversationPageSet, self).__init__( |
| 69 credentials_path='data/credentials.json', | |
| 70 user_agent_type='desktop', | 69 user_agent_type='desktop', |
| 71 archive_data_file='data/gmail_alt_threadlist_conversation.json', | 70 archive_data_file='data/gmail_alt_threadlist_conversation.json', |
| 72 bucket=page_set_module.PUBLIC_BUCKET) | 71 bucket=page_set_module.PUBLIC_BUCKET) |
| 73 | 72 |
| 74 self.AddPage(GmailAltThreadlistConversationPage(self)) | 73 self.AddPage(GmailAltThreadlistConversationPage(self)) |
| OLD | NEW |