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

Unified Diff: chrome/browser/push_messaging/push_messaging_browsertest.cc

Issue 2281673002: Full hookup of BudgetManager interfaces to BudgetDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manager
Patch Set: nits Created 4 years, 3 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
Index: chrome/browser/push_messaging/push_messaging_browsertest.cc
diff --git a/chrome/browser/push_messaging/push_messaging_browsertest.cc b/chrome/browser/push_messaging/push_messaging_browsertest.cc
index 4f2482c9cb58017392bb5dbe4714e84a15d6f07a..9196a1aacc9bebbd444bf5d5f745be3bc3167b2e 100644
--- a/chrome/browser/push_messaging/push_messaging_browsertest.cc
+++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
@@ -15,7 +15,6 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/test/histogram_tester.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
@@ -271,13 +270,10 @@ class PushMessagingBrowserTest : public InProcessBrowserTest {
virtual Browser* GetBrowser() const { return browser(); }
- base::HistogramTester* GetHistogramTester() { return &histogram_tester_; }
-
private:
std::unique_ptr<net::EmbeddedTestServer> https_server_;
gcm::FakeGCMProfileService* gcm_service_;
PushMessagingServiceImpl* push_service_;
- base::HistogramTester histogram_tester_;
#if defined(ENABLE_NOTIFICATIONS)
std::unique_ptr<StubNotificationUIManager> notification_manager_;
@@ -847,37 +843,6 @@ IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,
EXPECT_NE(kPushMessagingForcedNotificationTag, first_notification.tag());
}
-
- // Check that the UMA has been recorded correctly.
- // There should be a total of 7 budget samples, spread across 3 buckets. The
- // first four notifications (before any budget is consumed) have budget of 4,
- // which is the starting SES. The next one has 2 (one hidden notification) and
- // the final two have 0 (two hidden notifications.
- std::vector<base::Bucket> buckets =
- GetHistogramTester()->GetAllSamples("PushMessaging.BackgroundBudget");
- ASSERT_EQ(3.0, buckets.size());
- // First bucket is for 0 budget, which has 2 samples.
- EXPECT_EQ(0, buckets[0].min);
- EXPECT_EQ(2, buckets[0].count);
- // Second bucket is for 2 budget, which has 1 sample.
- EXPECT_EQ(2, buckets[1].min);
- EXPECT_EQ(1, buckets[1].count);
- // Final bucket is for 4 budget, which has 4 samples.
- EXPECT_EQ(4, buckets[2].min);
- EXPECT_EQ(4, buckets[2].count);
-
- std::vector<base::Bucket> no_budget_buckets =
- GetHistogramTester()->GetAllSamples("PushMessaging.SESForNoBudgetOrigin");
- ASSERT_EQ(1.0, no_budget_buckets.size());
- EXPECT_EQ(4, no_budget_buckets[0].min);
- EXPECT_EQ(2, no_budget_buckets[0].count);
-
- std::vector<base::Bucket> low_budget_buckets =
- GetHistogramTester()->GetAllSamples(
- "PushMessaging.SESForLowBudgetOrigin");
- ASSERT_EQ(1.0, low_budget_buckets.size());
- EXPECT_EQ(4, low_budget_buckets[0].min);
- EXPECT_EQ(1, low_budget_buckets[0].count);
}
IN_PROC_BROWSER_TEST_F(PushMessagingBrowserTest,

Powered by Google App Engine
This is Rietveld 408576698