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

Unified Diff: chrome/browser/extensions/token_cache/token_cache_service_unittest.cc

Issue 170383005: Move TokenCacheService away from listening for Signin notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call Shutdown() in unit test Created 6 years, 10 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/extensions/token_cache/token_cache_service_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/token_cache/token_cache_service_unittest.cc
diff --git a/chrome/browser/extensions/token_cache/token_cache_service_unittest.cc b/chrome/browser/extensions/token_cache/token_cache_service_unittest.cc
index fe549317180551818cffdb85d262f4178a0d6456..a11c9d1d11cc6edb7959e594aebee5c87c76e49a 100644
--- a/chrome/browser/extensions/token_cache/token_cache_service_unittest.cc
+++ b/chrome/browser/extensions/token_cache/token_cache_service_unittest.cc
@@ -5,10 +5,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/time/time.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/token_cache/token_cache_service.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_source.h"
+#include "chrome/test/base/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::Time;
@@ -18,8 +16,8 @@ namespace extensions {
class TokenCacheTest : public testing::Test {
public:
- TokenCacheTest() : cache_(NULL) {}
- virtual ~TokenCacheTest() {}
+ TokenCacheTest() : cache_(&profile_) {}
+ virtual ~TokenCacheTest() { cache_.Shutdown(); }
size_t CacheSize() {
return cache_.token_cache_.size();
@@ -46,6 +44,7 @@ class TokenCacheTest : public testing::Test {
}
protected:
+ TestingProfile profile_;
TokenCacheService cache_;
};
@@ -86,14 +85,11 @@ TEST_F(TokenCacheTest, ReplaceTokenTest) {
TEST_F(TokenCacheTest, SignoutTest) {
TimeDelta zero;
cache_.StoreToken("foo", "bar", zero);
- content::Source<Profile> stub_source(NULL);
- content::NotificationDetails stub_details;
EXPECT_EQ(1U, CacheSize());
EXPECT_TRUE(HasMatch("foo"));
- cache_.Observe(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT,
- stub_source, stub_details);
+ cache_.GoogleSignedOut("foo");
EXPECT_EQ(0U, CacheSize());
EXPECT_FALSE(HasMatch("foo"));
« no previous file with comments | « chrome/browser/extensions/token_cache/token_cache_service_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698