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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Override ProfileSyncService::Shutdown() to avoid CHECK on | 189 // Override ProfileSyncService::Shutdown() to avoid CHECK on |
190 // |invalidator_registrar_|. | 190 // |invalidator_registrar_|. |
191 virtual void Shutdown() OVERRIDE {}; | 191 virtual void Shutdown() OVERRIDE {}; |
192 | 192 |
193 private: | 193 private: |
194 explicit OneClickTestProfileSyncService(Profile* profile) | 194 explicit OneClickTestProfileSyncService(Profile* profile) |
195 : TestProfileSyncService(NULL, | 195 : TestProfileSyncService(NULL, |
196 profile, | 196 profile, |
197 NULL, | 197 NULL, |
198 NULL, | 198 NULL, |
199 ProfileSyncService::MANUAL_START), | 199 ProfileSyncService::MANUAL_START, |
| 200 false), // synchronous_backend_init |
200 first_setup_in_progress_(false) {} | 201 first_setup_in_progress_(false) {} |
201 | 202 |
202 bool first_setup_in_progress_; | 203 bool first_setup_in_progress_; |
203 }; | 204 }; |
204 | 205 |
205 } // namespace | 206 } // namespace |
206 | 207 |
207 class OneClickSigninHelperTest : public ChromeRenderViewHostTestHarness { | 208 class OneClickSigninHelperTest : public ChromeRenderViewHostTestHarness { |
208 public: | 209 public: |
209 OneClickSigninHelperTest(); | 210 OneClickSigninHelperTest(); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); | 892 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); |
892 | 893 |
893 // Simulate a policy disabling sync by writing kSyncManaged directly. | 894 // Simulate a policy disabling sync by writing kSyncManaged directly. |
894 // We should still offer to sign in the browser. | 895 // We should still offer to sign in the browser. |
895 profile()->GetTestingPrefService()->SetManagedPref( | 896 profile()->GetTestingPrefService()->SetManagedPref( |
896 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); | 897 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); |
897 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, | 898 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, |
898 OneClickSigninHelper::CanOfferOnIOThreadImpl( | 899 OneClickSigninHelper::CanOfferOnIOThreadImpl( |
899 valid_gaia_url_, std::string(), &request_, io_data.get())); | 900 valid_gaia_url_, std::string(), &request_, io_data.get())); |
900 } | 901 } |
OLD | NEW |