Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: tools/perf/page_sets/idle_multi_tab_cases.py

Issue 1145173002: Add benchmark that tests garbage collector and idle time handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable for Android to avoid OOM crash (benchmark needs > 700MB) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/perf/page_sets/idle_multi_tab_cases.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6
7 from telemetry.page import page_set as page_set_module
8
9 from page_sets import top_pages
10 from page_sets import top_7_stress
11
12
13 def _SpawnTab(action_runner):
14 return action_runner.EvaluateJavaScript('__telemetry_spawn_tab()')
15
16
17 def _CloseTab(action_runner, tab):
18 action_runner.EvaluateJavaScript('__telemetry_close_tab(' + str(tab) + ')')
19
20
21 def _CreateIdleMultiTabPageClass(base_page_cls, base_js):
22 class DerivedIdleMultiTabPage(base_page_cls): # pylint: disable=W0232
23
24 def RunPageInteractions(self, action_runner):
25 MAX_TABS = 10
26 action_runner.ExecuteJavaScript(base_js)
27 tabs = {}
28 # Slowly open tabs.
29 for tab in xrange(MAX_TABS):
30 tabs[tab] = _SpawnTab(action_runner)
31 action_runner.Wait(1)
32 action_runner.Wait(20)
33 # Slowly close tabs.
34 for tab in xrange(MAX_TABS):
35 _CloseTab(action_runner, tabs[tab])
36 action_runner.Wait(1)
37 action_runner.Wait(30)
38 # Quickly open tabs.
39 for tab in xrange(MAX_TABS):
40 tabs[tab] = _SpawnTab(action_runner)
41 action_runner.Wait(20)
42 # Quickly close tabs.
43 for tab in xrange(MAX_TABS):
44 _CloseTab(action_runner, tabs[tab])
45 action_runner.Wait(30)
46 return DerivedIdleMultiTabPage
47
48
49 class IdleMultiTabCasesPageSet(page_set_module.PageSet):
50
51 """ Pages for testing GC efficiency on idle pages. """
52
53 def __init__(self):
54 super(IdleMultiTabCasesPageSet, self).__init__(
55 user_agent_type='desktop',
56 archive_data_file='data/top_25.json',
57 bucket=page_set_module.PARTNER_BUCKET)
58 with open(os.path.join(os.path.dirname(__file__),
59 'idle_multi_tab_cases.js')) as f:
60 base_js = f.read()
61 pages = [
62 top_pages.GoogleDocPage,
63 top_7_stress.GmailPage,
64 top_7_stress.GooglePlusPage,
65 ]
66 for page in pages:
67 self.AddUserStory(_CreateIdleMultiTabPageClass(page, base_js)(self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/idle_multi_tab_cases.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698