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

Unified Diff: tools/chrome_proxy/live_tests/chrome_proxy_measurements.py

Issue 1098253004: Move top_20 tests to a separate suite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ChromeProxyValidation in common in integration_tests Created 5 years, 8 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_proxy/live_tests/chrome_proxy_measurements.py
diff --git a/tools/chrome_proxy/live_tests/chrome_proxy_measurements.py b/tools/chrome_proxy/live_tests/chrome_proxy_measurements.py
new file mode 100644
index 0000000000000000000000000000000000000000..066c26f75b22387304168e00b842aeedacd71cb5
--- /dev/null
+++ b/tools/chrome_proxy/live_tests/chrome_proxy_measurements.py
@@ -0,0 +1,47 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import logging
+
+import chrome_proxy_metrics as metrics
+from telemetry.core import exceptions
+from telemetry.page import page_test
+
+class ChromeProxyLatency(page_test.PageTest):
+ """Chrome proxy latency measurement."""
+
+ def __init__(self, *args, **kwargs):
+ super(ChromeProxyLatency, self).__init__(*args, **kwargs)
+ self._metrics = metrics.ChromeProxyMetric()
+
+ def CustomizeBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')
+
+ def WillNavigateToPage(self, page, tab):
+ tab.ClearCache(force=True)
+
+ def ValidateAndMeasurePage(self, page, tab, results):
+ # Wait for the load event.
+ tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ self._metrics.AddResultsForLatency(tab, results)
+
+
+class ChromeProxyDataSaving(page_test.PageTest):
+ """Chrome proxy data saving measurement."""
+ def __init__(self, *args, **kwargs):
+ super(ChromeProxyDataSaving, self).__init__(*args, **kwargs)
+ self._metrics = metrics.ChromeProxyMetric()
+
+ def CustomizeBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')
+
+ def WillNavigateToPage(self, page, tab):
+ tab.ClearCache(force=True)
+ self._metrics.Start(page, tab)
+
+ def ValidateAndMeasurePage(self, page, tab, results):
+ # Wait for the load event.
+ tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ self._metrics.Stop(page, tab)
+ self._metrics.AddResultsForDataSaving(tab, results)
« no previous file with comments | « tools/chrome_proxy/live_tests/chrome_proxy_benchmark.py ('k') | tools/chrome_proxy/live_tests/chrome_proxy_metrics.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698