| 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 #include "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/content_settings/cookie_settings.h" | 8 #include "chrome/browser/content_settings/cookie_settings.h" |
| 9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 10 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 10 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // or drive. In former case, with a valid URL, we don't want to offer the | 48 // or drive. In former case, with a valid URL, we don't want to offer the |
| 49 // interstitial. In all other cases we do. | 49 // interstitial. In all other cases we do. |
| 50 | 50 |
| 51 const char kImplicitURLString[] = | 51 const char kImplicitURLString[] = |
| 52 "https://accounts.google.com/ServiceLogin" | 52 "https://accounts.google.com/ServiceLogin" |
| 53 "?service=foo&continue=http://foo.google.com"; | 53 "?service=foo&continue=http://foo.google.com"; |
| 54 | 54 |
| 55 class SigninManagerMock : public FakeSigninManager { | 55 class SigninManagerMock : public FakeSigninManager { |
| 56 public: | 56 public: |
| 57 explicit SigninManagerMock(Profile* profile) : FakeSigninManager(profile) { | 57 explicit SigninManagerMock(Profile* profile) : FakeSigninManager(profile) { |
| 58 Initialize(profile); | 58 Initialize(profile, NULL); |
| 59 } | 59 } |
| 60 MOCK_CONST_METHOD1(IsAllowedUsername, bool(const std::string& username)); | 60 MOCK_CONST_METHOD1(IsAllowedUsername, bool(const std::string& username)); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class TestProfileIOData : public ProfileIOData { | 63 class TestProfileIOData : public ProfileIOData { |
| 64 public: | 64 public: |
| 65 TestProfileIOData(bool is_incognito, PrefService* pref_service, | 65 TestProfileIOData(bool is_incognito, PrefService* pref_service, |
| 66 PrefService* local_state, CookieSettings* cookie_settings) | 66 PrefService* local_state, CookieSettings* cookie_settings) |
| 67 : ProfileIOData(is_incognito) { | 67 : ProfileIOData(is_incognito) { |
| 68 // Initialize the IO members required for these tests, but keep them on | 68 // Initialize the IO members required for these tests, but keep them on |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); | 834 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); |
| 835 | 835 |
| 836 // Simulate a policy disabling sync by writing kSyncManaged directly. | 836 // Simulate a policy disabling sync by writing kSyncManaged directly. |
| 837 // We should still offer to sign in the browser. | 837 // We should still offer to sign in the browser. |
| 838 profile_->GetTestingPrefService()->SetManagedPref( | 838 profile_->GetTestingPrefService()->SetManagedPref( |
| 839 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); | 839 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); |
| 840 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, | 840 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, |
| 841 OneClickSigninHelper::CanOfferOnIOThreadImpl( | 841 OneClickSigninHelper::CanOfferOnIOThreadImpl( |
| 842 valid_gaia_url_, std::string(), &request_, io_data.get())); | 842 valid_gaia_url_, std::string(), &request_, io_data.get())); |
| 843 } | 843 } |
| OLD | NEW |