-
Notifications
You must be signed in to change notification settings - Fork 675
4 fork work fix browserautherror crypto nonexistent for firefox upstream issue 8391 #8482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Christopher-C-Robinson
wants to merge
6
commits into
DevExpress:master
Choose a base branch
from
Christopher-C-Robinson:4-fork-work-fix-browserautherror-crypto_nonexistent-for-firefox-upstream-issue-8391
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+157
−35
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c4b6192
Use localhost hostname for local browsers in proxy mode
fae1ba8
fix: bump testcafe-hammerhead to 31.7.7 for Firefox proxy init
188a229
test: add regression for Firefox proxy-mode init (GH-8391)
4bf975e
test: stabilize configuration default-path cleanup on Windows
8cce246
test: stabilize Firefox iframe-switching redirect/unavailable cases
e29b996
test: strengthen GH-8391 regression to verify WebCrypto in Firefox pr…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
test/functional/fixtures/regression/gh-8391/pages/index.html
This file contains hidden or 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,10 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <title>GH-8391</title> | ||
| </head> | ||
| <body> | ||
| <div id="status">ok</div> | ||
| </body> | ||
| </html> |
This file contains hidden or 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,41 @@ | ||
| const path = require('path'); | ||
| const { expect } = require('chai'); | ||
| const createTestCafe = require('../../../../../lib'); | ||
| const config = require('../../../config'); | ||
|
|
||
| const needSkip = !config.hasBrowser('firefox'); | ||
|
|
||
| function getFirefoxBrowserName () { | ||
| const firefoxSettings = config.currentEnvironment.browsers.find(browser => browser.alias.includes('firefox')); | ||
|
|
||
| return firefoxSettings ? firefoxSettings.browserName : 'firefox'; | ||
| } | ||
|
|
||
| async function runFirefoxProxyModeCryptoTest () { | ||
| // NOTE: host is intentionally unset to exercise the hostname calculation path. | ||
| const testCafe = await createTestCafe({ port1: 1335, port2: 1336 }); | ||
|
|
||
| try { | ||
| const failedCount = await testCafe | ||
| .createRunner() | ||
| .src(path.join(__dirname, 'testcafe-fixtures/index.js')) | ||
| .browsers(getFirefoxBrowserName()) | ||
| .run({ | ||
| disableNativeAutomation: true, | ||
| pageLoadTimeout: 45000, | ||
| selectorTimeout: 5000, | ||
| testExecutionTimeout: 120000, | ||
| }); | ||
|
|
||
| expect(failedCount).eql(0); | ||
| } | ||
| finally { | ||
| await testCafe.close(); | ||
| } | ||
| } | ||
|
|
||
| (needSkip ? describe.skip : describe)('[Regression](GH-8391)', function () { | ||
| it('Should keep WebCrypto available in Firefox proxy mode when all browsers are local', function () { | ||
| return runFirefoxProxyModeCryptoTest(); | ||
| }); | ||
| }); |
16 changes: 16 additions & 0 deletions
16
test/functional/fixtures/regression/gh-8391/testcafe-fixtures/index.js
This file contains hidden or 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,16 @@ | ||
| import { ClientFunction } from 'testcafe'; | ||
|
|
||
| fixture('GH-8391 - Firefox proxy mode should preserve WebCrypto') | ||
| .page`http://localhost:3000/fixtures/regression/gh-8391/pages/index.html`; | ||
|
|
||
| const getCryptoState = ClientFunction(() => ({ | ||
| hasSubtle: !!(window.crypto && window.crypto.subtle), | ||
| isSecureContext: window.isSecureContext, | ||
| })); | ||
|
|
||
| test('Should expose window.crypto.subtle in Firefox proxy mode', async t => { | ||
| const cryptoState = await getCryptoState(); | ||
|
|
||
| await t.expect(cryptoState.isSecureContext).ok('Expected secure context in proxy mode'); | ||
| await t.expect(cryptoState.hasSubtle).ok('Expected WebCrypto API to be available in proxy mode'); | ||
| }); |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_isAllBrowsersLocalcallsbrowser.provider.isLocalBrowser(void 0, ...)for everyBrowserInfoSource. When the entry is aBrowserConnection, an id is available (browser.id) and some providers rely on it to determine locality; passingundefinedrisks misclassifying remote connections as local, which can incorrectly forcehostnametolocalhostin proxy mode. Pass the connection id forBrowserConnectioninstances (and keepundefinedfor plainBrowserInfo).