Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const expectations = {
finalDisplayedUrl: /(expired.badssl.com|chrome-error)/,
runtimeError: {code: 'INSECURE_DOCUMENT_REQUEST'},
runWarnings: [
/expired.badssl.*redirected to chrome-error:/,
/The URL you have provided does not have a valid security certificate. net::ERR_CERT_(DATE|AUTHORITY)_INVALID/,
],
audits: {
Expand Down
3 changes: 2 additions & 1 deletion core/gather/driver/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ function getNavigationWarnings(navigation) {

if (navigation.timedOut) warnings.push(str_(UIStrings.warningTimeout));

if (!UrlUtils.equalWithExcludedFragments(requestedUrl, mainDocumentUrl)) {
if (!mainDocumentUrl.startsWith('chrome-error://') &&
!UrlUtils.equalWithExcludedFragments(requestedUrl, mainDocumentUrl)) {
warnings.push(str_(UIStrings.warningRedirected, {
requested: requestedUrl,
final: mainDocumentUrl,
Expand Down
13 changes: 11 additions & 2 deletions core/test/gather/driver/navigation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,18 @@ describe('.getNavigationWarnings()', () => {
expect(warnings).toHaveLength(0);
});

it('adds a url mismatch warning for failed navigations', () => {
it('does not add a url mismatch warning for error interstitials', () => {
const mainDocumentUrl = 'chrome-error://chromewebdata/';
const warnings = getNavigationWarnings({...normalNavigation, mainDocumentUrl});
expect(warnings).toHaveLength(1);
expect(warnings).toHaveLength(0);
});

it('keeps timeout warnings for error interstitials', () => {
const warnings = getNavigationWarnings({
...normalNavigation,
mainDocumentUrl: 'chrome-error://chromewebdata/',
timedOut: true,
});
expect(warnings).toEqual(getNavigationWarnings({...normalNavigation, timedOut: true}));
});
});
Loading