OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 14 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
14 | 15 |
15 // Helper class to simplify writing unittests that depend on an instance of | 16 // Helper class to simplify writing unittests that depend on an instance of |
16 // ProfileOAuth2TokenService. | 17 // ProfileOAuth2TokenService. |
17 // | 18 // |
18 // Tests would typically do something like the following: | 19 // Tests would typically do something like the following: |
19 // | 20 // |
20 // FakeProfileOAuth2TokenService service; | 21 // FakeProfileOAuth2TokenService service; |
21 // ... | 22 // ... |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // |FetchOAuth2Token| on the current run loop. There is no need to call | 112 // |FetchOAuth2Token| on the current run loop. There is no need to call |
112 // |IssueTokenForScope| in this case. | 113 // |IssueTokenForScope| in this case. |
113 bool auto_post_fetch_response_on_message_loop_; | 114 bool auto_post_fetch_response_on_message_loop_; |
114 | 115 |
115 base::WeakPtrFactory<FakeProfileOAuth2TokenService> weak_ptr_factory_; | 116 base::WeakPtrFactory<FakeProfileOAuth2TokenService> weak_ptr_factory_; |
116 | 117 |
117 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); | 118 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); |
118 }; | 119 }; |
119 | 120 |
120 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 121 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
OLD | NEW |