| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/sync/device_info/device_count_metrics_provider.h" | 5 #include "components/sync/device_info/device_count_metrics_provider.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class FakeTracker : public DeviceInfoTracker { | 21 class FakeTracker : public DeviceInfoTracker { |
| 22 public: | 22 public: |
| 23 explicit FakeTracker(const int count) : count_(count) {} | 23 explicit FakeTracker(const int count) : count_(count) {} |
| 24 | 24 |
| 25 // DeviceInfoTracker | 25 // DeviceInfoTracker |
| 26 bool IsSyncing() const override { return false; } | 26 bool IsSyncing() const override { return false; } |
| 27 std::unique_ptr<DeviceInfo> GetDeviceInfo( | 27 std::unique_ptr<DeviceInfo> GetDeviceInfo( |
| 28 const std::string& client_id) const override { | 28 const std::string& client_id) const override { |
| 29 return std::unique_ptr<DeviceInfo>(); | 29 return std::unique_ptr<DeviceInfo>(); |
| 30 } | 30 } |
| 31 ScopedVector<DeviceInfo> GetAllDeviceInfo() const override { | 31 std::vector<std::unique_ptr<DeviceInfo>> GetAllDeviceInfo() const override { |
| 32 return ScopedVector<DeviceInfo>(); | 32 return std::vector<std::unique_ptr<DeviceInfo>>(); |
| 33 } | 33 } |
| 34 void AddObserver(Observer* observer) override {} | 34 void AddObserver(Observer* observer) override {} |
| 35 void RemoveObserver(Observer* observer) override {} | 35 void RemoveObserver(Observer* observer) override {} |
| 36 int CountActiveDevices() const override { return count_; } | 36 int CountActiveDevices() const override { return count_; } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 int count_; | 39 int count_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 TEST_F(DeviceCountMetricsProviderTest, VeryLarge) { | 97 TEST_F(DeviceCountMetricsProviderTest, VeryLarge) { |
| 98 AddTracker(123456789); | 98 AddTracker(123456789); |
| 99 TestProvider(100); | 99 TestProvider(100); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace | 102 } // namespace |
| 103 | 103 |
| 104 } // namespace sync_driver | 104 } // namespace sync_driver |
| OLD | NEW |