New issue
Advanced search Search tips

Issue 779182 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Refactor PasswordManagerPorter tests

Project Member Reported by cfroussios@chromium.org, Oct 27 2017

Issue description

Currently the tests are a stub. We mock half of PasswordManagerPorter and test that the unmocked half calls the other half.

We should not have to mock the class under testing.

Plan:
1. password_manager::PasswordExporter and password_manager::PasswordImporter into mockable classes.
2. Refactor PasswordManagerPorter to expect calls on injected mocks instead of the class under test.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 9 2017

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

commit a41dfd6040cd8675c6d86c07e25b5f79209cdf60
Author: Christos Froussios <cfroussios@chromium.org>
Date: Thu Nov 09 15:04:57 2017

🔐 Merge PasswordExporter into PasswordManagerPorter

PasswordExporter is a tiny wrapper that merely schedules a task for
writing to a file. We consolidate the Export logic by merging it into
PasswordManagerPorter.

This will also shorten the round trip for callbacks, which the export
passwords flow needs to provide feedback to the user.

Bug: 779182
Change-Id: Idb5640200fd1bfdbf1103a49921ba4a3509ea6fd
Reviewed-on: https://chromium-review.googlesource.com/741982
Commit-Queue: Christos Froussios <cfroussios@chromium.org>
Reviewed-by: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515171}
[modify] https://crrev.com/a41dfd6040cd8675c6d86c07e25b5f79209cdf60/chrome/browser/ui/passwords/password_manager_porter.cc
[modify] https://crrev.com/a41dfd6040cd8675c6d86c07e25b5f79209cdf60/chrome/browser/ui/passwords/password_manager_porter_unittest.cc
[modify] https://crrev.com/a41dfd6040cd8675c6d86c07e25b5f79209cdf60/components/password_manager/core/browser/BUILD.gn
[delete] https://crrev.com/cccda43345d0c7ff7fd680882a9478de8dd0ceec/components/password_manager/core/browser/export/password_exporter.cc
[delete] https://crrev.com/cccda43345d0c7ff7fd680882a9478de8dd0ceec/components/password_manager/core/browser/export/password_exporter.h
[delete] https://crrev.com/cccda43345d0c7ff7fd680882a9478de8dd0ceec/components/password_manager/core/browser/export/password_exporter_unittest.cc

Sign in to add a comment