Skip to content
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

Test importing passwords from Chrome #82

Merged
merged 7 commits into from
Apr 25, 2018
Merged

Conversation

garrettr
Copy link
Contributor

@garrettr garrettr commented Apr 3, 2018

Unit tests for #77. Also refactors the importer unit tests to reduce code duplication.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

yarn test brave_unit_tests

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@garrettr garrettr requested review from bbondy and darkdh April 3, 2018 23:23
@bbondy
Copy link
Member

bbondy commented Apr 4, 2018

lgtm but @darkdh is the better reviewer, so I'll defer to him to approve or ask for changes.

EXPECT_EQ("test@example.com",
UTF16ToASCII(password.username_value));
EXPECT_EQ("testing123",
UTF16ToASCII(password.password_value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to test the case of Never Saved List

@bbondy
Copy link
Member

bbondy commented Apr 16, 2018

Should we close this PR?

@darkdh
Copy link
Member

darkdh commented Apr 16, 2018

Waiting for test case update and I will approve

@garrettr
Copy link
Contributor Author

I will provide an updated test case this week.

Garrett Robinson added 6 commits April 20, 2018 13:55
ChromeImporter::ImportPasswords modifies the "Login Data" database every time
it runs. This is a side effect of LoginDatabase::Init and is not easily fixed.

As a result, the ImportPasswords test modifes the test "Login Data" file, which
is under version control, every time it runs. Copying the test profile data to
a tempdir prevents the tests from inappropriately modifying files under version
control.
@garrettr garrettr force-pushed the test-import-chrome-passwords branch from aa9d0fe to d9876f1 Compare April 20, 2018 21:59
@garrettr
Copy link
Contributor Author

This PR now tests importing both "autofillable" and "blacklisted" logins from Chrome, as requested by @darkdh in his review. A login is autofillable or blacklisted depending on whether you click "Yes" or "Never" when Chrome prompts you to save a password.

In addition, I improved the process for generating the test copy of Chrome's Login Data database, and documented it in detail.

@garrettr garrettr requested a review from darkdh April 20, 2018 22:01
UTF16ToASCII(password.username_value));
EXPECT_EQ("testing123",
UTF16ToASCII(password.password_value));
EXPECT_FALSE(autofillable_login.blacklisted_by_user);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also verify signon_realm for both autofillable_login and blacklisted_login?

Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work. ++

@darkdh darkdh merged commit 3a0a431 into master Apr 25, 2018
@bsclifton bsclifton deleted the test-import-chrome-passwords branch June 18, 2018 06:29
NejcZdovc added a commit that referenced this pull request Dec 10, 2018
don't allow multiple concurrent init calls
bbondy pushed a commit that referenced this pull request Feb 18, 2019
set stats to 99+ if resource is above that number
fmarier pushed a commit that referenced this pull request Oct 29, 2019
Ignore xtb files when creating patches
petemill pushed a commit that referenced this pull request Jul 27, 2020
Ignore xtb files when creating patches
petemill pushed a commit that referenced this pull request Jul 28, 2020
Ignore xtb files when creating patches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants