| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/net/gaia/token_service_unittest.h" | 7 #include "chrome/browser/net/gaia/token_service_unittest.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| 11 #include "chrome/browser/password_manager/encryptor.h" | 11 #include "chrome/browser/password_manager/encryptor.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h" | 13 #include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h" |
| 14 #include "chrome/common/net/gaia/gaia_constants.h" | 14 #include "chrome/common/net/gaia/gaia_constants.h" |
| 15 #include "chrome/common/net/test_url_fetcher_factory.h" | 15 #include "content/common/test_url_fetcher_factory.h" |
| 16 | 16 |
| 17 TokenAvailableTracker::TokenAvailableTracker() {} | 17 TokenAvailableTracker::TokenAvailableTracker() {} |
| 18 | 18 |
| 19 TokenAvailableTracker::~TokenAvailableTracker() {} | 19 TokenAvailableTracker::~TokenAvailableTracker() {} |
| 20 | 20 |
| 21 void TokenAvailableTracker::Observe(NotificationType type, | 21 void TokenAvailableTracker::Observe(NotificationType type, |
| 22 const NotificationSource& source, | 22 const NotificationSource& source, |
| 23 const NotificationDetails& details) { | 23 const NotificationDetails& details) { |
| 24 TestNotificationTracker::Observe(type, source, details); | 24 TestNotificationTracker::Observe(type, source, details); |
| 25 if (type == NotificationType::TOKEN_AVAILABLE) { | 25 if (type == NotificationType::TOKEN_AVAILABLE) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 357 |
| 358 *CommandLine::ForCurrentProcess() = original_cl; | 358 *CommandLine::ForCurrentProcess() = original_cl; |
| 359 } | 359 } |
| 360 }; | 360 }; |
| 361 | 361 |
| 362 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { | 362 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { |
| 363 EXPECT_TRUE(service_.HasTokenForService("my_service")); | 363 EXPECT_TRUE(service_.HasTokenForService("my_service")); |
| 364 EXPECT_EQ("my_value", service_.GetTokenForService("my_service")); | 364 EXPECT_EQ("my_value", service_.GetTokenForService("my_service")); |
| 365 } | 365 } |
| 366 #endif // ifndef NDEBUG | 366 #endif // ifndef NDEBUG |
| OLD | NEW |