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

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

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 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 "chrome/browser/extensions/app_notify_channel_setup.h" 10 #include "chrome/browser/extensions/app_notify_channel_setup.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 const std::string& GetOAuth2LoginRefreshToken() const OVERRIDE { 51 const std::string& GetOAuth2LoginRefreshToken() const OVERRIDE {
52 return mockToken_; 52 return mockToken_;
53 } 53 }
54 54
55 std::string mockToken_; 55 std::string mockToken_;
56 56
57 MOCK_CONST_METHOD0(HasOAuthLoginToken, bool()); 57 MOCK_CONST_METHOD0(HasOAuthLoginToken, bool());
58 }; 58 };
59 59
60 ProfileKeyedBase* BuildMockTokenService(Profile* profile) { 60 ProfileKeyedService* BuildMockTokenService(Profile* profile) {
61 return new MockTokenService; 61 return new MockTokenService;
62 } 62 }
63 63
64 MockTokenService* BuildForProfile(Profile* profile) { 64 MockTokenService* BuildForProfile(Profile* profile) {
65 return static_cast<MockTokenService*>( 65 return static_cast<MockTokenService*>(
66 TokenServiceFactory::GetInstance()->SetTestingFactoryAndUse( 66 TokenServiceFactory::GetInstance()->SetTestingFactoryAndUse(
67 profile, BuildMockTokenService)); 67 profile, BuildMockTokenService));
68 } 68 }
69 69
70 class TestProfile : public TestingProfile { 70 class TestProfile : public TestingProfile {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 SetupLogin(false, true); 292 SetupLogin(false, true);
293 SetupFetchAccessToken(false); 293 SetupFetchAccessToken(false);
294 SetupLogin(true, true); 294 SetupLogin(true, true);
295 SetupFetchAccessToken(true); 295 SetupFetchAccessToken(true);
296 SetupRecordGrant(true); 296 SetupRecordGrant(true);
297 SetupGetChannelId(true); 297 SetupGetChannelId(true);
298 298
299 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); 299 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance();
300 RunServerTest(setup, "dummy_do_not_use", ""); 300 RunServerTest(setup, "dummy_do_not_use", "");
301 } 301 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698