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 | |
201 first_setup_in_progress_(false) {} | 200 first_setup_in_progress_(false) {} |
202 | 201 |
203 bool first_setup_in_progress_; | 202 bool first_setup_in_progress_; |
204 }; | 203 }; |
205 | 204 |
206 } // namespace | 205 } // namespace |
207 | 206 |
208 class OneClickSigninHelperTest : public ChromeRenderViewHostTestHarness { | 207 class OneClickSigninHelperTest : public ChromeRenderViewHostTestHarness { |
209 public: | 208 public: |
210 OneClickSigninHelperTest(); | 209 OneClickSigninHelperTest(); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); | 891 prefs::kSigninAllowed, base::Value::CreateBooleanValue(true)); |
893 | 892 |
894 // Simulate a policy disabling sync by writing kSyncManaged directly. | 893 // Simulate a policy disabling sync by writing kSyncManaged directly. |
895 // We should still offer to sign in the browser. | 894 // We should still offer to sign in the browser. |
896 profile()->GetTestingPrefService()->SetManagedPref( | 895 profile()->GetTestingPrefService()->SetManagedPref( |
897 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); | 896 prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); |
898 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, | 897 EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, |
899 OneClickSigninHelper::CanOfferOnIOThreadImpl( | 898 OneClickSigninHelper::CanOfferOnIOThreadImpl( |
900 valid_gaia_url_, std::string(), &request_, io_data.get())); | 899 valid_gaia_url_, std::string(), &request_, io_data.get())); |
901 } | 900 } |
OLD | NEW |