Commit 27fa8ed2 authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

Fix HeadlessProtocolBrowserTest.VirtualTimeHistoryNavigation

Bug: 859382
Change-Id: I42dcd7219cb0dba659f201d022444265a6a4b183
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864012Reviewed-by: default avatarPeter Kvitek <kvitekp@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706227}
parent 54812ad6
Tests virtual time with history navigation. Tests virtual time with history navigation.
PAGE: http://foo.com/
PAGE: http://foo.com/a/
document.location.href = 'http://bar.com/' document.location.href = 'http://bar.com/'
PAGE: http://bar.com/
PAGE: http://bar.com/b/
PAGE: http://bar.com/c/
PAGE: http://bar.com/d/
document.getElementById('frame_b').src = '/e/' document.getElementById('frame_b').src = '/e/'
PAGE: http://bar.com/e/
PAGE: http://bar.com/f/
history.back() history.back()
PAGE: http://bar.com/b/
PAGE: http://bar.com/d/
history.forward() history.forward()
history.go(-1) PAGE: http://bar.com/e/
\ No newline at end of file PAGE: http://bar.com/f/
history.go(-1)
PAGE: http://bar.com/b/
PAGE: http://bar.com/d/
\ No newline at end of file
...@@ -9,49 +9,50 @@ ...@@ -9,49 +9,50 @@
const FetchHelper = await testRunner.loadScriptAbsolute( const FetchHelper = await testRunner.loadScriptAbsolute(
'../fetch/resources/fetch-test.js'); '../fetch/resources/fetch-test.js');
const helper = new FetchHelper(testRunner, dp); const helper = new FetchHelper(testRunner, dp);
helper.setEnableLogging(false);
await helper.enable(); await helper.enable();
helper.onceRequest('http://foo.com/').fulfill( helper.onRequest('http://foo.com/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script> <script> console.log(document.location.href); </script>
<iframe src='/a/'></iframe>`) <iframe src='/a/'></iframe>`)
); );
helper.onceRequest('http://foo.com/a/').fulfill( helper.onRequest('http://foo.com/a/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script>`) <script> console.log(document.location.href); </script>`)
); );
helper.onceRequest('http://bar.com/').fulfill( helper.onRequest('http://bar.com/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script> <script> console.log(document.location.href); </script>
<iframe src='/b/' id='frame_b'></iframe> <iframe src='/b/' id='frame_b'></iframe>
<iframe src='/c/'></iframe>`) <iframe src='/c/'></iframe>`)
); );
helper.onceRequest('http://bar.com/b/').fulfill( helper.onRequest('http://bar.com/b/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script> <script> console.log(document.location.href); </script>
<iframe src='/d/'></iframe>`) <iframe src='/d/'></iframe>`)
); );
helper.onceRequest('http://bar.com/c/').fulfill( helper.onRequest('http://bar.com/c/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script>`) <script> console.log(document.location.href); </script>`)
); );
helper.onceRequest('http://bar.com/d/').fulfill( helper.onRequest('http://bar.com/d/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script>`) <script> console.log(document.location.href); </script>`)
); );
helper.onceRequest('http://bar.com/e/').fulfill( helper.onRequest('http://bar.com/e/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script> <script> console.log(document.location.href); </script>
<iframe src='/f/'></iframe>`) <iframe src='/f/'></iframe>`)
); );
helper.onceRequest('http://bar.com/f/').fulfill( helper.onRequest('http://bar.com/f/').fulfill(
FetchHelper.makeContentResponse(` FetchHelper.makeContentResponse(`
<script> console.log(document.location.href); </script>`) <script> console.log(document.location.href); </script>`)
); );
...@@ -63,6 +64,9 @@ ...@@ -63,6 +64,9 @@
`history.forward()`, `history.forward()`,
`history.go(-1)`]; `history.go(-1)`];
dp.Runtime.enable();
dp.Runtime.onConsoleAPICalled(event =>
testRunner.log(`PAGE: ${event.params.args[0].value}`));
dp.Emulation.onVirtualTimeBudgetExpired(async data => { dp.Emulation.onVirtualTimeBudgetExpired(async data => {
if (!testCommands.length) { if (!testCommands.length) {
testRunner.completeTest(); testRunner.completeTest();
......
...@@ -244,9 +244,7 @@ HEADLESS_PROTOCOL_TEST(VirtualTimeFetchStream, ...@@ -244,9 +244,7 @@ HEADLESS_PROTOCOL_TEST(VirtualTimeFetchStream,
"emulation/virtual-time-fetch-stream.js") "emulation/virtual-time-fetch-stream.js")
HEADLESS_PROTOCOL_TEST(VirtualTimeDialogWhileLoading, HEADLESS_PROTOCOL_TEST(VirtualTimeDialogWhileLoading,
"emulation/virtual-time-dialog-while-loading.js") "emulation/virtual-time-dialog-while-loading.js")
HEADLESS_PROTOCOL_TEST(VirtualTimeHistoryNavigation,
// Flaky Test crbug.com/859382
HEADLESS_PROTOCOL_TEST(DISABLED_VirtualTimeHistoryNavigation,
"emulation/virtual-time-history-navigation.js") "emulation/virtual-time-history-navigation.js")
// http://crbug.com/633321 // http://crbug.com/633321
......
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