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

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: Addressed code review comments. Created 5 years, 11 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/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 8857a56e4cff95393360195f389fa1e3a96bc157..fde33b1a78fa45325c8db6f248ff33c176630ad2 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -270,7 +270,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
@@ -310,8 +310,26 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
r.headers))
via_fallback_count += 1
- results.AddValue(scalar.ScalarValue(
- results.current_page, 'via_fallback', 'count', via_fallback_count))
+ def AddResultsForSafebrowsingDesktop(self, tab, results):
sclittle 2015/01/22 23:15:14 Move this method definition up above AddResultsFor
Not at Google. Contact bengr 2015/01/23 17:11:34 Done.
+ count = 0
+ safebrowsing_count = 0
+ for resp in self.IterResponses(tab):
sclittle 2015/01/22 23:15:14 What do you actually expect to happen here? Should
Not at Google. Contact bengr 2015/01/23 17:11:34 Done.
+ count += 1
+ if resp.HasChromeProxyViaHeader():
+ safebrowsing_count += 1
sclittle 2015/01/22 23:15:14 Why is this called safebrowsing_count if you're co
Not at Google. Contact bengr 2015/01/23 17:11:34 Changed to viaheader_count. Had originally kept it
+ 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))
sclittle 2015/01/22 23:15:14 Instead of just a boolean, how about adding both c
Not at Google. Contact bengr 2015/01/23 17:11:34 Done. Added count. safebrowsing_count is redundant
+ else:
+ raise ChromeProxyMetricException, (
+ 'Safebrowsing failed (count=%d, safebrowsing_count=%d)\n' % (
+ count, safebrowsing_count))
def AddResultsForHTTPToDirectFallback(self, tab, results):
via_fallback_count = 0

Powered by Google App Engine
This is Rietveld 408576698