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

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

Issue 10874025: Use dummynet-based network simulation for Mac tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « DEPS ('k') | chrome/test/functional/webpagereplay.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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Basic pyauto performance tests. 6 """Basic pyauto performance tests.
7 7
8 For tests that need to be run for multiple iterations (e.g., so that average 8 For tests that need to be run for multiple iterations (e.g., so that average
9 and standard deviation values can be reported), the default number of iterations 9 and standard deviation values can be reported), the default number of iterations
10 run for each of these tests is specified by |_DEFAULT_NUM_ITERATIONS|. 10 run for each of these tests is specified by |_DEFAULT_NUM_ITERATIONS|.
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 '--activate-on-launch', 2268 '--activate-on-launch',
2269 '--no-first-run', 2269 '--no-first-run',
2270 '--no-proxy-server', 2270 '--no-proxy-server',
2271 ] 2271 ]
2272 2272
2273 @classmethod 2273 @classmethod
2274 def Path(cls, key, **kwargs): 2274 def Path(cls, key, **kwargs):
2275 return FormatChromePath(cls._PATHS[key], **kwargs) 2275 return FormatChromePath(cls._PATHS[key], **kwargs)
2276 2276
2277 @classmethod 2277 @classmethod
2278 def ReplayServer(cls, test_name): 2278 def ReplayServer(cls, test_name, replay_options=None):
2279 archive_path = cls.Path('archive', test_name=test_name) 2279 archive_path = cls.Path('archive', test_name=test_name)
2280 return webpagereplay.ReplayServer(archive_path) 2280 return webpagereplay.ReplayServer(archive_path, replay_options)
2281 2281
2282 2282
2283 class PageCyclerNetSimTest(BasePageCyclerTest): 2283 class PageCyclerNetSimTest(BasePageCyclerTest):
2284 """Tests to run Web Page Replay backed page cycler tests.""" 2284 """Tests to run Web Page Replay backed page cycler tests."""
2285 MAX_ITERATION_SECONDS = 180 2285 MAX_ITERATION_SECONDS = 180
2286 2286
2287 def ExtraChromeFlags(self): 2287 def ExtraChromeFlags(self):
2288 """Ensures Chrome is launched with custom flags. 2288 """Ensures Chrome is launched with custom flags.
2289 2289
2290 Returns: 2290 Returns:
(...skipping 12 matching lines...) Expand all
2303 start_url += '&auto=1' 2303 start_url += '&auto=1'
2304 return start_url 2304 return start_url
2305 2305
2306 def RunPageCyclerTest(self, test_name, description): 2306 def RunPageCyclerTest(self, test_name, description):
2307 """Runs the specified PageCycler test. 2307 """Runs the specified PageCycler test.
2308 2308
2309 Args: 2309 Args:
2310 test_name: name for archive (.wpr) and config (.js) files. 2310 test_name: name for archive (.wpr) and config (.js) files.
2311 description: a string description for the test 2311 description: a string description for the test
2312 """ 2312 """
2313 with PageCyclerReplay.ReplayServer(test_name) as replay_server: 2313 replay_options = None
2314 if replay_server.is_record_mode: 2314 if self.IsMac():
Nirnimesh 2012/08/22 23:40:49 please add a comment here
2315 replay_options = ('--no-admin-check', '--net', 'fios')
2316 with PageCyclerReplay.ReplayServer(test_name, replay_options) as server:
2317 if server.is_record_mode:
2315 self._num_iterations = 1 2318 self._num_iterations = 1
2316 super_self = super(PageCyclerNetSimTest, self) 2319 super_self = super(PageCyclerNetSimTest, self)
2317 super_self.RunPageCyclerTest(test_name, description) 2320 super_self.RunPageCyclerTest(test_name, description)
2318 2321
2319 def test2012Q2(self): 2322 def test2012Q2(self):
2320 self.RunPageCyclerTest('2012Q2', '2012Q2') 2323 self.RunPageCyclerTest('2012Q2', '2012Q2')
2321 2324
2322 2325
2323 class MemoryTest(BasePerfTest): 2326 class MemoryTest(BasePerfTest):
2324 """Tests to measure memory consumption under different usage scenarios.""" 2327 """Tests to measure memory consumption under different usage scenarios."""
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 """Identifies the port number to which the server is currently bound. 2656 """Identifies the port number to which the server is currently bound.
2654 2657
2655 Returns: 2658 Returns:
2656 The numeric port number to which the server is currently bound. 2659 The numeric port number to which the server is currently bound.
2657 """ 2660 """
2658 return self._server.server_address[1] 2661 return self._server.server_address[1]
2659 2662
2660 2663
2661 if __name__ == '__main__': 2664 if __name__ == '__main__':
2662 pyauto_functional.Main() 2665 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « DEPS ('k') | chrome/test/functional/webpagereplay.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698