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

Side by Side Diff: chrome/browser/signin/token_service_unittest.cc

Issue 9834056: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed unchanged file Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file defines a unit test for the profile's token service. 5 // This file defines a unit test for the profile's token service.
6 6
7 #include "chrome/browser/signin/token_service_unittest.h" 7 #include "chrome/browser/signin/token_service_unittest.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 credentials_.sid = "sid"; 65 credentials_.sid = "sid";
66 credentials_.lsid = "lsid"; 66 credentials_.lsid = "lsid";
67 credentials_.token = "token"; 67 credentials_.token = "token";
68 credentials_.data = "data"; 68 credentials_.data = "data";
69 oauth_token_ = "oauth"; 69 oauth_token_ = "oauth";
70 oauth_secret_ = "secret"; 70 oauth_secret_ = "secret";
71 71
72 ASSERT_TRUE(db_thread_.Start()); 72 ASSERT_TRUE(db_thread_.Start());
73 73
74 profile_.reset(new TestingProfile()); 74 profile_.reset(new TestingProfile());
75 profile_->CreateWebDataService(false);
76 WaitForDBLoadCompletion(); 75 WaitForDBLoadCompletion();
77 service_ = TokenServiceFactory::GetForProfile(profile_.get()); 76 service_ = TokenServiceFactory::GetForProfile(profile_.get());
78 77
79 success_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_AVAILABLE, 78 success_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_AVAILABLE,
80 content::Source<TokenService>(service_)); 79 content::Source<TokenService>(service_));
81 failure_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_REQUEST_FAILED, 80 failure_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
82 content::Source<TokenService>(service_)); 81 content::Source<TokenService>(service_));
83 82
84 service_->Initialize("test", profile_.get()); 83 service_->Initialize("test", profile_.get());
85 } 84 }
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 423
425 *CommandLine::ForCurrentProcess() = original_cl; 424 *CommandLine::ForCurrentProcess() = original_cl;
426 } 425 }
427 }; 426 };
428 427
429 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { 428 TEST_F(TokenServiceCommandLineTest, TestValueOverride) {
430 EXPECT_TRUE(service_->HasTokenForService("my_service")); 429 EXPECT_TRUE(service_->HasTokenForService("my_service"));
431 EXPECT_EQ("my_value", service_->GetTokenForService("my_service")); 430 EXPECT_EQ("my_value", service_->GetTokenForService("my_service"));
432 } 431 }
433 #endif // ifndef NDEBUG 432 #endif // ifndef NDEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698