Commit e7ecd1bf authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Fix ChromeDriver DRP Robust Connection Tests

These are not working in 73 but do in 72. Added a new decorator for a
range.
The blackhole test needs to be restricted to <=71

Bug: 933979
Change-Id: I37c67a299e825cde288712b3edb33a7cfe504512
Reviewed-on: https://chromium-review.googlesource.com/c/1479638Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634731}
parent c73d58a9
......@@ -5,6 +5,7 @@
import sys
from decorators import AndroidOnly
from decorators import ChromeVersionBetweenInclusiveM
from decorators import ChromeVersionEqualOrAfterM
from decorators import ChromeVersionBeforeM
from decorators import SkipIfForcedBrowserArg
......@@ -32,6 +33,15 @@ class DecoratorSmokeTest(IntegrationTest):
self.fail('This function should not be called when the Chrome Milestone is '
'greater than 0')
@ChromeVersionBetweenInclusiveM(0, 999999999)
def testVersionBetweenDecorator(self):
pass
@ChromeVersionBetweenInclusiveM(0, 1)
def testVersionBetweenDecorator(self):
self.fail('This function should not be called when the Chrome Milestone is '
'outside the range [0, 1].')
@ChromeVersionEqualOrAfterM(999999999)
def testVersionAfterDecorator(self):
self.fail('This function should not be called when the Chrome Milestone is '
......
......@@ -118,6 +118,21 @@ def ChromeVersionEqualOrAfterM(milestone):
return wrapper
return puesdo_wrapper
def ChromeVersionBetweenInclusiveM(after, before):
def puesdo_wrapper(func):
def wrapper(*args, **kwargs):
global chrome_version
if chrome_version == None:
chrome_version = GetChromeVersion()
if chrome_version <= before and chrome_version >= after:
func(*args, **kwargs)
else:
args[0].skipTest('This test only runs between M%d and M%d (inclusive).'
% (after, before))
return wrapper
return puesdo_wrapper
def Slow(func):
def wrapper(*args, **kwargs):
if ParseFlags().skip_slow:
......
......@@ -5,7 +5,7 @@
import common
from common import TestDriver
from common import IntegrationTest
from decorators import ChromeVersionEqualOrAfterM
from decorators import ChromeVersionBetweenInclusiveM
from emulation_server import BlackHoleHandler
from emulation_server import InvalidTLSHandler
from emulation_server import TCPResetHandler
......@@ -13,7 +13,7 @@ from emulation_server import TLSResetHandler
class ProxyConnection(IntegrationTest):
@ChromeVersionEqualOrAfterM(63)
@ChromeVersionBetweenInclusiveM(63, 72)
def testTLSInjectionAfterHandshake(self):
port = common.GetOpenPort()
with TestDriver() as t:
......@@ -37,7 +37,7 @@ class ProxyConnection(IntegrationTest):
self.assertTrue(t.SleepUntilHistogramHasEntry('DataReductionProxy.'
'InvalidResponseHeadersReceived.NetError'))
@ChromeVersionEqualOrAfterM(63)
@ChromeVersionBetweenInclusiveM(63, 72)
def testTCPReset(self):
port = common.GetOpenPort()
with TestDriver() as t:
......@@ -62,7 +62,7 @@ class ProxyConnection(IntegrationTest):
self.assertTrue(t.SleepUntilHistogramHasEntry('DataReductionProxy.'
'InvalidResponseHeadersReceived.NetError'))
@ChromeVersionEqualOrAfterM(63)
@ChromeVersionBetweenInclusiveM(63, 72)
def testTLSReset(self):
port = common.GetOpenPort()
with TestDriver() as t:
......@@ -85,7 +85,7 @@ class ProxyConnection(IntegrationTest):
for response in responses:
self.assertNotHasChromeProxyViaHeader(response)
@ChromeVersionEqualOrAfterM(66)
@ChromeVersionBetweenInclusiveM(66, 71)
def testTCPBlackhole(self):
port = common.GetOpenPort()
with TestDriver() as t:
......
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