Commit bdae5196 authored by Thanh Le's avatar Thanh Le Committed by Commit Bot

Fix intergation test for lofi.py and lite_page.py

testLoFi, testLoFiCacheBypass, testLoFiSlowConnection are failing on desktop
because DataReductionProxyDecidesTransform is not on.

Same issue for testLitePageBTF, testLitePageBTFNano,
testLitePageForcedExperiment, and testPreviewProvidedForHeavyPage.

testLitePageBTFNano should be marked with AndroidOnly.

Bug: 794344
Change-Id: Ia9e6708bfa2e9e3f233b5ac9989089e71dfc829e
Reviewed-on: https://chromium-review.googlesource.com/822759
Commit-Queue: Thanh Le <thanhdle@chromium.org>
Reviewed-by: default avatarDoug Arnett <dougarnett@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523643}
parent 6fe18373
...@@ -6,6 +6,7 @@ import common ...@@ -6,6 +6,7 @@ import common
from common import ParseFlags from common import ParseFlags
from common import TestDriver from common import TestDriver
from common import IntegrationTest from common import IntegrationTest
from decorators import AndroidOnly
from decorators import ChromeVersionBeforeM from decorators import ChromeVersionBeforeM
from decorators import ChromeVersionEqualOrAfterM from decorators import ChromeVersionEqualOrAfterM
...@@ -75,6 +76,8 @@ class LitePage(IntegrationTest): ...@@ -75,6 +76,8 @@ class LitePage(IntegrationTest):
self.skipTest('This test cannot be run with other experiments.') self.skipTest('This test cannot be run with other experiments.')
with TestDriver() as test_driver: with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--enable-features='
'DataReductionProxyDecidesTransform')
test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on')
test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page') test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page')
...@@ -138,7 +141,9 @@ class LitePage(IntegrationTest): ...@@ -138,7 +141,9 @@ class LitePage(IntegrationTest):
self.assertEqual(1, non_lite_page_responses) self.assertEqual(1, non_lite_page_responses)
# Checks that a Lite Page does not have an error when scrolling to the bottom # Checks that a Lite Page does not have an error when scrolling to the bottom
# of the page and is able to load all resources. # of the page and is able to load all resources. This test is only run on
# Android because it depends on window size of the browser.
@AndroidOnly
def testLitePageBTF(self): def testLitePageBTF(self):
# If it was attempted to run with another experiment, skip this test. # If it was attempted to run with another experiment, skip this test.
if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment'
...@@ -185,7 +190,9 @@ class LitePage(IntegrationTest): ...@@ -185,7 +190,9 @@ class LitePage(IntegrationTest):
self.assertIn(response.status, [200, 204]) self.assertIn(response.status, [200, 204])
# Checks that a Nano Lite Page does not have an error when scrolling to the # Checks that a Nano Lite Page does not have an error when scrolling to the
# bottom of the page and is able to load all resources. # bottom of the page and is able to load all resources. This test is only run
# on Android because it depends on window size of the browser.
@AndroidOnly
@ChromeVersionEqualOrAfterM(65) @ChromeVersionEqualOrAfterM(65)
def testLitePageBTFNano(self): def testLitePageBTFNano(self):
# If it was attempted to run with another experiment, skip this test. # If it was attempted to run with another experiment, skip this test.
...@@ -397,6 +404,8 @@ class LitePage(IntegrationTest): ...@@ -397,6 +404,8 @@ class LitePage(IntegrationTest):
def testPreviewProvidedForHeavyPage(self): def testPreviewProvidedForHeavyPage(self):
with TestDriver() as test_driver: with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--enable-features='
'DataReductionProxyDecidesTransform')
test_driver.AddChromeArg( test_driver.AddChromeArg(
'--force-fieldtrial-params=NetworkQualityEstimator.Enabled:' '--force-fieldtrial-params=NetworkQualityEstimator.Enabled:'
'force_effective_connection_type/3G,' 'force_effective_connection_type/3G,'
......
...@@ -16,6 +16,8 @@ class LoFi(IntegrationTest): ...@@ -16,6 +16,8 @@ class LoFi(IntegrationTest):
def testLoFi(self): def testLoFi(self):
with TestDriver() as test_driver: with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--enable-features='
'DataReductionProxyDecidesTransform')
test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on')
# Disable server experiments such as tamper detection. # Disable server experiments such as tamper detection.
test_driver.AddChromeArg('--data-reduction-proxy-server-experiments-' test_driver.AddChromeArg('--data-reduction-proxy-server-experiments-'
...@@ -40,12 +42,13 @@ class LoFi(IntegrationTest): ...@@ -40,12 +42,13 @@ class LoFi(IntegrationTest):
def testLoFiSlowConnection(self): def testLoFiSlowConnection(self):
with TestDriver() as test_driver: with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--enable-features='
'DataReductionProxyDecidesTransform')
test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=slow-connections-' test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=slow-connections-'
'only') 'only')
# Disable server experiments such as tamper detection. # Disable server experiments such as tamper detection.
test_driver.AddChromeArg('--data-reduction-proxy-server-experiments-' test_driver.AddChromeArg('--data-reduction-proxy-server-experiments-'
'disabled') 'disabled')
test_driver.AddChromeArg('--force-fieldtrial-params=' test_driver.AddChromeArg('--force-fieldtrial-params='
'NetworkQualityEstimator.Enabled:' 'NetworkQualityEstimator.Enabled:'
'force_effective_connection_type/Slow2G') 'force_effective_connection_type/Slow2G')
...@@ -126,6 +129,8 @@ class LoFi(IntegrationTest): ...@@ -126,6 +129,8 @@ class LoFi(IntegrationTest):
# --profile-type=default command line for the same user profile and cache # --profile-type=default command line for the same user profile and cache
# to be used across the two page loads. # to be used across the two page loads.
test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--enable-features='
'DataReductionProxyDecidesTransform')
test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on')
test_driver.AddChromeArg('--profile-type=default') test_driver.AddChromeArg('--profile-type=default')
test_driver.AddChromeArg('--data-reduction-proxy-server-experiments-' test_driver.AddChromeArg('--data-reduction-proxy-server-experiments-'
...@@ -193,9 +198,9 @@ class LoFi(IntegrationTest): ...@@ -193,9 +198,9 @@ class LoFi(IntegrationTest):
self.skipTest('This test cannot be run with other experiments.') self.skipTest('This test cannot be run with other experiments.')
with TestDriver() as test_driver: with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth') test_driver.AddChromeArg('--enable-spdy-proxy-auth')
test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on')
test_driver.AddChromeArg('--enable-features=' test_driver.AddChromeArg('--enable-features='
'DataReductionProxyDecidesTransform') 'DataReductionProxyDecidesTransform')
test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on')
# Ensure fast network (4G) to ensure force flag ignores ECT. # Ensure fast network (4G) to ensure force flag ignores ECT.
test_driver.AddChromeArg('--force-fieldtrial-params=' test_driver.AddChromeArg('--force-fieldtrial-params='
......
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