New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 639678 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
hobby only
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Some PasswordFormManagerTest test cases seems outdated

Project Member Reported by vabr@chromium.org, Aug 21 2016

Issue description

Some PasswordFormManagerTest test cases seem out of date

=== TestForceInclusionOfGeneratedPasswords_NoMatch ===
The test verifies that saved passwords always are sent to be autofilled if they have the "generated" bit set. However, the current way the test is written, it would succeed even if the password were not generated, because Chrome changed since the introduction of the test in https://chromiumcodereview.appspot.com/23533069, and computes best matches separately by username.

On the other hand, there seems to be no special treating of generated passwords during the selection for best matches, so if there were 2 results for the same username, one of them scoring high but not generated, and the other scoring low but generated, it seems that Chrome would fill the high-scoring result, and not the generated one.

Should we delete TestForceInclusionOfGeneratedPasswords_NoMatch? Is the current functionality covered by TestBestCredentialsByEachUsernameAreIncluded, or do we need to test more?

=== CorrectlyUpdatePasswordsWithSameUsername ===
This test creates a situation where two logins with the same unique key are saved. That's not realistic. The introducing CL https://codereview.chromium.org/431893003 and the associated bug do not seem very clear about what was the original failure seen in reality. It seems that the test needs adjusting to work with logins with the same username but different unique keys.
 

Comment 1 by vabr@chromium.org, Aug 22 2016

Cc: -vabr@chromium.org dvadym@chromium.org
Owner: vabr@chromium.org
I'm hitting other strange tests as I go through PFM unittest.

So I will prepare a CL to fix those and ask you for review of that.

Comment 2 by vabr@chromium.org, Aug 22 2016

Description: Show this description

Comment 3 by vabr@chromium.org, Aug 22 2016

Summary: Some PasswordFormManagerTest test cases seems outdated (was: PasswordFormManagerTest.TestForceInclusionOfGeneratedPasswords_NoMatch seems outdated)

Comment 4 by vabr@chromium.org, Aug 22 2016

CL uploaded for https://codereview.chromium.org/2262143002, but holding off with requesting review yet, both to let bots go green, and to see if I see other problematic test cases.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d31632b608b6168a0b923aa08f46338186a1809f

commit d31632b608b6168a0b923aa08f46338186a1809f
Author: vabr <vabr@chromium.org>
Date: Wed Aug 24 12:39:39 2016

Fix some outdated test cases in PasswordFormManagerTest

This CL removes TestForceInclusionOfGeneratedPasswords_NoMatch and fixes
CorrectlyUpdatePasswordsWithSameUsername. The former is outdated and replaced
by other test cases. The latter created the unrealistic situation of multiple
stored credentials with the same unique key -- the fix is to slightly tweak the
unique key. More details on the bug.

BUG= 639678 

Review-Url: https://codereview.chromium.org/2262143002
Cr-Commit-Position: refs/heads/master@{#414054}

[modify] https://crrev.com/d31632b608b6168a0b923aa08f46338186a1809f/components/password_manager/core/browser/password_form_manager_unittest.cc

Comment 6 by vabr@chromium.org, Aug 24 2016

Status: Fixed (was: Assigned)

Sign in to add a comment