forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented headless browser redirection tests.
Change-Id: I1e772fc31ede9a85d6cea1726c3c7fa9d3cd34ca Reviewed-on: https://chromium-review.googlesource.com/1147741 Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Peter Kvitek <kvitekp@chromium.org> Cr-Commit-Position: refs/heads/master@{#578737}
- Loading branch information
Peter Kvitek
authored and
Commit Bot
committed
Jul 27, 2018
1 parent
d858be3
commit 49da670
Showing
50 changed files
with
1,170 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
headless/test/data/protocol/sanity/renderer-css-url-filter-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
headless/test/data/protocol/sanity/renderer-double-redirect-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Tests renderer: double redirection. | ||
requested url: http://www.example.com/ | ||
requested url: http://www.example.com/2 | ||
<p>Pass</p> | ||
Frames: 1 | ||
frameId=MainFrame | ||
url=http://www.example.com/ | ||
url=http://www.example.com/2 | ||
ScheduledNavigations: 1 | ||
frameId=MainFrame | ||
url=http://www.example.com/1 reason=scriptInitiated | ||
url=http://www.example.com/2 reason=scriptInitiated |
42 changes: 42 additions & 0 deletions
42
headless/test/data/protocol/sanity/renderer-double-redirect.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
(async function(testRunner) { | ||
let {page, session, dp} = await testRunner.startBlank( | ||
'Tests renderer: double redirection.'); | ||
|
||
let RendererTestHelper = | ||
await testRunner.loadScript('../helpers/renderer-test-helper.js'); | ||
let {httpInterceptor, frameNavigationHelper, virtualTimeController} = | ||
await (new RendererTestHelper(testRunner, dp, page)).init(); | ||
|
||
// Two navigations have been scheduled while the document was loading, but | ||
// only the second one was started. It canceled the first one. | ||
httpInterceptor.addResponse('http://www.example.com/', | ||
`<html> | ||
<head> | ||
<title>Hello, World 1</title> | ||
<script> | ||
document.location='http://www.example.com/1'; | ||
document.location='http://www.example.com/2'; | ||
</script> | ||
</head> | ||
<body>http://www.example.com/1</body> | ||
</html>`); | ||
|
||
httpInterceptor.addResponse('http://www.example.com/2', | ||
'<p>Pass</p>'); | ||
|
||
await virtualTimeController.grantInitialTime(1000, 1000, | ||
null, | ||
async () => { | ||
testRunner.log(await session.evaluate('document.body.innerHTML')); | ||
frameNavigationHelper.logFrames(); | ||
frameNavigationHelper.logScheduledNavigations(); | ||
testRunner.completeTest(); | ||
} | ||
); | ||
|
||
await frameNavigationHelper.navigate('http://www.example.com/'); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Tests renderer: frame load events. | ||
FRAME A 1 | ||
IFRAME 1 | ||
Frames: 4 | ||
frameId=MainFrame | ||
url=http://example.com/1 | ||
frameId=<string> | ||
url=http://example.com/frameA/ | ||
url=http://example.com/frameA/1 | ||
frameId=<string> | ||
url=http://example.com/frameB/ | ||
url=http://example.com/frameB/1 | ||
frameId=<string> | ||
url=http://example.com/frameB/1/iframe/ | ||
url=http://example.com/frameB/1/iframe/1 | ||
ScheduledNavigations: 3 | ||
frameId=<string> | ||
url=http://example.com/frameA/1 reason=scriptInitiated | ||
frameId=<string> | ||
url=http://example.com/frameB/1 reason=scriptInitiated | ||
frameId=<string> | ||
url=http://example.com/frameB/1/iframe/1 reason=scriptInitiated | ||
Expected requested urls: | ||
http://example.com/ | ||
http://example.com/1 | ||
http://example.com/frameA/ | ||
http://example.com/frameA/1 | ||
http://example.com/frameB/ | ||
http://example.com/frameB/1 | ||
http://example.com/frameB/1/iframe/ | ||
http://example.com/frameB/1/iframe/1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
headless/test/data/protocol/sanity/renderer-frames-redirect-chain-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Tests renderer: frames redirection chain. | ||
<p>FRAME A</p> | ||
<p>IFRAME B</p> | ||
Frames: 4 | ||
frameId=MainFrame | ||
url=http://www.example.com/1 | ||
frameId=<string> | ||
url=http://www.example.com/frameA/ | ||
url=http://www.example.com/frameA/2 | ||
frameId=<string> | ||
url=http://www.example.com/frameB/ | ||
frameId=<string> | ||
url=http://www.example.com/iframe/ | ||
url=http://www.example.com/iframe/3 | ||
ScheduledNavigations: 2 | ||
frameId=<string> | ||
url=http://www.example.com/frameA/1 reason=scriptInitiated | ||
frameId=<string> | ||
url=http://www.example.com/iframe/1 reason=scriptInitiated | ||
Expected requested urls: | ||
http://www.example.com/ | ||
http://www.example.com/1 | ||
http://www.example.com/frameA/ | ||
http://www.example.com/frameA/1 | ||
http://www.example.com/frameA/2 | ||
http://www.example.com/frameB/ | ||
http://www.example.com/iframe/ | ||
http://www.example.com/iframe/1 | ||
http://www.example.com/iframe/2 | ||
http://www.example.com/iframe/3 |
Oops, something went wrong.