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

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_initializer_unittest.cc

Issue 2371213002: Refactor: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. (Closed)
Patch Set: Address Maksim's comments. Created 4 years, 2 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 "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/policy/enrollment_config.h" 10 #include "chrome/browser/chromeos/policy/enrollment_config.h"
(...skipping 29 matching lines...) Expand all
40 DeviceCloudPolicyInitializerTest() 40 DeviceCloudPolicyInitializerTest()
41 : device_cloud_policy_initializer_( 41 : device_cloud_policy_initializer_(
42 &local_state_, 42 &local_state_,
43 nullptr, 43 nullptr,
44 nullptr, 44 nullptr,
45 &install_attributes_, 45 &install_attributes_,
46 nullptr, 46 nullptr,
47 nullptr, 47 nullptr,
48 nullptr, 48 nullptr,
49 nullptr, 49 nullptr,
50 base::MakeUnique<chromeos::attestation::MockAttestationFlow>()) { 50 base::MakeUnique<chromeos::attestation::MockAttestationFlow>(),
51 &statistics_provider_) {
51 chrome::RegisterLocalState(local_state_.registry()); 52 chrome::RegisterLocalState(local_state_.registry());
52 statistics_provider_.SetMachineStatistic("serial_number", "fake-serial"); 53 statistics_provider_.SetMachineStatistic(
54 chromeos::system::kSerialNumberKey, "fake-serial");
55 statistics_provider_.SetMachineStatistic(
56 chromeos::system::kHardwareClassKey, "fake-hardware");
53 } 57 }
54 58
55 void SetupZeroTouchFlag(); 59 void SetupZeroTouchFlag();
56 60
57 chromeos::system::ScopedFakeStatisticsProvider statistics_provider_; 61 chromeos::system::ScopedFakeStatisticsProvider statistics_provider_;
58 TestingPrefServiceSimple local_state_; 62 TestingPrefServiceSimple local_state_;
59 chromeos::StubInstallAttributes install_attributes_; 63 chromeos::StubInstallAttributes install_attributes_;
60 DeviceCloudPolicyInitializer device_cloud_policy_initializer_; 64 DeviceCloudPolicyInitializer device_cloud_policy_initializer_;
61 }; 65 };
62 66
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE, 194 EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE,
191 EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE), 195 EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE),
192 ZeroTouchParam("", // Flag set without a set value. 196 ZeroTouchParam("", // Flag set without a set value.
193 EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE, 197 EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE,
194 EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE), 198 EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE),
195 ZeroTouchParam("forced", 199 ZeroTouchParam("forced",
196 EnrollmentConfig::AUTH_MECHANISM_ATTESTATION, 200 EnrollmentConfig::AUTH_MECHANISM_ATTESTATION,
197 EnrollmentConfig::AUTH_MECHANISM_ATTESTATION))); 201 EnrollmentConfig::AUTH_MECHANISM_ATTESTATION)));
198 202
199 } // namespace policy 203 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698