| 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 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
| 5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 class KeyDesktopSitesPage(page_module.Page): | 8 class KeyDesktopSitesPage(page_module.Page): |
| 9 | 9 |
| 10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
| 11 super(KeyDesktopSitesPage, self).__init__( | 11 super(KeyDesktopSitesPage, self).__init__( |
| 12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') | 12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') |
| 13 self.archive_data_file = 'data/key_desktop_sites.json' | 13 self.archive_data_file = 'data/key_desktop_sites.json' |
| 14 | 14 |
| 15 def RunPageInteractions(self, action_runner): | 15 def RunPageInteractions(self, action_runner): |
| 16 interaction = action_runner.BeginGestureInteraction( | 16 interaction = action_runner.BeginGestureInteraction( |
| 17 'ScrollAction', is_smooth=True) | 17 'ScrollAction') |
| 18 action_runner.ScrollPage() | 18 action_runner.ScrollPage() |
| 19 interaction.End() | 19 interaction.End() |
| 20 | 20 |
| 21 | 21 |
| 22 class FacebookPage(KeyDesktopSitesPage): | 22 class FacebookPage(KeyDesktopSitesPage): |
| 23 | 23 |
| 24 def __init__(self, page_set): | 24 def __init__(self, page_set): |
| 25 super(FacebookPage, self).__init__( | 25 super(FacebookPage, self).__init__( |
| 26 url='http://facebook.com', | 26 url='http://facebook.com', |
| 27 page_set=page_set) | 27 page_set=page_set) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 self.scrollable_element_function = ''' | 39 self.scrollable_element_function = ''' |
| 40 function(callback) { | 40 function(callback) { |
| 41 gmonkey.load('2.0', function(api) { | 41 gmonkey.load('2.0', function(api) { |
| 42 callback(api.getScrollableElement()); | 42 callback(api.getScrollableElement()); |
| 43 }); | 43 }); |
| 44 }''' | 44 }''' |
| 45 self.credentials = 'google' | 45 self.credentials = 'google' |
| 46 | 46 |
| 47 def RunPageInteractions(self, action_runner): | 47 def RunPageInteractions(self, action_runner): |
| 48 interaction = action_runner.BeginGestureInteraction( | 48 interaction = action_runner.BeginGestureInteraction( |
| 49 'ScrollAction', is_smooth=True) | 49 'ScrollAction') |
| 50 action_runner.ScrollPage() | 50 action_runner.ScrollPage() |
| 51 interaction.End() | 51 interaction.End() |
| 52 action_runner.WaitForJavaScriptCondition( | 52 action_runner.WaitForJavaScriptCondition( |
| 53 'window.gmonkey !== undefined && ' | 53 'window.gmonkey !== undefined && ' |
| 54 'document.getElementById("gb") !== null') | 54 'document.getElementById("gb") !== null') |
| 55 | 55 |
| 56 | 56 |
| 57 class GoogleCalendarPage(KeyDesktopSitesPage): | 57 class GoogleCalendarPage(KeyDesktopSitesPage): |
| 58 | 58 |
| 59 def __init__(self, page_set): | 59 def __init__(self, page_set): |
| (...skipping 16 matching lines...) Expand all Loading... |
| 76 page_set=page_set) | 76 page_set=page_set) |
| 77 | 77 |
| 78 self.scrollable_element_function = ''' | 78 self.scrollable_element_function = ''' |
| 79 function(callback) { | 79 function(callback) { |
| 80 callback(document.getElementsByClassName('doclistview-list')[0]); | 80 callback(document.getElementsByClassName('doclistview-list')[0]); |
| 81 }''' | 81 }''' |
| 82 self.credentials = 'google' | 82 self.credentials = 'google' |
| 83 | 83 |
| 84 def RunPageInteractions(self, action_runner): | 84 def RunPageInteractions(self, action_runner): |
| 85 interaction = action_runner.BeginGestureInteraction( | 85 interaction = action_runner.BeginGestureInteraction( |
| 86 'ScrollAction', is_smooth=True) | 86 'ScrollAction') |
| 87 action_runner.ScrollPage() | 87 action_runner.ScrollPage() |
| 88 interaction.End() | 88 interaction.End() |
| 89 action_runner.WaitForJavaScriptCondition( | 89 action_runner.WaitForJavaScriptCondition( |
| 90 'document.getElementsByClassName("doclistview-list").length') | 90 'document.getElementsByClassName("doclistview-list").length') |
| 91 | 91 |
| 92 | 92 |
| 93 class GoogleDocPage(KeyDesktopSitesPage): | 93 class GoogleDocPage(KeyDesktopSitesPage): |
| 94 | 94 |
| 95 def __init__(self, page_set): | 95 def __init__(self, page_set): |
| 96 super(GoogleDocPage, self).__init__( | 96 super(GoogleDocPage, self).__init__( |
| 97 # pylint: disable=C0301 | 97 # pylint: disable=C0301 |
| 98 url='https://docs.google.com/a/google.com/document/d/1XMAtPiVFZfItsMUOYl39
v5YA8bcSPe4LDrVO25OdsCU/edit', | 98 url='https://docs.google.com/a/google.com/document/d/1XMAtPiVFZfItsMUOYl39
v5YA8bcSPe4LDrVO25OdsCU/edit', |
| 99 page_set=page_set) | 99 page_set=page_set) |
| 100 | 100 |
| 101 self.scrollable_element_function = ''' | 101 self.scrollable_element_function = ''' |
| 102 function(callback) { | 102 function(callback) { |
| 103 callback(document.getElementsByClassName('kix-appview-editor')[0]); | 103 callback(document.getElementsByClassName('kix-appview-editor')[0]); |
| 104 }''' | 104 }''' |
| 105 self.credentials = 'google' | 105 self.credentials = 'google' |
| 106 | 106 |
| 107 def RunPageInteractions(self, action_runner): | 107 def RunPageInteractions(self, action_runner): |
| 108 interaction = action_runner.BeginGestureInteraction( | 108 interaction = action_runner.BeginGestureInteraction( |
| 109 'ScrollAction', is_smooth=True) | 109 'ScrollAction') |
| 110 action_runner.ScrollPage() | 110 action_runner.ScrollPage() |
| 111 interaction.End() | 111 interaction.End() |
| 112 action_runner.WaitForJavaScriptCondition( | 112 action_runner.WaitForJavaScriptCondition( |
| 113 'document.getElementsByClassName("kix-appview-editor").length') | 113 'document.getElementsByClassName("kix-appview-editor").length') |
| 114 | 114 |
| 115 | 115 |
| 116 class KeyDesktopSitesPageSet(page_set_module.PageSet): | 116 class KeyDesktopSitesPageSet(page_set_module.PageSet): |
| 117 | 117 |
| 118 """ Sites of Interest """ | 118 """ Sites of Interest """ |
| 119 | 119 |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 '&q=black%20screen%20amd&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS' | 844 '&q=black%20screen%20amd&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS' |
| 845 '%20Area%20Feature%20Status%20Owner%20Summary'), | 845 '%20Area%20Feature%20Status%20Owner%20Summary'), |
| 846 'http://mlb.mlb.com/index.jsp', | 846 'http://mlb.mlb.com/index.jsp', |
| 847 'http://www.nfl.com/', | 847 'http://www.nfl.com/', |
| 848 'http://airbnb.github.com/infinity/demo-on.html', | 848 'http://airbnb.github.com/infinity/demo-on.html', |
| 849 'http://habrahabr.ru/post/149892/#habracut' | 849 'http://habrahabr.ru/post/149892/#habracut' |
| 850 ] | 850 ] |
| 851 | 851 |
| 852 for url in urls_list: | 852 for url in urls_list: |
| 853 self.AddUserStory(KeyDesktopSitesPage(url, self)) | 853 self.AddUserStory(KeyDesktopSitesPage(url, self)) |
| OLD | NEW |