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

Side by Side Diff: chrome/browser/extensions/app_notify_channel_setup_unittest.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years, 12 months 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/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 class AppNotifyChannelSetupTest : public testing::Test { 175 class AppNotifyChannelSetupTest : public testing::Test {
176 public: 176 public:
177 AppNotifyChannelSetupTest() : ui_thread_(BrowserThread::UI, &message_loop_), 177 AppNotifyChannelSetupTest() : ui_thread_(BrowserThread::UI, &message_loop_),
178 db_thread_(BrowserThread::DB), 178 db_thread_(BrowserThread::DB),
179 ui_(new TestUI()) { 179 ui_(new TestUI()) {
180 } 180 }
181 181
182 virtual ~AppNotifyChannelSetupTest() {} 182 virtual ~AppNotifyChannelSetupTest() {}
183 183
184 virtual void SetLoggedInUser(const std::string username) { 184 virtual void SetLoggedInUser(const std::string username) {
185 TestingPrefService* prefs = profile_.GetTestingPrefService(); 185 StringValue value(username);
186 prefs->SetUserPref(prefs::kGoogleServicesUsername, 186 profile_.GetPrefs()->Set(prefs::kGoogleServicesUsername, value);
Mattias Nissler (ping if slow) 2012/12/21 13:09:31 Also, you could just use SetString() :)
Jói 2012/12/21 14:34:13 Done.
187 new StringValue(username));
188 } 187 }
189 188
190 virtual AppNotifyChannelSetup* CreateInstance() { 189 virtual AppNotifyChannelSetup* CreateInstance() {
191 GURL page_url("http://www.google.com"); 190 GURL page_url("http://www.google.com");
192 return new AppNotifyChannelSetup(&profile_, 191 return new AppNotifyChannelSetup(&profile_,
193 kFakeExtensionId, 192 kFakeExtensionId,
194 "1234", 193 "1234",
195 page_url, 194 page_url,
196 kRouteId, 195 kRouteId,
197 kCallbackId, 196 kCallbackId,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 SetupLogin(true, true); 312 SetupLogin(true, true);
314 SetupFetchAccessToken(true); 313 SetupFetchAccessToken(true);
315 SetupRecordGrant(true); 314 SetupRecordGrant(true);
316 SetupGetChannelId(true); 315 SetupGetChannelId(true);
317 316
318 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); 317 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance();
319 RunServerTest(setup, "dummy_do_not_use", ""); 318 RunServerTest(setup, "dummy_do_not_use", "");
320 } 319 }
321 320
322 } // namespace extensions 321 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698