| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |