-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge-M103][Passwords] NewlySavedPasswordHasEmptyUsername metric
I want to measure the necessity of username editing in a generation confirmation bubble/infobar. (cherry picked from commit 1b1a0fb, the merge conflict with crrev.com/c/3649663 is resolved) Bug: 1328798 Change-Id: I266109df5e550f990561a27c94268d8a4880e257 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3663286 Reviewed-by: Ioana Pandele <ioanap@chromium.org> Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1008196} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3673067 Cr-Commit-Position: refs/branch-heads/5060@{#383} Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
- Loading branch information
Maxim Kolosovskiy
authored and
Chromium LUCI CQ
committed
May 30, 2022
1 parent
9682bbb
commit 83a2ef2
Showing
6 changed files
with
75 additions
and
8 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
41 changes: 41 additions & 0 deletions
41
components/password_manager/core/browser/password_manager_metrics_util_unittest.cc
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,41 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "components/password_manager/core/browser/password_manager_metrics_util.h" | ||
|
||
#include "base/test/metrics/histogram_tester.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
namespace password_manager::metrics_util { | ||
|
||
TEST(PasswordManagerMetricsUtil, LogNewlySavedPasswordMetrics) { | ||
base::HistogramTester histogram_tester; | ||
|
||
constexpr bool kIsGeneratedPassword = true; | ||
constexpr bool kIsUsernameEmpty = true; | ||
LogNewlySavedPasswordMetrics( | ||
/*is_generated_password=*/true, /*is_username_empty=*/true, | ||
PasswordAccountStorageUsageLevel::kNotUsingAccountStorage); | ||
|
||
histogram_tester.ExpectUniqueSample( | ||
"PasswordManager.NewlySavedPasswordIsGenerated", kIsGeneratedPassword, 1); | ||
histogram_tester.ExpectUniqueSample( | ||
"PasswordManager.NewlySavedPasswordIsGenerated.NotUsingAccountStorage", | ||
kIsGeneratedPassword, 1); | ||
histogram_tester.ExpectTotalCount( | ||
"PasswordManager.NewlySavedPasswordIsGenerated.UsingAccountStorage", 0); | ||
histogram_tester.ExpectTotalCount( | ||
"PasswordManager.NewlySavedPasswordIsGenerated.Syncing", 0); | ||
|
||
histogram_tester.ExpectUniqueSample( | ||
"PasswordManager.NewlySavedPasswordHasEmptyUsername.Overall", | ||
kIsUsernameEmpty, 1); | ||
histogram_tester.ExpectUniqueSample( | ||
"PasswordManager.NewlySavedPasswordHasEmptyUsername.AutoGenerated", | ||
kIsUsernameEmpty, 1); | ||
histogram_tester.ExpectTotalCount( | ||
"PasswordManager.NewlySavedPasswordHasEmptyUsername.UserCreated", 0); | ||
} | ||
|
||
} // namespace password_manager::metrics_util |
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