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

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

Issue 1977423002: Added UMA stats to track the budget for any service worker which receives a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/background_budget_service_unittest.cc
diff --git a/chrome/browser/push_messaging/background_budget_service_unittest.cc b/chrome/browser/push_messaging/background_budget_service_unittest.cc
index 501602881cd4def8dce4a089004b1cf294094aac..f09a396daa534ed1e67641b529a62f815447cee4 100644
--- a/chrome/browser/push_messaging/background_budget_service_unittest.cc
+++ b/chrome/browser/push_messaging/background_budget_service_unittest.cc
@@ -21,7 +21,7 @@ namespace {
const char kTestOrigin[] = "https://example.com";
const double kTestBudget = 10.0;
-const double kTestSES = 24.0;
+const double kTestSES = 48.0;
const double kLowSES = 1.0;
const double kMaxSES = 100.0;
// Mirrors definition in BackgroundBudgetService, this is 10 days of seconds.
@@ -184,11 +184,13 @@ TEST_F(BackgroundBudgetServiceTest, GetBudgetConsumedOverTime) {
budget = service->GetBudget(origin);
if (i % 10 == 0) {
- service->StoreBudget(origin, budget - 1.0);
+ double newBudget =
Peter Beverloo 2016/05/17 11:04:34 nit: new_budget
harkness 2016/05/17 13:08:16 actually, refactored a bit so renamed the variable
+ budget - BackgroundBudgetService::GetBackgroundProcessingCost();
+ service->StoreBudget(origin, newBudget);
}
}
- // With a SES of 24.0, the origin will get a budget of 2.4 per day, but the
+ // With a SES of 48.0, the origin will get a budget of 2.4 per day, but the
// old budget will also decay. At the end, we expect the budget to be lower
// than the starting budget.
EXPECT_GT(budget, 0.0);

Powered by Google App Engine
This is Rietveld 408576698