diff options
author | zhenw <zhenw@chromium.org> | 2015-10-27 11:28:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-27 18:28:54 +0000 |
commit | 2949c7a3799f6e8a3a883f473579ec8af9d2b321 (patch) | |
tree | 8dbd49cca0be1ba9b2bbc3f9eee759d564f8420c /tools/chrome_proxy | |
parent | 5c96b9150acdb13102d2be5ac94f95cbffeef4d6 (diff) | |
download | chromium_src-2949c7a3799f6e8a3a883f473579ec8af9d2b321.zip chromium_src-2949c7a3799f6e8a3a883f473579ec8af9d2b321.tar.gz chromium_src-2949c7a3799f6e8a3a883f473579ec8af9d2b321.tar.bz2 |
Revert of [Telemetry] Switch to new way of browser restart (patchset #4 id:60001 of https://codereview.chromium.org/1418213006/ )
Reason for revert:
This CL depends on https://crrev.com/1417133002, which will be reverted. Please see that CL's message for detailed information.
Original issue's description:
> [Telemetry] Switch to new way of browser restart
>
> This CL updates Telemetry clients to use the new way of browser restart.
> After CL https://crrev.com/1417133002, Telemetry switches to use
> benchmark.ShouldTearDownStateAfterEachStoryRun to specify if it should
> tear down all states after each story run, which also shuts down the
> browser. This effectively makes the next story to restart the browser. The
> old way (needs_browser_restart_after_each_page) is removed.
>
> BUG=546187
>
> Committed: https://crrev.com/5b342418b561a14be1f970ebeb516d396ec938dc
> Cr-Commit-Position: refs/heads/master@{#356229}
TBR=nednguyen@google.com,eakuefner@chromium.org,kbr@chromium.org,sclittle@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=546187
Review URL: https://codereview.chromium.org/1412343004
Cr-Commit-Position: refs/heads/master@{#356351}
Diffstat (limited to 'tools/chrome_proxy')
4 files changed, 22 insertions, 41 deletions
diff --git a/tools/chrome_proxy/common/chrome_proxy_benchmark.py b/tools/chrome_proxy/common/chrome_proxy_benchmark.py index 63ba6a8..7c4aa82 100644 --- a/tools/chrome_proxy/common/chrome_proxy_benchmark.py +++ b/tools/chrome_proxy/common/chrome_proxy_benchmark.py @@ -8,10 +8,6 @@ from telemetry import benchmark class ChromeProxyBenchmark(benchmark.Benchmark): @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return True - - @classmethod def AddCommandLineArgs(cls, parser): parser.add_option( '--extra-chrome-proxy-via-header', @@ -22,3 +18,4 @@ class ChromeProxyBenchmark(benchmark.Benchmark): def ProcessCommandLineArgs(cls, parser, args): if args.extra_header: measurements.ChromeProxyValidation.extra_via_header = args.extra_header + diff --git a/tools/chrome_proxy/common/chrome_proxy_measurements.py b/tools/chrome_proxy/common/chrome_proxy_measurements.py index 48a55be..11f665e 100644 --- a/tools/chrome_proxy/common/chrome_proxy_measurements.py +++ b/tools/chrome_proxy/common/chrome_proxy_measurements.py @@ -59,8 +59,9 @@ class ChromeProxyValidation(page_test.PageTest): # Value of the extra via header. |None| if no extra via header is expected. extra_via_header = None - def __init__(self, metrics=None): - super(ChromeProxyValidation, self).__init__() + def __init__(self, restart_after_each_page=False, metrics=None): + super(ChromeProxyValidation, self).__init__( + needs_browser_restart_after_each_page=restart_after_each_page) self._metrics = metrics self._page = None diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_benchmark.py b/tools/chrome_proxy/integration_tests/chrome_proxy_benchmark.py index fc4e068..148c907 100644 --- a/tools/chrome_proxy/integration_tests/chrome_proxy_benchmark.py +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_benchmark.py @@ -19,10 +19,6 @@ class ChromeProxyClientVersion(ChromeProxyBenchmark): def Name(cls): return 'chrome_proxy_benchmark.client_version.synthetic' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return False - class ChromeProxyClientType(ChromeProxyBenchmark): tag = 'client_type' @@ -110,10 +106,6 @@ class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark): def Name(cls): return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return False - @benchmark.Enabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS)) # Safebrowsing is switched off for Android Webview and all desktop platforms. @@ -126,10 +118,6 @@ class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark): def Name(cls): return 'chrome_proxy_benchmark.safebrowsing_off.safebrowsing' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return False - class ChromeProxyHTTPFallbackProbeURL(ChromeProxyBenchmark): tag = 'fallback_probe' @@ -202,10 +190,6 @@ class ChromeProxyVideoDirect(benchmark.Benchmark): def Name(cls): return 'chrome_proxy_benchmark.video.direct' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return True - @benchmark.Enabled(*DESKTOP_PLATFORMS) class ChromeProxyVideoProxied(benchmark.Benchmark): @@ -217,10 +201,6 @@ class ChromeProxyVideoProxied(benchmark.Benchmark): def Name(cls): return 'chrome_proxy_benchmark.video.proxied' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return True - @benchmark.Enabled(*DESKTOP_PLATFORMS) class ChromeProxyVideoCompare(benchmark.Benchmark): @@ -238,11 +218,6 @@ class ChromeProxyVideoCompare(benchmark.Benchmark): def Name(cls): return 'chrome_proxy_benchmark.video.compare' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return True - - @benchmark.Enabled(*DESKTOP_PLATFORMS) class ChromeProxyVideoFrames(benchmark.Benchmark): """Check for video frames similar to original video.""" @@ -255,11 +230,6 @@ class ChromeProxyVideoFrames(benchmark.Benchmark): def Name(cls): return 'chrome_proxy_benchmark.video.frames' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return True - - @benchmark.Enabled(*DESKTOP_PLATFORMS) class ChromeProxyVideoAudio(benchmark.Benchmark): """Check that audio is similar to original video.""" @@ -272,6 +242,3 @@ class ChromeProxyVideoAudio(benchmark.Benchmark): def Name(cls): return 'chrome_proxy_benchmark.video.audio' - @classmethod - def ShouldTearDownStateAfterEachStoryRun(cls): - return True diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py index d4854a6..5261add 100644 --- a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py @@ -43,6 +43,7 @@ class ChromeProxyHeaders(ChromeProxyValidation): def __init__(self): super(ChromeProxyHeaders, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def AddResults(self, tab, results): @@ -54,6 +55,7 @@ class ChromeProxyBypass(ChromeProxyValidation): def __init__(self): super(ChromeProxyBypass, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def AddResults(self, tab, results): @@ -65,6 +67,7 @@ class ChromeProxyCorsBypass(ChromeProxyValidation): def __init__(self): super(ChromeProxyCorsBypass, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def ValidateAndMeasurePage(self, page, tab, results): @@ -83,6 +86,7 @@ class ChromeProxyBlockOnce(ChromeProxyValidation): def __init__(self): super(ChromeProxyBlockOnce, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def AddResults(self, tab, results): @@ -151,6 +155,7 @@ class ChromeProxyHTTPFallbackProbeURL(ChromeProxyValidation): def __init__(self): super(ChromeProxyHTTPFallbackProbeURL, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): @@ -180,6 +185,7 @@ class ChromeProxyHTTPFallbackViaHeader(ChromeProxyValidation): def __init__(self): super(ChromeProxyHTTPFallbackViaHeader, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): @@ -225,6 +231,7 @@ class ChromeProxyClientType(ChromeProxyValidation): def __init__(self): super(ChromeProxyClientType, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) self._chrome_proxy_client_type = None @@ -247,7 +254,8 @@ class ChromeProxyLoFi(ChromeProxyValidation): """Correctness measurement for Lo-Fi in Chrome-Proxy header.""" def __init__(self): - super(ChromeProxyLoFi, self).__init__(metrics=metrics.ChromeProxyMetric()) + super(ChromeProxyLoFi, self).__init__(restart_after_each_page=True, + metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): super(ChromeProxyLoFi, self).CustomizeBrowserOptions(options) @@ -265,6 +273,7 @@ class ChromeProxyExpDirective(ChromeProxyValidation): def __init__(self): super(ChromeProxyExpDirective, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): @@ -283,6 +292,7 @@ class ChromeProxyPassThrough(ChromeProxyValidation): def __init__(self): super(ChromeProxyPassThrough, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): @@ -296,6 +306,7 @@ class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): def __init__(self): super(ChromeProxyHTTPToDirectFallback, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): @@ -333,6 +344,7 @@ class ChromeProxyReenableAfterBypass(ChromeProxyValidation): def __init__(self): super(ChromeProxyReenableAfterBypass, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def AddResults(self, tab, results): @@ -345,7 +357,8 @@ class ChromeProxySmoke(ChromeProxyValidation): """Smoke measurement for basic chrome proxy correctness.""" def __init__(self): - super(ChromeProxySmoke, self).__init__(metrics=metrics.ChromeProxyMetric()) + super(ChromeProxySmoke, self).__init__(restart_after_each_page=True, + metrics=metrics.ChromeProxyMetric()) def AddResults(self, tab, results): # Map a page name to its AddResults func. @@ -381,6 +394,7 @@ class ChromeProxyClientConfig(ChromeProxyValidation): def __init__(self): super(ChromeProxyClientConfig, self).__init__( + restart_after_each_page=True, metrics=metrics.ChromeProxyMetric()) def CustomizeBrowserOptions(self, options): @@ -402,6 +416,7 @@ class ChromeProxyVideoValidation(page_test.PageTest): def __init__(self): super(ChromeProxyVideoValidation, self).__init__( + needs_browser_restart_after_each_page=True, clear_cache_before_each_run=True) # The type is _allMetrics[url][PROXIED,DIRECT][metricName] = value, # where (metricName,value) is a metric computed by videowrapper.js. @@ -481,6 +496,7 @@ class ChromeProxyInstrumentedVideoValidation(page_test.PageTest): def __init__(self): super(ChromeProxyInstrumentedVideoValidation, self).__init__( + needs_browser_restart_after_each_page=True, clear_cache_before_each_run=True) self._metrics = metrics.ChromeProxyInstrumentedVideoMetric() |