| OLD | NEW |
| 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 Loading... |
| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 404 |
| 406 *CommandLine::ForCurrentProcess() = original_cl; | 405 *CommandLine::ForCurrentProcess() = original_cl; |
| 407 } | 406 } |
| 408 }; | 407 }; |
| 409 | 408 |
| 410 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { | 409 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { |
| 411 EXPECT_TRUE(service_->HasTokenForService("my_service")); | 410 EXPECT_TRUE(service_->HasTokenForService("my_service")); |
| 412 EXPECT_EQ("my_value", service_->GetTokenForService("my_service")); | 411 EXPECT_EQ("my_value", service_->GetTokenForService("my_service")); |
| 413 } | 412 } |
| 414 #endif // ifndef NDEBUG | 413 #endif // ifndef NDEBUG |
| OLD | NEW |