OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h" | 14 #include "chrome/common/net/gaia/gaia_auth_fetcher_unittest.h" |
15 #include "chrome/common/net/gaia/gaia_constants.h" | 15 #include "chrome/common/net/gaia/gaia_constants.h" |
16 #include "content/test/test_url_fetcher_factory.h" | 16 #include "content/test/test_url_fetcher_factory.h" |
17 | 17 |
| 18 using content::BrowserThread; |
| 19 |
18 TokenAvailableTracker::TokenAvailableTracker() {} | 20 TokenAvailableTracker::TokenAvailableTracker() {} |
19 | 21 |
20 TokenAvailableTracker::~TokenAvailableTracker() {} | 22 TokenAvailableTracker::~TokenAvailableTracker() {} |
21 | 23 |
22 void TokenAvailableTracker::Observe( | 24 void TokenAvailableTracker::Observe( |
23 int type, | 25 int type, |
24 const content::NotificationSource& source, | 26 const content::NotificationSource& source, |
25 const content::NotificationDetails& details) { | 27 const content::NotificationDetails& details) { |
26 TestNotificationTracker::Observe(type, source, details); | 28 TestNotificationTracker::Observe(type, source, details); |
27 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { | 29 if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) { |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 451 |
450 *CommandLine::ForCurrentProcess() = original_cl; | 452 *CommandLine::ForCurrentProcess() = original_cl; |
451 } | 453 } |
452 }; | 454 }; |
453 | 455 |
454 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { | 456 TEST_F(TokenServiceCommandLineTest, TestValueOverride) { |
455 EXPECT_TRUE(service_.HasTokenForService("my_service")); | 457 EXPECT_TRUE(service_.HasTokenForService("my_service")); |
456 EXPECT_EQ("my_value", service_.GetTokenForService("my_service")); | 458 EXPECT_EQ("my_value", service_.GetTokenForService("my_service")); |
457 } | 459 } |
458 #endif // ifndef NDEBUG | 460 #endif // ifndef NDEBUG |
OLD | NEW |