Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2432)

Unified Diff: chrome/browser/previews/previews_infobar_delegate_unittest.cc

Issue 2820793003: Track Previews infobar dismissals due to tab closure (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/previews/previews_infobar_delegate.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/previews/previews_infobar_delegate_unittest.cc
diff --git a/chrome/browser/previews/previews_infobar_delegate_unittest.cc b/chrome/browser/previews/previews_infobar_delegate_unittest.cc
index dfcc45d39d0c6637904d2fed6362d69c31652c13..c4fb575476ae7528fd8c7e3ee7bb9fae0ae9a7d7 100644
--- a/chrome/browser/previews/previews_infobar_delegate_unittest.cc
+++ b/chrome/browser/previews/previews_infobar_delegate_unittest.cc
@@ -223,6 +223,23 @@ TEST_F(PreviewsInfoBarDelegateUnitTest, InfobarTestUserDismissal) {
EXPECT_FALSE(user_opt_out_.value());
}
+TEST_F(PreviewsInfoBarDelegateUnitTest, InfobarTestTabClosedDismissal) {
+ base::HistogramTester tester;
+
+ CreateInfoBar(PreviewsInfoBarDelegate::LOFI, true /* is_data_saver_user */);
+
+ // Delete the infobar without any other infobar actions.
+ infobar_service()->infobar_at(0)->RemoveSelf();
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
+
+ tester.ExpectBucketCount(
+ kUMAPreviewsInfoBarActionLoFi,
+ PreviewsInfoBarDelegate::INFOBAR_DISMISSED_BY_TAB_CLOSURE, 1);
+ EXPECT_EQ(0, drp_test_context_->pref_service()->GetInteger(
+ data_reduction_proxy::prefs::kLoFiLoadImagesPerSession));
+ EXPECT_FALSE(user_opt_out_.value());
+}
+
TEST_F(PreviewsInfoBarDelegateUnitTest, InfobarTestClickLinkLoFi) {
base::HistogramTester tester;
« no previous file with comments | « chrome/browser/previews/previews_infobar_delegate.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698