OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 import logging | |
6 | |
7 from common import chrome_proxy_metrics as metrics | |
8 from telemetry.core import exceptions | |
9 from telemetry.page import page_test | |
10 | |
11 class ChromeProxyLatency(page_test.PageTest): | |
12 """Chrome proxy latency measurement.""" | |
13 | |
14 def __init__(self, *args, **kwargs): | |
15 super(ChromeProxyLatency, self).__init__(*args, **kwargs) | |
16 self._metrics = metrics.ChromeProxyMetric() | |
sclittle
2015/04/30 00:07:58
I'm confused, where is metrics.ChromeProxyMetric()
bustamante
2015/04/30 20:30:40
I'm not sure why this worked, but I added back chr
| |
17 | |
18 def CustomizeBrowserOptions(self, options): | |
19 options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth') | |
20 | |
21 def WillNavigateToPage(self, page, tab): | |
22 tab.ClearCache(force=True) | |
23 | |
24 def ValidateAndMeasurePage(self, page, tab, results): | |
25 # Wait for the load event. | |
26 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) | |
27 self._metrics.AddResultsForLatency(tab, results) | |
28 | |
29 | |
30 class ChromeProxyDataSaving(page_test.PageTest): | |
31 """Chrome proxy data saving measurement.""" | |
32 def __init__(self, *args, **kwargs): | |
33 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) | |
34 self._metrics = metrics.ChromeProxyMetric() | |
35 | |
36 def CustomizeBrowserOptions(self, options): | |
37 options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth') | |
38 | |
39 def WillNavigateToPage(self, page, tab): | |
40 tab.ClearCache(force=True) | |
41 self._metrics.Start(page, tab) | |
42 | |
43 def ValidateAndMeasurePage(self, page, tab, results): | |
44 # Wait for the load event. | |
45 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) | |
46 self._metrics.Stop(page, tab) | |
47 self._metrics.AddResultsForDataSaving(tab, results) | |
OLD | NEW |