Commit fb34cf41 authored by Yuheng Huang's avatar Yuheng Huang Committed by Chromium LUCI CQ

Tab Search: Add memory benchmark stories

Add tab_search:measure_memory:before and tab_search:measure_memory:after
to measure memory before/after open tab search.
Add tab_search:clean_slate to benchmark tab search without any traffic.

Bug: 1099917
Change-Id: I748609a91af8866c9814ff0cf2a17e92dd197d5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622951Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Reviewed-by: default avatarThomas Lukaszewicz <tluk@chromium.org>
Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842613}
parent 6456e679
{
"archives": {
"tab_search:clean_slate": {
"DEFAULT": "tab_search_desktop_1b410a96cc.wprgo"
},
"tab_search:close_and_open:2020": {
"DEFAULT": "tab_search_desktop_1b410a96cc.wprgo"
},
"tab_search:close_and_open:loading:2020": {
"DEFAULT": "tab_search_desktop_5284f907bd.wprgo"
},
"tab_search:measure_memory:after": {
"DEFAULT": "tab_search_desktop_1b410a96cc.wprgo"
},
"tab_search:measure_memory:before": {
"DEFAULT": "tab_search_desktop_1b410a96cc.wprgo"
},
"tab_search:scroll_up_and_down:2020": {
"DEFAULT": "tab_search_desktop_0c9707c535.wprgo"
},
......
......@@ -17,6 +17,9 @@ class TabSearchStorySet(story.StorySet):
tab_search_story.TabSearchStoryCloseAndOpen,
tab_search_story.TabSearchStoryCloseAndOpenLoading,
tab_search_story.TabSearchStoryScrollUpAndDown,
tab_search_story.TabSearchStoryCleanSlate,
tab_search_story.TabSearchStoryMeasureMemoryBefore,
tab_search_story.TabSearchStoryMeasureMemoryAfter,
]
def __init__(self):
......
......@@ -75,7 +75,8 @@ class TabSearchStory(page.Page):
def RunNavigateSteps(self, action_runner):
url_list = self.URL_LIST
tabs = action_runner.tab.browser.tabs
tabs[0].Navigate('https://' + url_list[0])
if len(url_list) > 0:
tabs[0].Navigate('https://' + url_list[0])
for url in url_list[1:]:
new_tab = tabs.New()
new_tab.Navigate('https://' + url)
......@@ -255,6 +256,50 @@ class TabSearchStoryScrollUpAndDown(TabSearchStory):
self.ScrollUpAndDown(action_runner)
class TabSearchStoryCleanSlate(TabSearchStory):
NAME = 'tab_search:clean_slate'
URL_LIST = []
URL = 'about:blank'
WAIT_FOR_NETWORK_QUIESCENCE = False
def InteractWithPage(self, action_runner):
action_runner.Wait(1)
class TabSearchStoryMeasureMemory(TabSearchStory):
URL_LIST = []
URL = 'about:blank'
WAIT_FOR_NETWORK_QUIESCENCE = False
def WillStartTracing(self, chrome_trace_config):
chrome_trace_config.category_filter.AddExcludedCategory('*')
chrome_trace_config.category_filter.AddIncludedCategory('blink.console')
chrome_trace_config.category_filter.AddDisabledByDefault(
'disabled-by-default-memory-infra')
def GetExtraTracingMetrics(self):
return ['memoryMetric']
class TabSearchStoryMeasureMemoryBefore(TabSearchStoryMeasureMemory):
NAME = 'tab_search:measure_memory:before'
def RunNavigateSteps(self, action_runner):
super(TabSearchStoryMeasureMemoryBefore,
self).RunNavigateSteps(action_runner)
action_runner.MeasureMemory(deterministic_mode=True)
def InteractWithPage(self, action_runner):
action_runner.Wait(1)
class TabSearchStoryMeasureMemoryAfter(TabSearchStoryMeasureMemory):
NAME = 'tab_search:measure_memory:after'
def InteractWithPage(self, action_runner):
action_runner.MeasureMemory(deterministic_mode=True)
SCROLL_ELEMENT_FUNCTION = '''
document.querySelector('tab-search-app').shadowRoot.getElementById('tabsList')
'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment