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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py

Issue 820093002: Integration tests for desktop platforms and safebrowsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/integration_tests/chrome_proxy_metrics.py
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
index 7a070f46a02d0f6339b93435832015513af04c24..3ecc67621163754498889ebc450f492c67ab9b05 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -420,7 +420,7 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
results.AddValue(scalar.ScalarValue(
results.current_page, 'bypass', 'count', bypass_count))
- def AddResultsForSafebrowsing(self, tab, results):
+ def AddResultsForSafebrowsingMobile(self, tab, results):
count = 0
safebrowsing_count = 0
for resp in self.IterResponses(tab):
@@ -441,6 +441,27 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
'Safebrowsing failed (count=%d, safebrowsing_count=%d)\n' % (
count, safebrowsing_count))
+ def AddResultsForSafebrowsingDesktop(self, tab, results):
+ count = 0
+ safebrowsing_count = 0
+ for resp in self.IterResponses(tab):
+ count += 1
+ if resp.HasChromeProxyViaHeader():
+ safebrowsing_count += 1
+ else:
+ r = resp.response
+ raise ChromeProxyMetricException, (
+ '%s: Safebrowsing feature should be off for desktop.\n'
+ 'Reponse: status=(%d, %s)\nHeaders:\n %s' % (
+ r.url, r.status, r.status_text, r.headers))
+ if count == safebrowsing_count:
+ results.AddValue(scalar.ScalarValue(
+ results.current_page, 'safebrowsing', 'boolean', True))
+ else:
+ raise ChromeProxyMetricException, (
+ 'Safebrowsing failed (count=%d, safebrowsing_count=%d)\n' % (
+ count, safebrowsing_count))
+
def VerifyProxyInfo(self, tab, expected_proxies, expected_bad_proxies):
info = GetProxyInfoFromNetworkInternals(tab)
if not 'enabled' in info or not info['enabled']:

Powered by Google App Engine
This is Rietveld 408576698