Commit 13b2e14f authored by Luum Habtemariam's avatar Luum Habtemariam Committed by Commit Bot

Adding tracking metric to PPD edit ref resolution

Per bug below, this change adds the Printing.CUPS.InvalidPpdResolved
metric to follow this issue as its resolved.

Bug: chromium:1046125
Test: updated sync test passes
Change-Id: Idc4c633d2859096e80de8c7648a34112fc96d87f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015832
Commit-Queue: Luum Habtemariam <luum@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736092}
parent eec2c8df
...@@ -73,15 +73,18 @@ bool ResolveInvalidPpdReference(sync_pb::PrinterSpecifics* specifics) { ...@@ -73,15 +73,18 @@ bool ResolveInvalidPpdReference(sync_pb::PrinterSpecifics* specifics) {
auto* ppd_ref = specifics->mutable_ppd_reference(); auto* ppd_ref = specifics->mutable_ppd_reference();
if (!ppd_ref->autoconf()) { if (!ppd_ref->autoconf()) {
base::UmaHistogramBoolean("Printing.CUPS.InvalidPpdResolved", false);
return false; return false;
} }
if (!ppd_ref->has_user_supplied_ppd_url() && if (!ppd_ref->has_user_supplied_ppd_url() &&
!ppd_ref->has_effective_make_and_model()) { !ppd_ref->has_effective_make_and_model()) {
base::UmaHistogramBoolean("Printing.CUPS.InvalidPpdResolved", false);
return false; return false;
} }
ppd_ref->clear_autoconf(); ppd_ref->clear_autoconf();
base::UmaHistogramBoolean("Printing.CUPS.InvalidPpdResolved", true);
return true; return true;
} }
......
...@@ -256,6 +256,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPrintersSyncTest, MakeAndModelMigration) { ...@@ -256,6 +256,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPrintersSyncTest, MakeAndModelMigration) {
IN_PROC_BROWSER_TEST_F(TwoClientPrintersSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientPrintersSyncTest,
InvalidPpdReferenceResolution) { InvalidPpdReferenceResolution) {
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
base::HistogramTester histograms;
// Initialize sync bridge with test printer. // Initialize sync bridge with test printer.
auto printer = CreateTestPrinterSpecifics(0); auto printer = CreateTestPrinterSpecifics(0);
...@@ -286,4 +287,6 @@ IN_PROC_BROWSER_TEST_F(TwoClientPrintersSyncTest, ...@@ -286,4 +287,6 @@ IN_PROC_BROWSER_TEST_F(TwoClientPrintersSyncTest,
spec_ppd_ref = spec_printer->ppd_reference(); spec_ppd_ref = spec_printer->ppd_reference();
EXPECT_FALSE(spec_ppd_ref.autoconf()); EXPECT_FALSE(spec_ppd_ref.autoconf());
EXPECT_TRUE(spec_ppd_ref.has_user_supplied_ppd_url()); EXPECT_TRUE(spec_ppd_ref.has_user_supplied_ppd_url());
histograms.ExpectBucketCount("Printing.CUPS.InvalidPpdResolved",
1 /* kResolved */, 1);
} }
...@@ -121943,6 +121943,17 @@ uploading your change for review. ...@@ -121943,6 +121943,17 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="Printing.CUPS.InvalidPpdResolved" enum="BooleanChanged"
expires_after="2021-01-22">
<owner>luum@chromium.org</owner>
<owner>skau@chromium.org</owner>
<summary>
Records when a synced printer's invalid PPD reference has been resolved by
stripping off the autoconf flag. Recorded during initial sync across
PrintersSyncBridge.
</summary>
</histogram>
<histogram name="Printing.CUPS.IppAttributes" enum="IppAttribute" <histogram name="Printing.CUPS.IppAttributes" enum="IppAttribute"
expires_after="M82"> expires_after="M82">
<owner>vkuzkokov@chromium.org</owner> <owner>vkuzkokov@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment