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

Add ChromeDriver test for aborting a streaming preview

Bug: 964540
Change-Id: Ia7d792a909139a5cfc9db2117d7d1267bc2fbb9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631137Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664320}
parent cea938e4
......@@ -152,7 +152,6 @@ class HttpsPreviewsBaseClass():
self._AssertShowingLitePage(t, 'Hello world', 1)
# Verifies that a Lite Page pageload sends a DRP pingback.
# TODO(robertogden): Set this to M73 once merged.
@ChromeVersionEqualOrAfterM(74)
def testPingbackSent(self):
with TestDriver() as t:
......@@ -278,5 +277,31 @@ class HttpsPreviewsURLLoader(HttpsPreviewsBaseClass, IntegrationTest):
def getVersion(self):
return URL_LOADER_VERSION
# Verifies that if a streaming preview is being served but needs to be
# aborted, changing location.href will load the original page.
#
# This test only works for the URLLoader version.
@ChromeVersionEqualOrAfterM(75)
def testChromeStreamingAbort(self):
url = 'https://mobilespeed-test.appspot.com/static/litepagetests/simple.html'
with TestDriver() as t:
self.EnableLitePageServerPreviewsAndInit(t)
t.LoadURL(url)
self._AssertShowingLitePage(t, 'Hello world', 1)
self.assertNotEqual(url,
t.ExecuteJavascriptStatement('window.location.href'))
# Although this is not a streaming DOM, the critical behavior to be tested
# is that once a preview is committed in the renderer, changing
# location.href loads the original page. The timing of this call is not
# important.
t.ExecuteJavascriptStatement('window.location.href += "&abort"')
t.SleepUntilHistogramHasEntry('Previews.PageEndReason.LitePageRedirect',
30)
self.assertEqual(url,
t.ExecuteJavascriptStatement('window.location.href'))
if __name__ == '__main__':
IntegrationTest.RunAllTests()
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