| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
| 6 from telemetry.page import page_set as page_set_module | 6 from telemetry.page import page_set as page_set_module |
| 7 | 7 |
| 8 _SCROLL_LIST_ITEM = ('.scroll-list-item .%s') | 8 _SCROLL_LIST_ITEM = ('.scroll-list-item .%s') |
| 9 _NUM_REPEATS_FOR_EMAIL_OPEN = 40 | 9 _NUM_REPEATS_FOR_EMAIL_OPEN = 40 |
| 10 _OPEN_CLOSE_WAIT_TIME = 0.3 | 10 _OPEN_CLOSE_WAIT_TIME = 0.3 |
| 11 | 11 |
| 12 | 12 |
| 13 class InboxPage(page_module.Page): | 13 class InboxPage(page_module.Page): |
| 14 """A class defining inbox page for telemetry.""" | 14 """A class defining inbox page for telemetry.""" |
| 15 | 15 |
| 16 def __init__(self, page_set): | 16 def __init__(self, page_set): |
| 17 super(InboxPage, self).__init__( | 17 super(InboxPage, self).__init__( |
| 18 url=('http://localhost/?mark_read_on_open=false&' | 18 url=('http://localhost/?mark_read_on_open=false&' |
| 19 'jsmode=du&preload_anim=True&welcome=0'), | 19 'jsmode=du&preload_anim=True&welcome=0'), |
| 20 page_set=page_set, | 20 page_set=page_set, |
| 21 credentials_path='data/inbox_credentials.json', | 21 credentials_path='data/inbox_credentials.json', |
| 22 name='Inbox') | 22 name='Inbox') |
| 23 self.user_agent_type = 'desktop' | 23 self.user_agent_type = 'desktop' |
| 24 self.credentials = 'google' | 24 self.credentials = 'google' |
| 25 | 25 |
| 26 def RunNavigateSteps(self, action_runner): | 26 def RunNavigateSteps(self, action_runner): |
| 27 action_runner.NavigateToPage(self, 180) | 27 action_runner.Navigate(self.url, timeout_in_seconds=180) |
| 28 | 28 |
| 29 def RunPageInteractions(self, action_runner): | 29 def RunPageInteractions(self, action_runner): |
| 30 self.OpenCloseConv(action_runner) | 30 self.OpenCloseConv(action_runner) |
| 31 | 31 |
| 32 def _WaitForItemOpen(self, action_runner): | 32 def _WaitForItemOpen(self, action_runner): |
| 33 action_runner.WaitForJavaScriptCondition( | 33 action_runner.WaitForJavaScriptCondition( |
| 34 'BT_AutoTestHelper.getInstance().getOpenItemId() && ' | 34 'BT_AutoTestHelper.getInstance().getOpenItemId() && ' |
| 35 'BT_AutoTestHelper.getInstance().' | 35 'BT_AutoTestHelper.getInstance().' |
| 36 'getOpenItemLoadedRenderComplete() && ' | 36 'getOpenItemLoadedRenderComplete() && ' |
| 37 'BT_AutoTestHelper.getInstance().getOutstandingRenderCount() ' | 37 'BT_AutoTestHelper.getInstance().getOutstandingRenderCount() ' |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 """Inbox page set.""" | 78 """Inbox page set.""" |
| 79 | 79 |
| 80 def __init__(self): | 80 def __init__(self): |
| 81 super(InboxPageSet, self).__init__( | 81 super(InboxPageSet, self).__init__( |
| 82 user_agent_type='desktop', | 82 user_agent_type='desktop', |
| 83 archive_data_file='data/inbox_data.json', | 83 archive_data_file='data/inbox_data.json', |
| 84 bucket=page_set_module.INTERNAL_BUCKET | 84 bucket=page_set_module.INTERNAL_BUCKET |
| 85 ) | 85 ) |
| 86 | 86 |
| 87 self.AddUserStory(InboxPage(self)) | 87 self.AddUserStory(InboxPage(self)) |
| OLD | NEW |