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

Side by Side Diff: chrome/test/functional/memory.py

Issue 7548024: Refactor: Make PyAuto InstallExtension() take a string. Delete dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixup per kkania. Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/functional/extensions.py ('k') | chrome/test/functional/ntp.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import os 7 import os
8 import sys 8 import sys
9 import time 9 import time
10 10
(...skipping 22 matching lines...) Expand all
33 # Constants for all tests in this suite. 33 # Constants for all tests in this suite.
34 NUM_SECONDS_BETWEEN_MEASUREMENTS = 10 34 NUM_SECONDS_BETWEEN_MEASUREMENTS = 10
35 MEASUREMENT_LOG_MESSAGE_TEMPLATE = '[%s] %.2f MB (pid: %d)' 35 MEASUREMENT_LOG_MESSAGE_TEMPLATE = '[%s] %.2f MB (pid: %d)'
36 LOG_TO_OUTPUT_FILE = True 36 LOG_TO_OUTPUT_FILE = True
37 37
38 # Constants for testTabRendererProcessMemoryUsage. 38 # Constants for testTabRendererProcessMemoryUsage.
39 RENDERER_PROCESS_URL = 'http://chrome.angrybirds.com' 39 RENDERER_PROCESS_URL = 'http://chrome.angrybirds.com'
40 RENDERER_PROCESS_OUTPUT_FILE = 'renderer_process_mem.txt' 40 RENDERER_PROCESS_OUTPUT_FILE = 'renderer_process_mem.txt'
41 41
42 # Constants for testExtensionProcessMemoryUsage. 42 # Constants for testExtensionProcessMemoryUsage.
43 EXTENSION_LOCATION = pyauto.FilePath( 43 EXTENSION_LOCATION = os.path.abspath(os.path.join(
44 os.path.abspath(os.path.join(pyauto.PyUITest.DataDir(), 'extensions', 44 pyauto.PyUITest.DataDir(), 'extensions', 'google_talk.crx'))
45 'google_talk.crx')))
46 EXTENSION_PROCESS_NAME = 'Google Talk' 45 EXTENSION_PROCESS_NAME = 'Google Talk'
47 EXTENSION_PROCESS_OUTPUT_FILE = 'extension_process_mem.txt' 46 EXTENSION_PROCESS_OUTPUT_FILE = 'extension_process_mem.txt'
48 47
49 def _GetPidOfExtensionProcessByName(self, name): 48 def _GetPidOfExtensionProcessByName(self, name):
50 """Identifies the process ID of an extension process, given its name. 49 """Identifies the process ID of an extension process, given its name.
51 50
52 Args: 51 Args:
53 name: The string name of an extension process, as returned by the function 52 name: The string name of an extension process, as returned by the function
54 GetBrowserInfo(). 53 GetBrowserInfo().
55 54
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 usage = test_utils.GetMemoryUsageOfProcess(pid) 126 usage = test_utils.GetMemoryUsageOfProcess(pid)
128 current_time = time.asctime(time.localtime(time.time())) 127 current_time = time.asctime(time.localtime(time.time()))
129 self._LogMessage( 128 self._LogMessage(
130 self.EXTENSION_PROCESS_OUTPUT_FILE, 129 self.EXTENSION_PROCESS_OUTPUT_FILE,
131 self.MEASUREMENT_LOG_MESSAGE_TEMPLATE % (current_time, usage, pid)) 130 self.MEASUREMENT_LOG_MESSAGE_TEMPLATE % (current_time, usage, pid))
132 time.sleep(self.NUM_SECONDS_BETWEEN_MEASUREMENTS) 131 time.sleep(self.NUM_SECONDS_BETWEEN_MEASUREMENTS)
133 132
134 133
135 if __name__ == '__main__': 134 if __name__ == '__main__':
136 pyauto_functional.Main() 135 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/extensions.py ('k') | chrome/test/functional/ntp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698