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

Side by Side Diff: chrome/browser/extensions/token_cache/token_cache_service_unittest.cc

Issue 502343002: Add account_id to signin manager notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@isauth
Patch Set: Fix android trybots Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "chrome/browser/extensions/token_cache/token_cache_service.h" 8 #include "chrome/browser/extensions/token_cache/token_cache_service.h"
9 #include "chrome/test/base/testing_profile.h" 9 #include "chrome/test/base/testing_profile.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 EXPECT_EQ(1U, CacheSize()); 82 EXPECT_EQ(1U, CacheSize());
83 } 83 }
84 84
85 TEST_F(TokenCacheTest, SignoutTest) { 85 TEST_F(TokenCacheTest, SignoutTest) {
86 TimeDelta zero; 86 TimeDelta zero;
87 cache_.StoreToken("foo", "bar", zero); 87 cache_.StoreToken("foo", "bar", zero);
88 88
89 EXPECT_EQ(1U, CacheSize()); 89 EXPECT_EQ(1U, CacheSize());
90 EXPECT_TRUE(HasMatch("foo")); 90 EXPECT_TRUE(HasMatch("foo"));
91 91
92 cache_.GoogleSignedOut("foo"); 92 cache_.GoogleSignedOut("foo", "foo");
93 93
94 EXPECT_EQ(0U, CacheSize()); 94 EXPECT_EQ(0U, CacheSize());
95 EXPECT_FALSE(HasMatch("foo")); 95 EXPECT_FALSE(HasMatch("foo"));
96 } 96 }
97 97
98 TEST_F(TokenCacheTest, TokenExpireTest) { 98 TEST_F(TokenCacheTest, TokenExpireTest) {
99 // Use the fact that we are friends to insert an expired token. 99 // Use the fact that we are friends to insert an expired token.
100 InsertExpiredToken("foo", "bar"); 100 InsertExpiredToken("foo", "bar");
101 101
102 EXPECT_EQ(1U, CacheSize()); 102 EXPECT_EQ(1U, CacheSize());
103 103
104 // If we attempt to find the token, the attempt should fail. 104 // If we attempt to find the token, the attempt should fail.
105 EXPECT_FALSE(HasMatch("foo")); 105 EXPECT_FALSE(HasMatch("foo"));
106 EXPECT_EQ(0U, CacheSize()); 106 EXPECT_EQ(0U, CacheSize());
107 } 107 }
108 108
109 } // namespace extensions 109 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/token_cache/token_cache_service.cc ('k') | chrome/browser/metrics/signin_status_metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698