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

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: Merge to head again, previous had unrelated broken win_rel test. 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/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 profile_.GetPrefs()->SetString(prefs::kGoogleServicesUsername, username);
186 prefs->SetUserPref(prefs::kGoogleServicesUsername,
187 new StringValue(username));
188 } 186 }
189 187
190 virtual AppNotifyChannelSetup* CreateInstance() { 188 virtual AppNotifyChannelSetup* CreateInstance() {
191 GURL page_url("http://www.google.com"); 189 GURL page_url("http://www.google.com");
192 return new AppNotifyChannelSetup(&profile_, 190 return new AppNotifyChannelSetup(&profile_,
193 kFakeExtensionId, 191 kFakeExtensionId,
194 "1234", 192 "1234",
195 page_url, 193 page_url,
196 kRouteId, 194 kRouteId,
197 kCallbackId, 195 kCallbackId,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 SetupLogin(true, true); 311 SetupLogin(true, true);
314 SetupFetchAccessToken(true); 312 SetupFetchAccessToken(true);
315 SetupRecordGrant(true); 313 SetupRecordGrant(true);
316 SetupGetChannelId(true); 314 SetupGetChannelId(true);
317 315
318 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); 316 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance();
319 RunServerTest(setup, "dummy_do_not_use", ""); 317 RunServerTest(setup, "dummy_do_not_use", "");
320 } 318 }
321 319
322 } // namespace extensions 320 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_test.cc ('k') | chrome/browser/extensions/component_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698