This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workaround to fix about:safebrowsing redirect
fix #8905 Test Plan: 1. safebrowsing test should pass 2. go to downloadme.org. it should redirect to the safebrowsing page and the page should not be blank or have missing text.
- Loading branch information
1 parent
5706a55
commit 2186b3f
Showing
3 changed files
with
46 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
/* global describe, it, before */ | ||
|
||
const Brave = require('../lib/brave') | ||
const {urlInput} = require('../lib/selectors') | ||
|
||
describe('safebrowsing interception', function () { | ||
function * setup (client) { | ||
yield client | ||
.waitForBrowserWindow() | ||
.waitForVisible(urlInput) | ||
} | ||
|
||
Brave.beforeAll(this) | ||
before(function * () { | ||
this.badUrl = 'http://downloadme.org' | ||
this.safebrowsingUrl = `about:safebrowsing#${this.badUrl}` | ||
yield setup(this.app.client) | ||
}) | ||
|
||
it('redirects to safebrowsing URL', function * () { | ||
yield this.app.client | ||
.tabByIndex(0) | ||
.url(this.badUrl) | ||
.waitUntil(function () { | ||
return this.getText('body').then((val) => { | ||
return val.includes('For your safety, Brave has blocked this site') | ||
}) | ||
}) | ||
.windowByUrl(Brave.browserWindowUrl) | ||
.getAttribute(urlInput, 'value').then((value) => { | ||
return value === this.safebrowsingUrl | ||
}) | ||
}) | ||
}) |