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

Side by Side Diff: components/variations/caching_permuted_entropy_provider_unittest.cc

Issue 1651203002: Update components for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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/variations/caching_permuted_entropy_provider.h" 5 #include "components/variations/caching_permuted_entropy_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/prefs/testing_pref_service.h" 12 #include "components/prefs/testing_pref_service.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace metrics { 15 namespace metrics {
16 16
17 // Size of the low entropy source to use for the permuted entropy provider 17 // Size of the low entropy source to use for the permuted entropy provider
18 // in tests. 18 // in tests.
19 const size_t kMaxLowEntropySize = 8000; 19 const size_t kMaxLowEntropySize = 8000;
20 20
21 // Field trial names used in unit tests. 21 // Field trial names used in unit tests.
22 const char* const kTestTrialNames[] = {"TestTrial", "AnotherTestTrial", 22 const char* const kTestTrialNames[] = {"TestTrial", "AnotherTestTrial",
(...skipping 22 matching lines...) Expand all
45 &prefs, kEntropyValue, kMaxLowEntropySize); 45 &prefs, kEntropyValue, kMaxLowEntropySize);
46 for (size_t i = 0; i < 2 * arraysize(kTestTrialNames); ++i) { 46 for (size_t i = 0; i < 2 * arraysize(kTestTrialNames); ++i) {
47 const std::string trial_name = 47 const std::string trial_name =
48 kTestTrialNames[i % arraysize(kTestTrialNames)]; 48 kTestTrialNames[i % arraysize(kTestTrialNames)];
49 EXPECT_DOUBLE_EQ(provider.GetEntropyForTrial(trial_name, 0), 49 EXPECT_DOUBLE_EQ(provider.GetEntropyForTrial(trial_name, 0),
50 cached_provider.GetEntropyForTrial(trial_name, 0)); 50 cached_provider.GetEntropyForTrial(trial_name, 0));
51 } 51 }
52 } 52 }
53 53
54 } // namespace metrics 54 } // namespace metrics
OLDNEW
« no previous file with comments | « components/variations/caching_permuted_entropy_provider.cc ('k') | components/variations/service/variations_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698