# Copyright 2014 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.

from telemetry import test
from measurements import chrome_proxy


class ChromeProxyLatency(test.Test):
  tag = 'latency'
  test = chrome_proxy.ChromeProxyLatency
  page_set = 'page_sets/chrome_proxy/top_20.py'
  options = {'pageset_repeat_iters': 2}

  def CustomizeBrowserOptions(self, options):
    options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')


class ChromeProxyLatencyDirect(test.Test):
  tag = 'latency_direct'
  test = chrome_proxy.ChromeProxyLatency
  page_set = 'page_sets/chrome_proxy/top_20.py'
  options = {'pageset_repeat_iters': 2}


class ChromeProxyLatencySynthetic(ChromeProxyLatency):
  page_set = 'page_sets/chrome_proxy/synthetic.py'


class ChromeProxyLatencySyntheticDirect(ChromeProxyLatencyDirect):
  page_set = 'page_sets/chrome_proxy/synthetic.py'


class ChromeProxyDataSaving(test.Test):
  tag = 'data_saving'
  test = chrome_proxy.ChromeProxyDataSaving
  page_set = 'page_sets/chrome_proxy/top_20.py'
  options = {'pageset_repeat_iters': 1}
  def CustomizeBrowserOptions(self, options):
    options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')


class ChromeProxyDataSavingDirect(test.Test):
  tag = 'data_saving_direct'
  test = chrome_proxy.ChromeProxyDataSaving
  options = {'pageset_repeat_iters': 2}
  page_set = 'page_sets/chrome_proxy/top_20.py'


class ChromeProxyDataSavingSynthetic(ChromeProxyDataSaving):
  page_set = 'page_sets/chrome_proxy/synthetic.py'


class ChromeProxyDataSavingSyntheticDirect(ChromeProxyDataSavingDirect):
  page_set = 'page_sets/chrome_proxy/synthetic.py'


class ChromeProxyHeaderValidation(test.Test):
  tag = 'header_validation'
  test = chrome_proxy.ChromeProxyHeaders
  page_set = 'page_sets/chrome_proxy/top_20.py'


class ChromeProxyBypass(test.Test):
  tag = 'bypass'
  test = chrome_proxy.ChromeProxyBypass
  page_set = 'page_sets/chrome_proxy/bypass.py'


class ChromeProxySafeBrowsing(test.Test):
  tag = 'safebrowsing'
  test = chrome_proxy.ChromeProxySafebrowsing
  page_set = 'page_sets/chrome_proxy/safebrowsing.py'


class ChromeProxyHTTPFallbackProbeURL(test.Test):
  tag = 'fallback-probe'
  test = chrome_proxy.ChromeProxyHTTPFallbackProbeURL
  page_set = 'page_sets/chrome_proxy/synthetic.py'


class ChromeProxyHTTPFallbackViaHeader(test.Test):
  tag = 'fallback-viaheader'
  test = chrome_proxy.ChromeProxyHTTPFallbackViaHeader
  page_set = 'page_sets/chrome_proxy/fallback_viaheader.py'


class ChromeProxySmoke(test.Test):
  tag = 'smoke'
  test = chrome_proxy.ChromeProxySmoke
  page_set = 'page_sets/chrome_proxy/smoke.py'

@@ -221,17 +221,288 @@
 e_proxy%0A
+from page_sets.chrome_proxy import bypass%0Afrom page_sets.chrome_proxy import fallback_viaheader%0Afrom page_sets.chrome_proxy import safebrowsing%0Afrom page_sets.chrome_proxy import smoke%0Afrom page_sets.chrome_proxy import synthetic%0Afrom page_sets.chrome_proxy import top_20
 %0A
-
 %0Aclass C
@@ -607,42 +607,29 @@
 t = 
-'page_sets/chrome_proxy/top_20.py'
+top_20.Top20PageSet()
 %0A  o
@@ -903,42 +903,29 @@
 t = 
-'page_sets/chrome_proxy/top_20.py'
+top_20.Top20PageSet()
 %0A  o
@@ -1035,45 +1035,36 @@
 t = 
-'page_sets/chrome_proxy/synthetic.py'
+synthetic.SyntheticPageSet()
 %0A%0A%0Ac
@@ -1146,45 +1146,36 @@
 t = 
-'page_sets/chrome_proxy/synthetic.py'
+synthetic.SyntheticPageSet()
 %0A%0A%0Ac
@@ -1296,42 +1296,29 @@
 t = 
-'page_sets/chrome_proxy/top_20.py'
+top_20.Top20PageSet()
 %0A  o
@@ -1641,42 +1641,29 @@
 t = 
-'page_sets/chrome_proxy/top_20.py'
+top_20.Top20PageSet()
 %0A%0A%0Ac
@@ -1739,45 +1739,36 @@
 t = 
-'page_sets/chrome_proxy/synthetic.py'
+synthetic.SyntheticPageSet()
 %0A%0A%0Ac
@@ -1856,45 +1856,36 @@
 t = 
-'page_sets/chrome_proxy/synthetic.py'
+synthetic.SyntheticPageSet()
 %0A%0A%0Ac
@@ -2015,42 +2015,29 @@
 t = 
-'page_sets/chrome_proxy/top_20.py'
+top_20.Top20PageSet()
 %0A%0A%0Ac
@@ -2145,42 +2145,30 @@
 t = 
-'page_sets/chrome_proxy/bypass.py'
+bypass.BypassPageSet()
 %0A%0A%0Ac
@@ -2294,33 +2294,22 @@
 t = 
-'page_sets/chrome_proxy/s
+safebrowsing.S
 afeb
@@ -2315,20 +2315,25 @@
 browsing
-.py'
+PageSet()
 %0A%0A%0Aclass
@@ -2473,45 +2473,36 @@
 t = 
-'page_sets/chrome_proxy/synthetic.py'
+synthetic.SyntheticPageSet()
 %0A%0A%0Ac
@@ -2652,54 +2652,53 @@
 t = 
-'page_sets/chrome_proxy/f
+fallback_viaheader.F
 allback
-_viah
+ViaH
 eader
-.py'
+PageSet()
 %0A%0A%0Ac
@@ -2803,38 +2803,25 @@
 t = 
-'page_sets/chrome_proxy/smoke.py'
+smoke.SmokePageSet()
 %0A

Convert page_set in chrome_proxy benchmarks to use the actual page_set objects.