| 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/prefs/scoped_user_pref_update.h" | 6 #include "base/prefs/scoped_user_pref_update.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/content_settings/cookie_settings.h" | 10 #include "chrome/browser/content_settings/cookie_settings.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 first_setup_in_progress_ = in_progress; | 173 first_setup_in_progress_ = in_progress; |
| 174 } | 174 } |
| 175 | 175 |
| 176 private: | 176 private: |
| 177 explicit OneClickTestProfileSyncService(Profile* profile) | 177 explicit OneClickTestProfileSyncService(Profile* profile) |
| 178 : TestProfileSyncService( | 178 : TestProfileSyncService( |
| 179 NULL, | 179 NULL, |
| 180 profile, | 180 profile, |
| 181 SigninManagerFactory::GetForProfile(profile), | 181 SigninManagerFactory::GetForProfile(profile), |
| 182 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 182 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 183 ProfileSyncService::MANUAL_START), | 183 browser_sync::MANUAL_START), |
| 184 first_setup_in_progress_(false) {} | 184 first_setup_in_progress_(false) {} |
| 185 | 185 |
| 186 bool first_setup_in_progress_; | 186 bool first_setup_in_progress_; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace | 189 } // namespace |
| 190 | 190 |
| 191 class OneClickSigninHelperTest : public ChromeRenderViewHostTestHarness { | 191 class OneClickSigninHelperTest : public ChromeRenderViewHostTestHarness { |
| 192 public: | 192 public: |
| 193 OneClickSigninHelperTest(); | 193 OneClickSigninHelperTest(); |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); | 839 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); |
| 840 | 840 |
| 841 // Simulate a policy disabling sync by writing kSyncManaged directly. | 841 // Simulate a policy disabling sync by writing kSyncManaged directly. |
| 842 // We should still offer to sign in the browser. | 842 // We should still offer to sign in the browser. |
| 843 profile()->GetTestingPrefService()->SetManagedPref( | 843 profile()->GetTestingPrefService()->SetManagedPref( |
| 844 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); | 844 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); |
| 845 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, | 845 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, |
| 846 OneClickSigninHelper::CanOfferOnIOThreadImpl( | 846 OneClickSigninHelper::CanOfferOnIOThreadImpl( |
| 847 valid_gaia_url_, &request_, io_data.get())); | 847 valid_gaia_url_, &request_, io_data.get())); |
| 848 } | 848 } |
| OLD | NEW |