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

Unified 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: Drop DEPS change (previously applied) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/functional/webpagereplay.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/perf.py
diff --git a/chrome/test/functional/perf.py b/chrome/test/functional/perf.py
index f4cbe4afff6177961b781e7ddeaf62f8bc7a6cfa..a0eda573b4f9b0ac14f459d23537167dfb60ba72 100755
--- a/chrome/test/functional/perf.py
+++ b/chrome/test/functional/perf.py
@@ -2275,9 +2275,9 @@ class PageCyclerReplay(object):
return FormatChromePath(cls._PATHS[key], **kwargs)
@classmethod
- def ReplayServer(cls, test_name):
+ def ReplayServer(cls, test_name, replay_options=None):
archive_path = cls.Path('archive', test_name=test_name)
- return webpagereplay.ReplayServer(archive_path)
+ return webpagereplay.ReplayServer(archive_path, replay_options)
class PageCyclerNetSimTest(BasePageCyclerTest):
@@ -2310,8 +2310,16 @@ class PageCyclerNetSimTest(BasePageCyclerTest):
test_name: name for archive (.wpr) and config (.js) files.
description: a string description for the test
"""
- with PageCyclerReplay.ReplayServer(test_name) as replay_server:
- if replay_server.is_record_mode:
+ replay_options = None
+ if self.IsMac():
+ # Adding --net=fios uses dummynet by default (which Macs have).
+ # Linux would work after installing ipfw/dummynet and ipfw kernel module.
+ # Windows is trickier. It would require running WPR on a separate machine
+ # because running on same machine does not work with Windows loopback.
+ # Adding --no-admin-check skips running the entire script as sudo.
+ replay_options = ('--no-admin-check', '--net', 'fios')
+ with PageCyclerReplay.ReplayServer(test_name, replay_options) as server:
+ if server.is_record_mode:
self._num_iterations = 1
super_self = super(PageCyclerNetSimTest, self)
super_self.RunPageCyclerTest(test_name, description)
« no previous file with comments | « no previous file | chrome/test/functional/webpagereplay.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698