-
Notifications
You must be signed in to change notification settings - Fork 970
Automated tests fixes and refactoring #7951
Conversation
8a5d0dc
to
f6bcfb0
Compare
f6bcfb0
to
e42bf66
Compare
Details: brave#7951
32e0228
to
06d7007
Compare
test/contents/autofillTest.js
Outdated
@@ -213,7 +213,7 @@ describe('Autofill', function () { | |||
.waitForTextValue('.creditCardPExpirationDate', | |||
(expMonth < 10 ? '0' + expMonth.toString() : expMonth.toString()) + '/' + expYear.toString()) | |||
}) | |||
it('autofills the credit card', function * () { | |||
it.skip('autofills the credit card', function * () { |
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.
Update of #5389 is necessary I think.
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.
Thank you will do
c89f00b
to
e257fd5
Compare
Details: brave#7951
52a4838
to
81587d3
Compare
Details: brave#7951
53a4e29
to
5a24237
Compare
Details: brave#7951
5a24237
to
92ed4e3
Compare
Details: brave#7951
@darkdh Because of Standard I needed to add some brackets to this file |
app/browser/ads/adBlockUtil.js
Outdated
siteHacks[firstPartyUrl.hostname] && | ||
siteHacks[firstPartyUrl.hostname].allowFirstPartyAdblockChecks | ||
) | ||
) && |
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.
I think this )
should be in L39 so that resourceType !== 'mainFrame'
only affect isThirdPartyHost(firstPartyUrl.hostname || '', url.hostname)
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.
Thank you. Please verify the change
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.
lgtm now! Thanks for doing this 😉
d2c49da
to
bec610a
Compare
@NejcZdovc ready for another rebase 😛 |
We have two tests that can be fixed easily because they can be reproduced, but I don't know how to fix it. It fails in cc @bbondy |
bec610a
to
1b04f89
Compare
Details: brave#7951
@bsclifton rebased |
0dffa63
to
111e01d
Compare
js/stores/eventStore.js
Outdated
@@ -54,7 +54,7 @@ const addPageView = (url, tabId) => { | |||
tab.isDestroyed() || | |||
!tab.session.partition.startsWith('persist:') | |||
|
|||
if (url && isSourceAboutUrl(url) || isPrivate) { | |||
if (url && (isSourceAboutUrl(url) || isPrivate)) { |
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.
i think this should be (url && isSourceAboutUrl(url)) || isPrivate
, assuming the previous code was correct
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.
Fixed, thank you
111e01d
to
4e11205
Compare
Details: brave#7951
@@ -31,16 +31,27 @@ const mapFilterType = { | |||
const shouldDoAdBlockCheck = (resourceType, firstPartyUrl, url, shouldCheckMainFrame) => |
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.
i thought this function was supposed to do the following instead:
firstPartyUrl.protocol &&
// By default first party hosts are allowed, but enable the check if a flag is specified in siteHacks
(
shouldCheckMainFrame ||
(
(
resourceType !== 'mainFrame' &&
isThirdPartyHost(firstPartyUrl.hostname || '', url.hostname)
) ||
(
siteHacks[firstPartyUrl.hostname] &&
siteHacks[firstPartyUrl.hostname].allowFirstPartyAdblockChecks
)
)
) &&
// Only check http and https for now
firstPartyUrl.protocol.startsWith('http') &&
// Only do adblock if the host isn't in the whitelist
!whitelistHosts.find((whitelistHost) => whitelistHost === url.hostname || url.hostname.endsWith('.' + whitelistHost)) &&
// Make sure there's a valid resource type before trying to use adblock
mapFilterType[resourceType] !== undefined
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.
cc @darkdh
@diracdeltas I am not familiar with this code, so any feedback and help is more then welcome
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.
for reference, here's what was in startAdBlocking prior to 85464b9:
const cancel = firstPartyUrl.protocol &&
(shouldCheckMainFrame || (details.resourceType !== 'mainFrame' &&
Filtering.isThirdPartyHost(firstPartyUrlHost, urlHost))) &&
firstPartyUrl.protocol.startsWith('http') &&
mapFilterType[details.resourceType] !== undefined &&
!whitelistHosts.includes(urlHost) &&
!urlHost.endsWith('.disqus.com') &&
adblock.matches(details.url, mapFilterType[details.resourceType], firstPartyUrl.host)
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.
cc @bbondy
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.
yes @diracdeltas is right.
Please do test that youtube videos do not give ads just to be sure though (logged in and out) and also do the test cases here:
fc24493#diff-1f92b9d4310a18761948d6ea1fbefc84
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.
Code from @diracdeltas first comment was added
838c6da
to
24ad5c4
Compare
Test were refactored to prevent intermediate fails and optimization of the code List of changes: brave#7951
Resolves brave#7950 Auditors: @bsclifton Test Plan: - `npm run test -- --grep="navigationBar tests"`
Test were refactored to prevent intermediate fails and optimization of the code List of changes: brave#7951
All test command has now log, so that we know which one is called We also have verbose mode in travis by default
Sites for about:bookmarks in now added as a batch Test Plan: - `npm run test -- --grep="bookmarks"`
24ad5c4
to
3869152
Compare
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.
Tests described on test plan all passed except for . Addressed, works ++navigationBar tests lockIcon shows insecure icon on an HTTP PDF
but I think it's not related to PR
Lint for standard@9.0.0 works as well. LGTM
This is a follow up of brave#7813 and resolves linter errors Resolves brave#8061
Now we get title from a toolbar and use this for test value Test Plan: - npm run test -- --grep="bookmark pdf"
3869152
to
79e5f72
Compare
git rebase -i
to squash commits (if needed).Resolves #7950
Closes #8061
Changed from

to

Auditors
@bsclifton @bbondy
Refactor
waitForExist('X, Y, true)
->waitForElementCount(X, 0)
->
waitForTextValue(X, Y)
isExisting(X).then((isExisting) => isExisting === false)
->waitForElementCount(X, 0)
->
waitForInputText(X, Y)
waitForVisible(X, Y, true)
->waitForElementCount(X, 0)
Note
In this PR I also added
BRAVE_TEST_COMMAND_LOGS=1
flag to Travis. This way we can see the problem easier and resolve it fasterDO NOT SQUASH COMMITS
Test Plan
npm run test