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

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

Issue 1389383003: WIP: Introduce CompressibleString Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto crrev.com/1564773002 Created 4 years, 11 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/benchmarks/memory_infra.py ('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
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 6
7 from telemetry.page import page as page_module 7 from telemetry.page import page as page_module
8 from telemetry.page import shared_page_state 8 from telemetry.page import shared_page_state
9 from telemetry import story 9 from telemetry import story
10 10
11 from page_sets.login_helpers import google_login 11 from page_sets.login_helpers import google_login
12 12
13 13
14 DUMP_WAIT_TIME = 3 14 DUMP_WAIT_TIME = 3
15 15
16 16
17 class BlinkMemoryMobilePage(page_module.Page): 17 class BlinkMemoryMobilePage(page_module.Page):
18 def __init__(self, url, page_set, name): 18 def __init__(self, url, page_set, name):
19 super(BlinkMemoryMobilePage, self).__init__( 19 super(BlinkMemoryMobilePage, self).__init__(
20 url=url, page_set=page_set, name=name, 20 url=url, page_set=page_set, name=name,
21 shared_page_state_class=shared_page_state.SharedMobilePageState, 21 shared_page_state_class=shared_page_state.SharedMobilePageState,
22 credentials_path='data/credentials.json') 22 credentials_path='data/credentials.json')
23 self.archive_data_file = 'data/blink_memory_mobile.json' 23 self.archive_data_file = 'data/blink_memory_mobile.json'
24 24
25 def _DumpMemory(self, action_runner, phase): 25 def _DumpMemory(self, action_runner, phase):
26 with action_runner.CreateInteraction(phase): 26 with action_runner.CreateInteraction(phase):
27 action_runner.Wait(DUMP_WAIT_TIME) 27 action_runner.Wait(DUMP_WAIT_TIME)
28 action_runner.ForceGarbageCollection() 28 action_runner.ForceGarbageCollection()
29 action_runner.SimulateMemoryPressureNotification('critical') 29 action_runner.SimulateMemoryPressureNotification('critical')
30 # Swtich this manually!
31 action_runner.ExecuteJavaScript('window.purgeMemory()')
30 action_runner.Wait(DUMP_WAIT_TIME) 32 action_runner.Wait(DUMP_WAIT_TIME)
31 if not action_runner.tab.browser.DumpMemory(): 33 if not action_runner.tab.browser.DumpMemory():
32 logging.error('Unable to get a memory dump for %s.', self.name) 34 logging.error('Unable to get a memory dump for %s.', self.name)
33 35
34 def RunPageInteractions(self, action_runner): 36 def RunPageInteractions(self, action_runner):
35 action_runner.ScrollPage() 37 action_runner.ScrollPage()
36 self._DumpMemory(action_runner, 'scrolled') 38 self._DumpMemory(action_runner, 'scrolled')
37 39
38 40
39 class TheVergePage(BlinkMemoryMobilePage): 41 class TheVergePage(BlinkMemoryMobilePage):
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 # Why: Key products. 130 # Why: Key products.
129 self.AddStory(GmailPage(page_set=self)) 131 self.AddStory(GmailPage(page_set=self))
130 self.AddStory(BlinkMemoryMobilePage( 132 self.AddStory(BlinkMemoryMobilePage(
131 'http://googlewebmastercentral.blogspot.com/2015/04/rolling-out-mobile-f riendly-update.html?m=1', 133 'http://googlewebmastercentral.blogspot.com/2015/04/rolling-out-mobile-f riendly-update.html?m=1',
132 page_set=self, 134 page_set=self,
133 name='Blogger')) 135 name='Blogger'))
134 self.AddStory(BlinkMemoryMobilePage( 136 self.AddStory(BlinkMemoryMobilePage(
135 'https://plus.google.com/app/basic/110031535020051778989/posts?source=ap ppromo', 137 'https://plus.google.com/app/basic/110031535020051778989/posts?source=ap ppromo',
136 page_set=self, 138 page_set=self,
137 name='GooglePlus')) 139 name='GooglePlus'))
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/memory_infra.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698