Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc

Issue 11316163: Remove the last usages of PrefObserver outside of Prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/content_settings/cookie_settings.h" 7 #include "chrome/browser/content_settings/cookie_settings.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/prefs/scoped_user_pref_update.h" 9 #include "chrome/browser/prefs/scoped_user_pref_update.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }; 56 };
57 57
58 class TestProfileIOData : public ProfileIOData { 58 class TestProfileIOData : public ProfileIOData {
59 public: 59 public:
60 TestProfileIOData(bool is_incognito, PrefService* pref_service, 60 TestProfileIOData(bool is_incognito, PrefService* pref_service,
61 PrefService* local_state, CookieSettings* cookie_settings) 61 PrefService* local_state, CookieSettings* cookie_settings)
62 : ProfileIOData(is_incognito) { 62 : ProfileIOData(is_incognito) {
63 // Initialize the IO members required for these tests, but keep them on 63 // Initialize the IO members required for these tests, but keep them on
64 // this thread since we don't use a background thread here. 64 // this thread since we don't use a background thread here.
65 google_services_username()->Init(prefs::kGoogleServicesUsername, 65 google_services_username()->Init(prefs::kGoogleServicesUsername,
66 pref_service, NULL); 66 pref_service);
67 reverse_autologin_enabled()->Init(prefs::kReverseAutologinEnabled, 67 reverse_autologin_enabled()->Init(prefs::kReverseAutologinEnabled,
68 pref_service, NULL); 68 pref_service);
69 one_click_signin_rejected_email_list()->Init( 69 one_click_signin_rejected_email_list()->Init(
70 prefs::kReverseAutologinRejectedEmailList, pref_service, NULL); 70 prefs::kReverseAutologinRejectedEmailList, pref_service);
71 71
72 google_services_username_pattern()->Init( 72 google_services_username_pattern()->Init(
73 prefs::kGoogleServicesUsernamePattern, local_state, NULL); 73 prefs::kGoogleServicesUsernamePattern, local_state);
74 74
75 set_signin_names_for_testing(new SigninNamesOnIOThread()); 75 set_signin_names_for_testing(new SigninNamesOnIOThread());
76 SetCookieSettingsForTesting(cookie_settings); 76 SetCookieSettingsForTesting(cookie_settings);
77 } 77 }
78 78
79 virtual ~TestProfileIOData() { 79 virtual ~TestProfileIOData() {
80 signin_names()->ReleaseResourcesOnUIThread(); 80 signin_names()->ReleaseResourcesOnUIThread();
81 } 81 }
82 82
83 // ProfileIOData overrides: 83 // ProfileIOData overrides:
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 valid_gaia_url_, "", &request_, io_data.get())); 555 valid_gaia_url_, "", &request_, io_data.get()));
556 } 556 }
557 557
558 TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) { 558 TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) {
559 AllowSigninCookies(false); 559 AllowSigninCookies(false);
560 scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); 560 scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false));
561 EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, 561 EXPECT_EQ(OneClickSigninHelper::DONT_OFFER,
562 OneClickSigninHelper::CanOfferOnIOThreadImpl( 562 OneClickSigninHelper::CanOfferOnIOThreadImpl(
563 valid_gaia_url_, "", &request_, io_data.get())); 563 valid_gaia_url_, "", &request_, io_data.get()));
564 } 564 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698