| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/metrics/persisted_logs.h" | 5 #include "components/metrics/persisted_logs.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/macros.h" |
| 8 #include "base/prefs/pref_registry_simple.h" | 11 #include "base/prefs/pref_registry_simple.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 12 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/prefs/testing_pref_service.h" | 13 #include "base/prefs/testing_pref_service.h" |
| 11 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
| 12 #include "base/sha1.h" | 15 #include "base/sha1.h" |
| 13 #include "base/values.h" | 16 #include "base/values.h" |
| 14 #include "components/compression/compression_utils.h" | 17 #include "components/compression/compression_utils.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 19 |
| 17 namespace metrics { | 20 namespace metrics { |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 280 |
| 278 TestPersistedLogs persisted_logs(&prefs_, kLogByteLimit); | 281 TestPersistedLogs persisted_logs(&prefs_, kLogByteLimit); |
| 279 persisted_logs.StoreLog(kFooText); | 282 persisted_logs.StoreLog(kFooText); |
| 280 persisted_logs.StageLog(); | 283 persisted_logs.StageLog(); |
| 281 | 284 |
| 282 EXPECT_EQ(Compress(kFooText), persisted_logs.staged_log()); | 285 EXPECT_EQ(Compress(kFooText), persisted_logs.staged_log()); |
| 283 EXPECT_EQ(foo_hash, persisted_logs.staged_log_hash()); | 286 EXPECT_EQ(foo_hash, persisted_logs.staged_log_hash()); |
| 284 } | 287 } |
| 285 | 288 |
| 286 } // namespace metrics | 289 } // namespace metrics |
| OLD | NEW |