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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/page_runner.py

Issue 10965027: Add web page replay to chrome_remote_control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace CreateForwarder with CreateReplayServer Created 8 years, 2 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
Index: tools/chrome_remote_control/chrome_remote_control/page_runner.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/page_runner.py b/tools/chrome_remote_control/chrome_remote_control/page_runner.py
index a3344144d0432a76e6d3b23d3398ff58a2cf6b47..f5fe9999678fd38c24f89b6c4813f71715a4e93f 100644
--- a/tools/chrome_remote_control/chrome_remote_control/page_runner.py
+++ b/tools/chrome_remote_control/chrome_remote_control/page_runner.py
@@ -7,7 +7,9 @@ import time
import traceback
import urlparse
+from chrome_remote_control import browser
from chrome_remote_control import page_test
+from chrome_remote_control import replay_server
from chrome_remote_control import util
class PageRunner(object):
@@ -26,10 +28,23 @@ class PageRunner(object):
self.Close()
def Run(self, options, possible_browser, test, results):
- with possible_browser.Create() as browser:
- with browser.ConnectToNthTab(0) as tab:
- for page in self.page_set:
- self._RunPage(options, page, tab, test, results)
+ archive_path = os.path.abspath(os.path.join(os.path.dirname(
+ self.page_set.file_path), self.page_set.archive_path))
+ if browser.Browser.CanUseReplayServer(archive_path, options.record):
+ extra_browser_args = replay_server.CHROME_FLAGS
+ else:
+ extra_browser_args = []
+ logging.warning('\n' + 80 * '*' + """\n
+ Page set archive does not exist, benchmarking against live sites!
+ Results won't be repeatable or comparable. To correct this, check out the
+ archives from src-internal or create a new archive using --record.
+ \n""" + 80 * '*' + '\n')
+
+ with possible_browser.Create(extra_browser_args) as b:
+ with b.CreateReplayServer(archive_path, options.record):
+ with b.ConnectToNthTab(0) as tab:
+ for page in self.page_set:
+ self._RunPage(options, page, tab, test, results)
def _RunPage(self, options, page, tab, test, results):
logging.info('Running %s' % page.url)

Powered by Google App Engine
This is Rietveld 408576698