OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROXIMITY_AUTH_FAKE_CRYPTAUTH_FAKE_CRYPTAUTH_GCM_MANAGER_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_FAKE_CRYPTAUTH_FAKE_CRYPTAUTH_GCM_MANAGER_H |
6 #define COMPONENTS_PROXIMITY_AUTH_FAKE_CRYPTAUTH_FAKE_CRYPTAUTH_GCM_MANAGER_H | 6 #define COMPONENTS_PROXIMITY_AUTH_FAKE_CRYPTAUTH_FAKE_CRYPTAUTH_GCM_MANAGER_H |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "components/proximity_auth/cryptauth/cryptauth_gcm_manager.h" | 10 #include "components/cryptauth/cryptauth_gcm_manager.h" |
11 | 11 |
12 namespace proximity_auth { | 12 namespace cryptauth { |
13 | 13 |
14 // CryptAuthGCMManager implementation for testing purposes. | 14 // CryptAuthGCMManager implementation for testing purposes. |
15 class FakeCryptAuthGCMManager : public CryptAuthGCMManager { | 15 class FakeCryptAuthGCMManager : public CryptAuthGCMManager { |
16 public: | 16 public: |
17 // Creates the instance: | 17 // Creates the instance: |
18 // |registration_id|: The GCM registration id from a previous successful | 18 // |registration_id|: The GCM registration id from a previous successful |
19 // enrollment. Pass in an empty |registration_id| to simulate never having | 19 // enrollment. Pass in an empty |registration_id| to simulate never having |
20 // registered successfully. | 20 // registered successfully. |
21 explicit FakeCryptAuthGCMManager(const std::string& registration_id); | 21 explicit FakeCryptAuthGCMManager(const std::string& registration_id); |
22 | 22 |
(...skipping 29 matching lines...) Expand all Loading... |
52 bool registration_in_progress_; | 52 bool registration_in_progress_; |
53 | 53 |
54 // The registration id obtained from the last successful registration. | 54 // The registration id obtained from the last successful registration. |
55 std::string registration_id_; | 55 std::string registration_id_; |
56 | 56 |
57 base::ObserverList<Observer> observers_; | 57 base::ObserverList<Observer> observers_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthGCMManager); | 59 DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthGCMManager); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace proximity_auth | 62 } // namespace cryptauth |
63 | 63 |
64 #endif // COMPONENTS_PROXIMITY_FAKE_CRYPTAUTH_FAKE_CRYPTAUTH_GCM_MANAGER_H | 64 #endif // COMPONENTS_PROXIMITY_FAKE_CRYPTAUTH_FAKE_CRYPTAUTH_GCM_MANAGER_H |
OLD | NEW |