Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_status_collector.h" | 5 #include "chrome/browser/chromeos/policy/device_status_collector.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 #include "chromeos/network/network_state.h" | 49 #include "chromeos/network/network_state.h" |
| 50 #include "chromeos/network/network_state_handler.h" | 50 #include "chromeos/network/network_state_handler.h" |
| 51 #include "chromeos/settings/cros_settings_names.h" | 51 #include "chromeos/settings/cros_settings_names.h" |
| 52 #include "chromeos/system/fake_statistics_provider.h" | 52 #include "chromeos/system/fake_statistics_provider.h" |
| 53 #include "components/policy/proto/device_management_backend.pb.h" | 53 #include "components/policy/proto/device_management_backend.pb.h" |
| 54 #include "components/prefs/pref_service.h" | 54 #include "components/prefs/pref_service.h" |
| 55 #include "components/prefs/testing_pref_service.h" | 55 #include "components/prefs/testing_pref_service.h" |
| 56 #include "content/public/browser/browser_thread.h" | 56 #include "content/public/browser/browser_thread.h" |
| 57 #include "content/public/test/test_browser_thread.h" | 57 #include "content/public/test/test_browser_thread.h" |
| 58 #include "content/public/test/test_utils.h" | 58 #include "content/public/test/test_utils.h" |
| 59 #include "mojo/public/cpp/bindings/string.h" | |
| 60 #include "storage/browser/fileapi/external_mount_points.h" | 59 #include "storage/browser/fileapi/external_mount_points.h" |
| 61 #include "storage/browser/fileapi/mount_points.h" | 60 #include "storage/browser/fileapi/mount_points.h" |
| 62 #include "storage/common/fileapi/file_system_mount_option.h" | 61 #include "storage/common/fileapi/file_system_mount_option.h" |
| 63 #include "storage/common/fileapi/file_system_types.h" | 62 #include "storage/common/fileapi/file_system_types.h" |
| 64 #include "testing/gmock/include/gmock/gmock.h" | 63 #include "testing/gmock/include/gmock/gmock.h" |
| 65 #include "testing/gtest/include/gtest/gtest.h" | 64 #include "testing/gtest/include/gtest/gtest.h" |
| 66 #include "third_party/cros_system_api/dbus/service_constants.h" | 65 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 67 | 66 |
| 68 using ::testing::Return; | 67 using ::testing::Return; |
| 69 using ::testing::ReturnRef; | 68 using ::testing::ReturnRef; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 } | 218 } |
| 220 return volume_info; | 219 return volume_info; |
| 221 } | 220 } |
| 222 | 221 |
| 223 std::vector<em::CPUTempInfo> GetEmptyCPUTempInfo() { | 222 std::vector<em::CPUTempInfo> GetEmptyCPUTempInfo() { |
| 224 return std::vector<em::CPUTempInfo>(); | 223 return std::vector<em::CPUTempInfo>(); |
| 225 } | 224 } |
| 226 | 225 |
| 227 void CallAndroidStatusReceiver( | 226 void CallAndroidStatusReceiver( |
| 228 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver, | 227 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver, |
| 229 mojo::String status, | 228 std::string status, |
|
yzshen1
2017/01/03 21:44:41
Please use const&. (here and elsewhere)
Sam McNally
2017/01/03 23:44:28
Done.
| |
| 230 mojo::String droid_guard_info) { | 229 std::string droid_guard_info) { |
| 231 receiver.Run(status, droid_guard_info); | 230 receiver.Run(status, droid_guard_info); |
| 232 } | 231 } |
| 233 | 232 |
| 234 bool GetFakeAndroidStatus( | 233 bool GetFakeAndroidStatus( |
| 235 mojo::String status, | 234 std::string status, |
| 236 mojo::String droid_guard_info, | 235 std::string droid_guard_info, |
| 237 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver) { | 236 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver) { |
| 238 // Post it to the thread because this call is expected to be asynchronous. | 237 // Post it to the thread because this call is expected to be asynchronous. |
| 239 base::ThreadTaskRunnerHandle::Get()->PostTask( | 238 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 240 FROM_HERE, base::Bind(&CallAndroidStatusReceiver, receiver, | 239 FROM_HERE, base::Bind(&CallAndroidStatusReceiver, receiver, |
| 241 status, droid_guard_info)); | 240 status, droid_guard_info)); |
| 242 return true; | 241 return true; |
| 243 } | 242 } |
| 244 | 243 |
| 245 bool GetEmptyAndroidStatus( | 244 bool GetEmptyAndroidStatus( |
| 246 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver) { | 245 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver) { |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1486 AccountId::FromUserEmail(kPublicAccountId)); | 1485 AccountId::FromUserEmail(kPublicAccountId)); |
| 1487 EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount()) | 1486 EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount()) |
| 1488 .WillRepeatedly(Return(true)); | 1487 .WillRepeatedly(Return(true)); |
| 1489 | 1488 |
| 1490 settings_helper_.SetBoolean(chromeos::kReportDeviceNetworkInterfaces, true); | 1489 settings_helper_.SetBoolean(chromeos::kReportDeviceNetworkInterfaces, true); |
| 1491 GetStatus(); | 1490 GetStatus(); |
| 1492 VerifyNetworkReporting(); | 1491 VerifyNetworkReporting(); |
| 1493 } | 1492 } |
| 1494 | 1493 |
| 1495 } // namespace policy | 1494 } // namespace policy |
| OLD | NEW |