Commit 3ccd5b9b authored by Aga Wronska's avatar Aga Wronska Committed by Commit Bot

Remove consumer user reporting.

Change-Id: I361f46b8e27fca1813f004d542c6060ee255def6
Reviewed-on: https://chromium-review.googlesource.com/1060460Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Aga Wronska <agawronska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558870}
parent cab54658
......@@ -68,11 +68,6 @@ const char kUMAInitialFetchOAuth2Error[] =
"Enterprise.UserPolicyChromeOS.InitialFetch.OAuth2Error";
const char kUMAInitialFetchOAuth2NetworkError[] =
"Enterprise.UserPolicyChromeOS.InitialFetch.OAuth2NetworkError";
// Default frequency for uploading non-enterprise status reports.
constexpr base::TimeDelta kDeviceStatusUploadFrequency =
base::TimeDelta::FromMinutes(10);
} // namespace
UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS(
......@@ -204,25 +199,6 @@ void UserCloudPolicyManagerChromeOS::Connect(
app_install_event_log_uploader_ =
std::make_unique<AppInstallEventLogUploader>(client());
// If non-enterprise device is registered with DMServer and has User Policy
// applied, it should upload device status to the server. For devices in
// enterprise mode status upload is controlled by
// DeviceCloudPolicyManagerChromeOS.
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
if (connector->GetDeviceMode() == DEVICE_MODE_CONSUMER) {
status_uploader_.reset(new StatusUploader(
client(),
std::make_unique<DeviceStatusCollector>(
local_state_, chromeos::system::StatisticsProvider::GetInstance(),
DeviceStatusCollector::VolumeInfoFetcher(),
DeviceStatusCollector::CPUStatisticsFetcher(),
DeviceStatusCollector::CPUTempFetcher(),
DeviceStatusCollector::AndroidStatusFetcher(),
false /* is_enterprise_device */),
task_runner_, kDeviceStatusUploadFrequency));
}
}
void UserCloudPolicyManagerChromeOS::OnAccessTokenAvailable(
......
......@@ -799,57 +799,4 @@ TEST_F(UserCloudPolicyManagerChromeOSTest, TestHasAppInstallEventLogUploader) {
EXPECT_TRUE(manager_->GetAppInstallEventLogUploader());
}
// Tests uploading status to DMServer. Install attributes for testing need to be
// set before BrowserPolicyConnectorChromeOS is created, therefore
// initialization of test environment is done at the begining of the test
// instead of SetUp method.
class StatusUploadingTest : public UserCloudPolicyManagerChromeOSTest {
protected:
StatusUploadingTest() = default;
~StatusUploadingTest() override = default;
void SetUp() override{};
void TearDown() override{};
private:
DISALLOW_COPY_AND_ASSIGN(StatusUploadingTest);
};
TEST_F(StatusUploadingTest, UnownedDeviceShouldNotUploadStatus) {
auto install_attributes =
chromeos::ScopedStubInstallAttributes::CreateUnset();
UserCloudPolicyManagerChromeOSTest::SetUp();
ASSERT_NO_FATAL_FAILURE(MakeManagerWithPreloadedStore(base::TimeDelta()));
EXPECT_TRUE(manager_->core()->client()->is_registered());
EXPECT_EQ(nullptr, manager_->GetStatusUploader());
UserCloudPolicyManagerChromeOSTest::TearDown();
}
TEST_F(StatusUploadingTest, ManagedDeviceShouldNotUploadStatus) {
auto install_attributes =
chromeos::ScopedStubInstallAttributes::CreateCloudManaged("domain.com",
"device-id");
UserCloudPolicyManagerChromeOSTest::SetUp();
ASSERT_NO_FATAL_FAILURE(MakeManagerWithPreloadedStore(base::TimeDelta()));
EXPECT_TRUE(manager_->core()->client()->is_registered());
EXPECT_EQ(nullptr, manager_->GetStatusUploader());
UserCloudPolicyManagerChromeOSTest::TearDown();
}
TEST_F(StatusUploadingTest, RegisteredConsumerDeviceShouldUploadStatus) {
auto install_attributes =
chromeos::ScopedStubInstallAttributes::CreateConsumerOwned();
UserCloudPolicyManagerChromeOSTest::SetUp();
ASSERT_NO_FATAL_FAILURE(MakeManagerWithPreloadedStore(base::TimeDelta()));
EXPECT_TRUE(manager_->core()->client()->is_registered());
EXPECT_NE(nullptr, manager_->GetStatusUploader());
UserCloudPolicyManagerChromeOSTest::TearDown();
}
} // namespace policy
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment