From 63636c0e0e1bde0027aaca9cf80dffc25fddef1e Mon Sep 17 00:00:00 2001 From: ulan Date: Fri, 31 Jul 2015 11:18:26 -0700 Subject: [PATCH] Add long running gmail memory benchmark for background tab. This benchmark is for catching regressions in background GC scheduling, which differs from foreground GC scheduling. BUG=513149 CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_perf_bisect;tryserver.chromium.perf:win_perf_bisect;tryserver.chromium.perf:android_nexus5_perf_bisect Review URL: https://codereview.chromium.org/1266963003 Cr-Commit-Position: refs/heads/master@{#341369} --- tools/perf/benchmarks/memory.py | 13 ++++++++++++- tools/perf/page_sets/long_running_idle_google_cases.py | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/tools/perf/benchmarks/memory.py b/tools/perf/benchmarks/memory.py index a46af77ce239..8d715c10c1ee 100644 --- a/tools/perf/benchmarks/memory.py +++ b/tools/perf/benchmarks/memory.py @@ -56,4 +56,15 @@ class MemoryLongRunningIdleGmail(perf_benchmark.PerfBenchmark): @classmethod def Name(cls): - return 'memory.long_running_idle_gmail' \ No newline at end of file + return 'memory.long_running_idle_gmail' + + +class MemoryLongRunningIdleGmailBackground(perf_benchmark.PerfBenchmark): + """Use (recorded) real world web sites and measure memory consumption + of long running idle Gmail page in background tab""" + test = memory.Memory + page_set = page_sets.LongRunningIdleGmailBackgroundPageSet + + @classmethod + def Name(cls): + return 'memory.long_running_idle_gmail_background' \ No newline at end of file diff --git a/tools/perf/page_sets/long_running_idle_google_cases.py b/tools/perf/page_sets/long_running_idle_google_cases.py index e964b594a702..3f8ca9508773 100644 --- a/tools/perf/page_sets/long_running_idle_google_cases.py +++ b/tools/perf/page_sets/long_running_idle_google_cases.py @@ -15,6 +15,14 @@ def _CreateIdlePageClass(base_page_cls): return DerivedIdlePage +def _CreateIdleBackgroundPageClass(base_page_cls): + class DerivedIdlePage(base_page_cls): # pylint: disable=W0232 + def RunPageInteractions(self, action_runner): + action_runner.tab.browser.tabs.New() + action_runner.Wait(IDLE_TIME_IN_SECONDS) + return DerivedIdlePage + + class LongRunningIdleGmailPageSet(story.StorySet): def __init__(self): super(LongRunningIdleGmailPageSet, self).__init__( @@ -22,3 +30,13 @@ class LongRunningIdleGmailPageSet(story.StorySet): cloud_storage_bucket=story.PARTNER_BUCKET) self.AddStory( _CreateIdlePageClass(google_pages.GmailPage)(self)) + + +class LongRunningIdleGmailBackgroundPageSet(story.StorySet): + def __init__(self): + # Reuse the wpr of foreground gmail. + super(LongRunningIdleGmailBackgroundPageSet, self).__init__( + archive_data_file='data/long_running_idle_gmail_page.json', + cloud_storage_bucket=story.PARTNER_BUCKET) + self.AddStory( + _CreateIdleBackgroundPageClass(google_pages.GmailPage)(self)) \ No newline at end of file -- 2.11.4.GIT