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

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

Issue 1889513004: Make BackgroundBudgetService a KeyedService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ses_integration
Patch Set: Apply diffs to master branch to remove SES dependency Created 4 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
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 a6e99f941ab65ad32a7fb0880d9fbdd302830c97..255dede4589ebc121c20e07507357c9b79027588 100644
--- a/chrome/browser/push_messaging/background_budget_service_unittest.cc
+++ b/chrome/browser/push_messaging/background_budget_service_unittest.cc
@@ -6,6 +6,7 @@
#include <string>
#include "chrome/browser/push_messaging/background_budget_service.h"
+#include "chrome/browser/push_messaging/background_budget_service_factory.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -22,7 +23,9 @@ class BackgroundBudgetServiceTest : public testing::Test {
BackgroundBudgetServiceTest() {}
~BackgroundBudgetServiceTest() override {}
- TestingProfile* profile() { return &profile_; }
+ BackgroundBudgetService* service() {
+ return BackgroundBudgetServiceFactory::GetForProfile(&profile_);
+ }
private:
content::TestBrowserThreadBundle thread_bundle_;
@@ -32,8 +35,7 @@ class BackgroundBudgetServiceTest : public testing::Test {
TEST_F(BackgroundBudgetServiceTest, GetBudgetFailure) {
const GURL origin(kTestOrigin);
- std::string budget_string =
- BackgroundBudgetService::GetBudget(profile(), origin);
+ std::string budget_string = service()->GetBudget(origin);
EXPECT_EQ(std::string(), budget_string);
}
@@ -41,10 +43,9 @@ TEST_F(BackgroundBudgetServiceTest, GetBudgetFailure) {
TEST_F(BackgroundBudgetServiceTest, GetBudgetSuccess) {
const GURL origin(kTestOrigin);
- BackgroundBudgetService::StoreBudget(profile(), origin, kTestData);
+ service()->StoreBudget(origin, kTestData);
- std::string budget_string =
- BackgroundBudgetService::GetBudget(profile(), origin);
+ std::string budget_string = service()->GetBudget(origin);
EXPECT_EQ(kTestData, budget_string);
}

Powered by Google App Engine
This is Rietveld 408576698