Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: components/metrics/persisted_logs_unittest.cc

Issue 1564773002: Move components/compression to third_party/zlib/google (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another #include... Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/metrics/persisted_logs.cc ('k') | components/variations.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 7 #include <stddef.h>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/prefs/pref_registry_simple.h" 11 #include "base/prefs/pref_registry_simple.h"
12 #include "base/prefs/scoped_user_pref_update.h" 12 #include "base/prefs/scoped_user_pref_update.h"
13 #include "base/prefs/testing_pref_service.h" 13 #include "base/prefs/testing_pref_service.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "base/sha1.h" 15 #include "base/sha1.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "components/compression/compression_utils.h"
18 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/zlib/google/compression_utils.h"
19 19
20 namespace metrics { 20 namespace metrics {
21 21
22 namespace { 22 namespace {
23 23
24 const char kTestPrefName[] = "TestPref"; 24 const char kTestPrefName[] = "TestPref";
25 const size_t kLogCountLimit = 3; 25 const size_t kLogCountLimit = 3;
26 const size_t kLogByteLimit = 1000; 26 const size_t kLogByteLimit = 1000;
27 27
28 // Compresses |log_data| and returns the result. 28 // Compresses |log_data| and returns the result.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 TestPersistedLogs persisted_logs(&prefs_, kLogByteLimit); 281 TestPersistedLogs persisted_logs(&prefs_, kLogByteLimit);
282 persisted_logs.StoreLog(kFooText); 282 persisted_logs.StoreLog(kFooText);
283 persisted_logs.StageLog(); 283 persisted_logs.StageLog();
284 284
285 EXPECT_EQ(Compress(kFooText), persisted_logs.staged_log()); 285 EXPECT_EQ(Compress(kFooText), persisted_logs.staged_log());
286 EXPECT_EQ(foo_hash, persisted_logs.staged_log_hash()); 286 EXPECT_EQ(foo_hash, persisted_logs.staged_log_hash());
287 } 287 }
288 288
289 } // namespace metrics 289 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/persisted_logs.cc ('k') | components/variations.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698