Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 page_sets.system_health import system_health_story | 5 from page_sets.system_health import system_health_story |
| 6 from page_sets.system_health import platforms | |
| 6 | 7 |
| 7 | 8 |
| 8 class BlankAboutBlankStory(system_health_story.SystemHealthStory): | 9 class BlankAboutBlankStory(system_health_story.SystemHealthStory): |
| 9 """Story that loads the about:blank page.""" | 10 """Story that loads the about:blank page.""" |
| 10 | 11 |
| 11 NAME = 'blank:about:blank' | 12 NAME = 'blank:about:blank' |
| 12 URL = 'about:blank' | 13 URL = 'about:blank' |
| 13 | 14 |
| 14 def _DidLoadDocument(self, action_runner): | 15 def _DidLoadDocument(self, action_runner): |
| 15 # Request a RAF and wait for it to be processed to ensure that the metric | 16 # Request a RAF and wait for it to be processed to ensure that the metric |
| 16 # Startup.FirstWebContents.NonEmptyPaint2 is recorded. | 17 # Startup.FirstWebContents.NonEmptyPaint2 is recorded. |
| 17 action_runner.ExecuteJavaScript( | 18 action_runner.ExecuteJavaScript( |
| 18 """ | 19 """ |
| 19 window.__hasRunRAF = false; | 20 window.__hasRunRAF = false; |
| 20 requestAnimationFrame(function() { | 21 requestAnimationFrame(function() { |
| 21 window.__hasRunRAF = true; | 22 window.__hasRunRAF = true; |
| 22 }); | 23 }); |
| 23 """ | 24 """ |
| 24 ) | 25 ) |
| 25 action_runner.WaitForJavaScriptCondition("window.__hasRunRAF") | 26 action_runner.WaitForJavaScriptCondition("window.__hasRunRAF") |
| 27 | |
| 28 | |
| 29 class MobileNewTabPageStory(system_health_story.SystemHealthStory): | |
| 30 """Story that loads new tab page and opens menu.""" | |
| 31 | |
| 32 NAME = 'blank:about:newtab' | |
|
perezju
2017/03/31 08:45:54
I don't think this is a "blank" story, it's actual
ssid
2017/04/04 03:43:48
Done.
| |
| 33 URL = 'chrome://newtab' | |
| 34 | |
| 35 def RunPageInteractions(self, action_runner): | |
| 36 package = action_runner.tab.browser.GetBrowserInfo().package_name | |
| 37 platform = action_runner.tab.browser.platform | |
| 38 menu_button = package+':id/menu_button' | |
| 39 platform.system_ui.WaitForUiNode(resource_id=menu_button) | |
| 40 menu_button = platform.system_ui.GetUiNode(resource_id=menu_button) | |
| 41 menu_button.Tap() | |
| 42 platform.system_ui.WaitForUiNode(resource_id=package+':id/menu_item_text') | |
| 43 | |
| 44 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | |
| OLD | NEW |