telemetry.web_perf.timeline_based_page_test | index telemetry/web_perf/timeline_based_page_test.py

`# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.`

Modules
`` |  |
telemetry.page.page_test |  |  |

Classes
`` |  | telemetry.page.page_test.PageTest(__builtin__.object) TimelineBasedPageTest
class TimelineBasedPageTest(telemetry.page.page_test.PageTest)
`` | `Page test that collects metrics with TimelineBasedMeasurement. WillRunStory(), Measure() and DidRunStory() are all done in story_runner explicitly. We still need this wrapper around PageTest because it executes some browser related functions in the parent class, which is needed by Timeline Based Measurement benchmarks. This class will be removed after page_test's hooks are fully removed.`
| Method resolution order: TimelineBasedPageTest telemetry.page.page_test.PageTest __builtin__.object Methods defined here: ValidateAndMeasurePage(self, page, tab, results) `Collect all possible metrics and added them to results.` __init__(self, tbm) Data descriptors defined here: measurement Methods inherited from telemetry.page.page_test.PageTest: CustomizeBrowserOptions(self, options) `Override to add test-specific options to the BrowserOptions object` DidNavigateToPage(self, page, tab) `Override to do operations right after the page is navigated and after all waiting for completion has occurred.` DidRunPage(self, platform) `Called after the test run method was run, even if it failed.` DidStartBrowser(self, browser) `Override to customize the browser right after it has launched.` RestartBrowserBeforeEachPage(self) `Should the browser be restarted for the page? This returns true if the test needs to unconditionally restart the browser for each page. It may be called before the browser is started.` RunNavigateSteps(self, page, tab) `Navigates the tab to the page URL attribute. Runs the 'navigate_steps' page attribute as a compound action.` SetOptions(self, options) `Sets the BrowserFinderOptions instance to use.` StopBrowserAfterPage(self, browser, page) `Should the browser be stopped after the page is run? This is called after a page is run to decide whether the browser needs to be stopped to clean up its state. If it is stopped, then it will be restarted to run the next page. A test that overrides this can look at both the page and the browser to decide whether it needs to stop the browser.` TabForPage(self, page, browser) `Override to select a different tab for the page. For instance, to create a new tab for every page, return browser.tabs.New().` WillNavigateToPage(self, page, tab) `Override to do operations before the page is navigated, notably Telemetry will already have performed the following operations on the browser before calling this function: * Ensure only one tab is open. * Call WaitForDocumentReadyStateToComplete on the tab.` WillStartBrowser(self, platform) `Override to manipulate the browser environment before it launches.` Data descriptors inherited from telemetry.page.page_test.PageTest: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)` clear_cache_before_each_run `When set to True, the browser's disk and memory cache will be cleared before each run.` close_tabs_before_run `When set to True, all tabs are closed before running the test for the first time.` is_multi_tab_test `Returns True if the test opens multiple tabs. If the test overrides TabForPage, it is deemed a multi-tab test. Multi-tab tests do not retry after tab or browser crashes, whereas, single-tab tests too. That is because the state of multi-tab tests (e.g., how many tabs are open, etc.) is unknown after crashes.`