diff options
author | semenzato@chromium.org <semenzato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-19 22:14:14 +0000 |
---|---|---|
committer | semenzato@chromium.org <semenzato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-19 22:14:14 +0000 |
commit | ffd8afd8391366b1a0bdcc849d973dc1e5fee6d9 (patch) | |
tree | 49fb79253aa561e52901666c2fcce1be4e453e8a /tools/perf/profile_creators | |
parent | e35e1736650839e67d5ef43cc2a090b8a9e43a17 (diff) | |
download | chromium_src-ffd8afd8391366b1a0bdcc849d973dc1e5fee6d9.zip chromium_src-ffd8afd8391366b1a0bdcc849d973dc1e5fee6d9.tar.gz chromium_src-ffd8afd8391366b1a0bdcc849d973dc1e5fee6d9.tar.bz2 |
Telemetry: add multitab tests framework.
Adds to Telemetry the ability to map pages to tabs instead of having
all pages open sequentially in a single tab.
BUG=chromium:249906
TEST=ran the modified memory_multi_tab test
Review URL: https://codereview.chromium.org/26705004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf/profile_creators')
-rw-r--r-- | tools/perf/profile_creators/small_profile_creator.py | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/tools/perf/profile_creators/small_profile_creator.py b/tools/perf/profile_creators/small_profile_creator.py index 69fb0f9..0f51a60 100644 --- a/tools/perf/profile_creators/small_profile_creator.py +++ b/tools/perf/profile_creators/small_profile_creator.py @@ -6,7 +6,6 @@ import os from telemetry.core import util from telemetry.page import page_set -from telemetry.page import page_runner from telemetry.page import profile_creator class SmallProfileCreator(profile_creator.ProfileCreator): @@ -19,29 +18,17 @@ class SmallProfileCreator(profile_creator.ProfileCreator): typical_25 = os.path.join(util.GetBaseDir(), 'page_sets', 'typical_25.json') self._page_set = page_set.PageSet.FromFile(typical_25) - # Open all links in the same tab save for the last N_NUM_TABS links which + # Open all links in the same tab save for the last _NUM_TABS links which # are each opened in a new tab. self._NUM_TABS = 5 - def CanRunForPage(self, page): + def TabForPage(self, page, tab): idx = page.page_set.pages.index(page) - return idx <= (len(page.page_set.pages) - self._NUM_TABS) - - def DidNavigateToPage(self, page, tab): - num_pages_in_pageset = len(page.page_set.pages) - last_tab_loaded_automatically = num_pages_in_pageset - self._NUM_TABS - page_index = page.page_set.pages.index(page) - if (page_index == last_tab_loaded_automatically): - for i in xrange(last_tab_loaded_automatically + 1, num_pages_in_pageset): - # Load the last _NUM_TABS pages, each in a new tab. - t = tab.browser.tabs.New() - - page_state = page_runner.PageState() - page_state.PreparePage(page.page_set.pages[i], t) - page_state.ImplicitPageNavigation(page.page_set.pages[i], t) - - t.WaitForDocumentReadyStateToBeInteractiveOrBetter() - + # The last _NUM_TABS pages open a new tab. + if idx <= (len(page.page_set.pages) - self._NUM_TABS): + return tab + else: + return tab.browser.tabs.New() def MeasurePage(self, _, tab, results): # Can't use WaitForDocumentReadyStateToBeComplete() here due to |