Commit 71d81f86 authored by Simon Pelchat's avatar Simon Pelchat Committed by Commit Bot

Make integration tests use the default_integration policy.

The default_integration policy should be used when no exp= is otherwise
specified to make sure that the GFE cache is not used.

Bug: 950734
Change-Id: I6129845bed78f84175fb440003575f626431ccbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1560454Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Simon Pelchat <spelchat@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652616}
parent 8e441a04
......@@ -190,8 +190,7 @@ class Bypass(IntegrationTest):
self.skipTest('This test cannot be run with other experiments.')
with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--data-reduction-proxy-experiment='
'client_test_bypass')
test_driver.SetExperiment('client_test_bypass')
# Verify that loading a page other than the specific exp directive test
# page loads through the proxy without being bypassed.
......
......@@ -207,6 +207,10 @@ class TestDriver:
self._flags = ParseFlags()
self._driver = None
self._chrome_args = set()
# By default use the default_integration policy. It is the same as the
# default policy except that it disables GFE caching to make sure we are
# running the tests against the current server version.
self._experiment = 'default_integration'
self._url = ''
self._logger = GetLogger(name='TestDriver')
self._has_logs = False
......@@ -251,6 +255,10 @@ class TestDriver:
a flag given in the code. In that case, check by the flag whether to
override the argument.
"""
# Set the Data Reduction Proxy experiment.
if self._experiment is not None:
self._chrome_args.add('--data-reduction-proxy-experiment=' +
self._experiment)
def GetDictKey(argument):
return argument.split('=', 1)[0]
if self._flags.browser_args and len(self._flags.browser_args) > 0:
......@@ -337,6 +345,14 @@ class TestDriver:
self._driver.quit()
self._driver = None
def SetExperiment(self, exp):
"""Sets the Data Reduction Proxy experiment to use.
Args:
exp: a string with the experiment name.
"""
self._experiment = exp
def AddChromeArgs(self, args):
"""Adds multiple arguments that will be passed to Chromium at start.
......
......@@ -139,7 +139,6 @@ class CompressionRegression(IntegrationTest):
compression[key] = [value]
with TestDriver() as t:
t.AddChromeArg('--enable-spdy-proxy-auth')
t.AddChromeArg('--data-reduction-proxy-server-experiments-disabled')
t.LoadURL('http://check.googlezip.net/metrics/local.gif')
t.LoadURL('http://check.googlezip.net/metrics/local.png')
t.LoadURL('http://check.googlezip.net/metrics/local.jpg')
......
......@@ -55,8 +55,7 @@ class HttpsPreviewsBaseClass():
t.AddChromeArg('--ignore-previews-blocklist')
t.AddChromeArg('--force-effective-connection-type=2G')
t.AddChromeArg('--ignore-litepage-redirect-optimization-blacklist')
t.AddChromeArg('--data-reduction-proxy-experiment='
'external_chrome_integration_test')
t.SetExperiment('external_chrome_integration_test')
# Start Chrome and wait for initialization.
t.LoadURL('data:,')
......
......@@ -38,6 +38,8 @@ class LitePage(IntegrationTest):
'force_effective_connection_type/2G,'
'DataReductionProxyServerExperiments.IgnoreCountryBlacklist:'
'exp/ignore_preview_blacklist')
# The previous argument implicitly sets the experiment.
test_driver.SetExperiment(None)
test_driver.AddChromeArg(
'--force-fieldtrials=NetworkQualityEstimator/Enabled/'
'DataReductionProxyServerExperiments/IgnoreCountryBlacklist')
......@@ -167,8 +169,7 @@ class LitePage(IntegrationTest):
# Need to force 2G speed to get lite-page response.
test_driver.AddChromeArg('--force-effective-connection-type=2G')
# Set exp=client_test_nano to force Nano response.
test_driver.AddChromeArg(
'--data-reduction-proxy-experiment=client_test_nano')
test_driver.SetExperiment('client_test_nano')
# This page is long and has many media resources.
test_driver.LoadURL('http://check.googlezip.net/metrics/index.html')
......@@ -217,8 +218,7 @@ class LitePage(IntegrationTest):
test_driver.AddChromeArg('--disable-features=AndroidOmniboxPreviewsBadge')
test_driver.AddChromeArg('--force-effective-connection-type=2G')
# Set exp=client_test_nano to force Lite page response.
test_driver.AddChromeArg(
'--data-reduction-proxy-experiment=client_test_nano')
test_driver.SetExperiment('client_test_nano')
# LoadURL waits for onLoadFinish so the Previews UI will be showing by
# then since it's triggered on commit.
test_driver.LoadURL(
......@@ -463,8 +463,7 @@ class LitePage(IntegrationTest):
# Need to force 2G speed to get a preview.
test_driver.AddChromeArg('--force-effective-connection-type=2G')
# Set exp=client_test_icaspr to force iCASPR response.
test_driver.AddChromeArg(
'--data-reduction-proxy-experiment=ihdp_integration')
test_driver.SetExperiment('ihdp_integration')
test_driver.LoadURL('http://check.googlezip.net/previews/ihdp.html')
......
......@@ -7,6 +7,7 @@ from common import TestDriver
from common import IntegrationTest
from decorators import AndroidOnly
from decorators import NotAndroid
from decorators import ChromeVersionBeforeM
from decorators import ChromeVersionEqualOrAfterM
from selenium.common.exceptions import TimeoutException
......@@ -14,6 +15,7 @@ from selenium.common.exceptions import TimeoutException
class SafeBrowsing(IntegrationTest):
@AndroidOnly
@ChromeVersionBeforeM(73)
def testSafeBrowsingOn(self):
with TestDriver() as t:
t.AddChromeArg('--enable-spdy-proxy-auth')
......
......@@ -17,9 +17,6 @@ import fieldtrial_util
test_blacklist = [
# These tests set their own field trials and should be ignored.
'lite_page.LitePage.testLitePageFallback',
'lofi.LoFi.testLoFiSlowConnection',
'lofi.LoFi.testLoFiIfHeavyFastConnection',
'quic.Quic.testCheckPageWithQuicProxy',
'quic.Quic.testCheckPageWithQuicProxyTransaction',
'smoke.Smoke.testCheckPageWithHoldback',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment